I have 300 workers, and want to divide them into 3 sets of 100 (for now, eventually I will divide them perhaps unequally) based on two rankings. I have written variations to accomplish the following:
Select the top 100 on X, assign value 1 to variable A. Select the too 100 on Y (who have not ALREADY been assigned value 1 on A) and assign value 2 to variable A. Select remainder and assign value 3 to A
I have tried about a dozen approaches, without success. The closest I have come is to get the first 100. BUT, as there are ties, there are a few workers tied at the 100th-rank on X. Netlogo randomly selects one to receive value 1 on Variable A, which is fine. The problem is, because I haven't been able to figure out how to simultaneously construct three mutually exclusive agentsets using 2 criteria, I end up re-assigning workers from value 1 to value 2 on A. I can fix it by hand now, but eventually that won't be possible.
Here's the code that made the first value assignment:
ask max-n-of 100 workers [LPAdv] [set AWeight 1]
The problem seems to be that I cannot figure a way to reference the top 100 on Y of the remaining 200. Nor can I reference the bottom 100 of the remaining 200, because it is possible for a worker to be in the Top 100 on X but NOT in the Top 100 on Y, in which case they'll (wrongly) fall into the sequentially-identified agentset unless I delete them from the operation. I've tried using member? and man other possibilities. Basically, I don't know how to simultaneously dump the first 100 of 300 and only "sort" the remaining 200 to make the assignment.
I've looked at multiple sources for an answer, so far to no avail. I've made a lot of progress on my code since Saturday, but this is a stumbling block.
Any assistance is greatly appreciated!
Thanks! SLuke
RESOLVED! (YAY!)
In case anyone else has the problem, what I did is the following:
Note that LPMid2 sets the AWeight=1 to -1000, which is way out of range for the actual LPMid variable I later will need.
Sorry to bother the list; I hope the answer is of use to someone else should they have a similar problem.