agent-based-modeling

how can i set a probability for each action?

眉间皱痕 提交于 2019-12-13 01:12:36
问题 I've got some turtles which are looking around themselves. For each neighbor they've got, they save the value of "output-heat". The patch with the highest value will get the highest probability and the lowest value the lowest probability. I want the turtle to move to another patch. The moving should be dependent on the probabilities. My code looks like this, but it doesn't work like it should: ask turtles-here[ let temp_ahead [(output-heat + 1)^ Freedom] of patch-at 0 1 let temp_right_ahead [

difficult to find the current location of agents in Anylogic simulation

£可爱£侵袭症+ 提交于 2019-12-11 17:35:09
问题 i built a simple model for pedestrian movement from start line towards target line, I want to find the number of moving agents in some area using the XY-coordinates (from X=150 to X=350, Y is the same ) The action for the event is to get the count of agents in that area and set the value for the variable crowd1: crowd1=count(agents(), p-> p.getX()>150 && p.getX()<350) the problem is that it's always 0 , even though the gents are moving in the simulation. 回答1: There are no agents in your

How to run several procedures simultaneously in NetLogo?

痞子三分冷 提交于 2019-12-11 13:54:41
问题 There are different colored turtles in my model each operating under different rules. I want procedures governing the movement of one turtle(say, red turtle) to run simultaneously with other procedures governing the movement of different colored turtles. 回答1: Alan's answer is the correct one. However, just FYI - each turtle (whether red or blue) will act in turn with the above procedure, and none with act "at the same time." That just doesn't happen in NetLogo, by default. However, you can

Netlogo: Making a turtle interact with anotherone after evaluating similarity in a given variable

旧城冷巷雨未停 提交于 2019-12-11 09:01:48
问题 I have several turtles each with three variables opinion1, opinion2 and opinion3. I need them to: identify which of these three variables has the highest value find another turtle in their network with a value at least as high as the one found in 1. update its own value found in 1. with respect to that of the turtle found in 2. What I have done doesn't really work because it only updates looking at o1 without really having a look at which of the tree (opinion1, opinion2 or opinion3) is the

Repast: how to get a particular agent set based on the specific conditions?

耗尽温柔 提交于 2019-12-11 02:31:00
问题 I am previously working with Netlogo and there are some very good built-in methods that allow me to filter and control the desired agents from the total population. (see: http://ccl.northwestern.edu/netlogo/docs/dictionary.html#agentsetgroup). For instance, I could very easily to command the different class of people agent in a simulation with simple codes like: ask peoples with [wealth_type = "rich"] [donate money...] ask peoples with [wealth_type = "poor"] [get money from rich people...] In

Effectively deactivating specific links between specific agents and breeds in a social network

谁说我不能喝 提交于 2019-12-11 01:47:40
问题 A social network of agents of different ages is set up in NetLogo similarly to the following, which results in a circle of agents connected by links. The overall purpose of these links is to represent contact between those links. The model simulates the spread of infection through the network. Agents begin as susceptible, with the possibility of becoming infected if they come into contact with an infectious link neighbour. I want to model for example the isolation or quarantine of an infected

Data Structure for Spatial Agent Based Modeling [closed]

天涯浪子 提交于 2019-12-09 11:49:52
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . What are some good data structures for keeping track of agents in a two-dimensional, spatial simulation? I've seen some references to quadtrees (which I understand) and kd-trees (which I don't understand very well). I'm looking for something through which an agent can

How to create random binary/boolean variable in Netlogo

前提是你 提交于 2019-12-06 14:47:19
问题 I'd like to assign a random boolean variable to each turtle, but I'm not seeing a function that would simulate a draw from a Bernoulli distribution. This gets close, but it's awkward: ifelse random-in-range 0 1 < .5 [set expensive? false] [ set expensive? true ] Anyone know a better way? 回答1: A few options: one-of [ true false ] random 2 = 1 random-float 1 < 0.5 - If you need to modify the probability, to get any Bernoulli distribution you want If I deal with a lot of probabilistic stuff in a

How to create random binary/boolean variable in Netlogo

跟風遠走 提交于 2019-12-04 19:26:45
I'd like to assign a random boolean variable to each turtle, but I'm not seeing a function that would simulate a draw from a Bernoulli distribution. This gets close, but it's awkward: ifelse random-in-range 0 1 < .5 [set expensive? false] [ set expensive? true ] Anyone know a better way? Bryan Head A few options: one-of [ true false ] random 2 = 1 random-float 1 < 0.5 - If you need to modify the probability, to get any Bernoulli distribution you want If I deal with a lot of probabilistic stuff in a model, I like to add to-report probability [ p ] report random-float 1 < p end as an easy

Data Structure for Spatial Agent Based Modeling [closed]

匆匆过客 提交于 2019-12-03 14:54:05
What are some good data structures for keeping track of agents in a two-dimensional, spatial simulation? I've seen some references to quadtrees (which I understand) and kd-trees (which I don't understand very well). I'm looking for something through which an agent can efficiently say, "I know my location, and I would like to know which agents are near me (within a certain radius of myself)." Examples (pseudo-code is fine) would be greatly appreciated. I'm working in Java. Well, I'm not sure exactly how it is implemented, but the MASON toolkit uses a discretization algorithm that places agents