![]() ![]() If the variables have the same name, you can use the shorter syntax inputs += prototype.mapped mapped input: the syntax inputs += prototype mapped "netlogo-variable" establishes a link between the workflow variable prototype (Val) and the corresponding netlogo variable name "netlogo-variable" (String).seed random seed, optional, defaults to None.reuseWorkspace should the same workspace be reused when executing on a given jvm (use to avoid MetaSpace errors with large NetLogo models loading several extensions when executed a large number of times on the same jvm), optional, defaults to false.embedWorkspace should the workspace be embedded for execution of the model (use if you have source files or extensions in the model directory), optional, defaults to false.launchingCommands NetLogo commands to be executed, mandatory.The arguments for a NetLogoTask are the following : It is written as netLogoOutputs in the definition of the task. Similarly, an output of the model is considered and collected by OpenMOLE at the end of each model execution. Therefore they appear as inputs of the NetLogoTask. The replication and density OpenMOLE variables are used as parameters of the NetLogo program. If you use the forever button go in the NetLogo GUI don't forget that you will need something like "while " in the command list, as openmole won't loop your go function by default. For this particular model, this function is called until no more turtles are active. setup calling the setup function of the nlogo file,.random-seed initializing the random number generator of NetLogo using the seed provided by OpenMOLE,.In this example, the command list contains: NetLogo6Task(workDirectory / "ogo", cmds) set ( Here is an example on how to write the NetLogo task for the model ogo: The task comes in two versions : NetLogo5Task and NetLogo6Task, be sure to select the right version of the task according to the version of NetLogo you are using (5 or 6). the list of NetLogo commands to be run by OpenMOLE.OpenMOLE provides a NetLogo task which expects the following parameters: It is conceived to be accessible to non-programmers and thus enhances inter-disciplinarity in the construction of simulation models, but can also be used to program large scale complex models (despite its bad reputation, see this paper testing NetLogo speed performance and suggesting code improvements).Īs it runs on the JVM, it is naturally integrated into OpenMOLE. Which is also faster because it will only engage with turtles (who, by definition, are standing on a patch) rather than engaging with every patch even if there are no turtles on it.NetLogo is a widely used agent-based modeling platform and language developed by CCL at Northwestern University (see the official website). Or, given that turtles can automatically read and change the patches-own variables of the patch they are standing on, you can make it even simpler: to computingFrequency Therefore, you can achieve your goal by individually asking every turtle on the patch to append their who to visitantBees: to computingFrequency For example, of turtle 0 is just its color, not a list containing a color. not a list (unless that value is a list in itself, of course). On the other hand, when you ask a single agent to report one of its variables, you get the value as such, i.e. And anything that is fit to contain multiple agents has to be an agentset. ![]() ![]() So, why is turtles-here an agentset? Because, even if sometimes turtles-here can contain 0 or 1 turtle, it can also contain multiple turtles. For example, if you wanted to know of turtles, the only way NetLogo has to give you this information is to put all the turtles' colors in a list. While visitantBees is a list because you set it as a list, why is of turtles-here a list? Because turtles-here is an agentset - and the only way to report a variable of an agentset is to create a list. The reason why you get a list of lists is that both visitantBees and of turtles-here are lists. ![]()
0 Comments
Leave a Reply. |