![]() ![]() 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. poll-dispersion, if positioned at 1.00 no pollution is dissipated, if positioned at 2.00 50 of pollution. 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 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. 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. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.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. This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL. If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software: This model is based on the NetLogo Flocking model. These are oftentimes used to change the properties of agents such as color, position. How does adding roads change the pattern of nest infection? CREDITS AND REFERENCES In NetLogo, knowing when to use if, ifelse, ifelse-value is important. Press the ADD ANOTHER ROAD button to add a second road. HOW TO USE ITĬlick GO to start the parasites. Monitor windows count the number of nests, and the number of infected nests separately. Initil numbers of NESTERS and PARASITES are determined with sliders. Parasites will fly in a random pattern, but tend to stay close to the road. PARASITES are clustered on the edge of the forrest. The NESTERS are radnomly distributed through the forrest. The forrest is bordered by a brown road on each side. The black icons are NESTERS, their nests do not move. The red icons are PARASITES, parasites fly around the edge of the forrest, looking for nearby nests to lay eggs. When cuckoo eggs hatch, the chicks push nestmates out. ![]() Cuckoos lay eggs in the nests of other birds. It has the following structure: if condition command(s). The NEST PARASITES model simulates the ecology of European cuckoo birds. if is a primitive that allows us to define conditional agent behaviors. (For example, if you have multiple applets in differentĭirectories on the same web server, you may want to putĪ single copy of the NetLogoLite files in one central place andĬhange the archive= lines of all the HTML files to point In the HTML code to point to their actual locations. In the procedure of 'FirstIrrigation', I ask RiverVolumes to move to the. If the NetLogoLite files and your model are in differentĭirectories, you must modify the archive= and value= lines Does anyone have suggestions on how to code an IF/IFELSE command with 2 conditions in NetLogo Attached is the code. and ending with, and paste it into any HTMLįile you want. If you want, you can just take the HTML code beginning with You don't need to include everything in this file in your page. Though, so if it doesn't work from your hard drive, please try On some systems, you can test the applet locally on your computerīefore uploading it to a web server. (You can copy NetLogoLite.jar and įrom the directory where you installed NetLogo.) (NP.nlogo), and the files NetLogoLite.jar and In order for this to work, this file, your model file ![]() Windows and Linux users may obtain the latest Java from Mac users must have Mac OS X 10.4 or higher. Java must be enabled in your browser settings. ![]() This page was automatically generated by NetLogo 5.0.5. ![]()
0 Comments
Leave a Reply. |