I'm trying to get one type of breed to evaluate all the agents in another breed, and choose which one it likes best based on its own preferences of the characteristics of the other breed. Lets say i have two breeds, men and women. the women have random values for characteristics (variables generated at birth), lets say some value 0 to 10 for intelligence and attractiveness. To see which agents (turtles, patches, links, observer) can actually run a primitive, consult its dictionary entry. The men have preferences (also variables generated at birth) about how much they care about those characteristics. The NetLogo Dictionary has a complete list of built-in instructions (i.e. The String extension is now supported in NetLogo Web. I'd like the men to choose which woman they prefer most using a utility function, and move to them. Also note that the breeds-own command uses the plural form of the breed name.). user-defined turtle variables (also -own). Generate and characterize different breeds of agents using the breed functionality. the breed (also the name of an agentset containing all turtles of the. example of declaring a new breed of agents. PDF On Aug 1, 2015, Nicholas Bennett published NetLogo Tutorial Series: Mystery. Specify agents-environment interactions through patch variable and. About my model: My turtles have a bodysize (bsize), and a breed (male, female, juvenile turtles). packets of heat energy breed CO2s CO2 packets of carbon dioxide breed clouds cloud clouds-own cloud-speed. myself refers to the agent that is calling the current agent (it's probably the most confusingly named primitive in NetLogo).One problem is that your local variables pref-int and pref-att have the same name has the men-own variables.Women own to choose-mateīut netlogo doesn't seem to be able to access the variable values of women one I've referenced men with ask. New NetLogo User and first-time poster here, with some cannibalistic turtles on my hands. If you already have a frog 0, then the first mouse will be mouse 1, not mouse 0, since the who number 0 is already taken. It looks like you're using myself where you should be using self. To quote the Netlogo programming guide: 'Who numbers are assigned irrespective of breeds. However, of self is the same as some-variable, so you rarely use self. NetLogo automatically figures out who's variable you're referring to from the context. Set utiilty mans-pref-int * int + mans-pref-att * att So here are two ways to do what you're trying to do. Set utiilty ( of myself) * int + ( of myself) * att I prefer the myself version, but it's a matter of taste.Īlso, another observation. Its not a global attribute of a particular woman, but rather something specific to each man. ![]() to eat-weeds rabbit procedure gain 'weed-energy' by eating weeds if pcolor violet set pcolor black set energy energy + weed-energy end. Programming concepts: Agents, procedures, variables, ask, agentsets, breeds, synchronization. Be aware, that NetLogo will produce runtime errors if you measure variables for agents that do not belong to this breed.As such, I wouldn't recommend storing it as a woman-own variable. Hatching would also not work because it will create more collectors and not a new red bee.But I basically need something like: to take-money if turtle shape 'building institution' set money-held money-held + 1 end But I know that doesn't work. The problem arises because only the observer can create a new breed and not the collector. NetLogo Wilensky Voting model I am interesting in creating two breeds. At this point I want to create a new breed, lets say new variety of bee, i.e red-bees. NetLogo Model I am currently adapting the Wilensky Voting model from the NetLogo library. Next the collector will travel to some node, lets sat node with bee-hive. The edges of the graph are represented as undirected links by NetLogo, and we will use a specific breed: undirected-link-breed edges edge to which we. My collectors find a node on which bees are located, travel to it and collect the bees.( The way the model works is when the collector reach the node on which the bee is situated on, the bee is killed and collectors-own variable called, bees-collected will be updated by 1). There are two type of agents initially, lets say yellow-bees and collectors. ![]() I am working on a model which consists of a bunch of nodes which are connected by links.
0 Comments
Leave a Reply. |