I'm new to stackoverflow but have a question regarding my model.
My model consists of two breeds of agents (fishers and processors). Currently I have two fishers and two processors. Both breeds have a certain price-perception variable called: price-perception-fisher and price-perception-processor. Fishers go out fishing and once the ship is full (catch = 750) they return to one of the processors. This is done by this function:
to return-from-fishing ;; makes fishers return once they have a certain amount of fish
if epi-catch >= 1000 or exp-meso-catch >= 750
[move-to one-of processors
set arrived-at-processor? true
]
end
What I would like to do is compare the price perception of a fisher to the price-perception of the processor that the fisher visits.
Currently I have tried to do this by creating two lists; one for the price perception of processors and one for the price perception of fishers. I compare them using list-transactions (map > list-of-fishers-price-perceptions list-of-processors-price-perceptions)
What this does is iterate through both lists and compare the values in the list. However the problem is that the values are compared randomly and I want the fisher to compare his own price with that of the processor he visits. If the price-perception-fisher is higher to the price-perception-processors the fisher moves to another processor, else they will peform a transaction
An example from my model is as follows:
Variables of turtles are initialised as follows:
set fisher 0 price-perception-fisher 12.5
set fisher 1 price-perception-fisher 15
set processor 2 price-perception-processor 10
set processor 3 price-perception-processor 15
As fishers randomly move to one of the processors, both fishers could move to processor 2. The expected output would then be:
fisher 0 (12.5) moves to processor 2 (10) and as 12.5 >= 10, the value should be true
fisher 1 (15) moves to processor 2 (15) and as 15 >= 15, the value should be true
However I get this output, because the lists don't understand that the fishers have moved to just processor 2 and therefore they compare the price-perception-fisher 0 with price-perception-processor 3, while I want the comparison between price-perception-fisher 0 with price-perception-processor 3 in this case.
[15 12.5] ; fishers price perceptions
[10 15] ; processors price perceptions
[true false]
Would there be a way to do this?