My sellers set trade_Price with this code:
ask buyers [ ask sellers [if any? buyers-here [ if seller_Price <= [buyer_Price] of myself
[ set trade_Price seller_Price + random ([buyer_Price] of myself - seller_Price) ]]]]
I want that my buyers also took the same trade_Price if they have a seller in the same patch.(if any? sellers-here). and I code it so:
ask sellers [ ask buyers [if any? sellers-here [set trade_Price ( [trade_Price] of myself )]]]
I think its wrong code because I got different trade_Price s from my agent couples. Do you have any idea how can I set it? Best reagrds
As far as I can tell, you're trying for something like this:
Note that there is no
ask sellersaround this. You only want each buyer to run this once each time throughgo.Note that if there are multiple sellers on the patch,
one-of sellers-herepicks one randomly.