![]() Move-to one-of patches with Īdditionally, you have ask one-of turtles in your ask firms statement- I think you want to omit that as done in this example so that the firm doing the evaluating is the agent that moves- ask one-of turtles will just choose a random turtle of any breed. If offshored? and profit < min of firms with [ For example, you could use min to get the minimum profit value of those other firms of interest: breed įirms-own You could have a reserved-by reference instead of a reserved boolean. #NETLOGO BOOLEAN PATCH#You can't have a link between a patch and a turtle, but you can store a reference to a turtle in a patch variable. You can't compare a single value to a list of values directly in this manner, so you'll have to go about it a different way. 3 First, a few minor points: The proper way to refer to the reserved variable of patch 0 -1 is reserved of patch 0 -1. The setup above is not going to do anything,The main problem may be that you're comparing a firm's profit variable to a list ( of firms with ). If offshored? true AND profit < of firms with the firm reshoresĪND set reshored? true ] ] the firm is now labelled as reshored Please find the (error-reporting) code I have so far below: breed The moving section of the code works alright. ![]() IF the parameter of the label offshored? reports = true AND the profit of any of these firms is lower than the profit of the firms which report offshored? = false, than they are supposed to move. ![]() I struggle with combining the IF and the AND command. ![]() There is something not right about the code. My turtles are firms and they have a turtles-own which is a profit varying from firm to firm, as well as offshored? and reshored? which is either true or false. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |