Spread of Cardiovascular Disease
No preview image
Model was written in NetLogo 5.0.4
•
Viewed 425 times
•
Downloaded 23 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
Comments and Questions
Click to Run Model
;; objective - show how the spread of CVD relates to the number of fast food/fitness centers in the area. turtles-own [ reward memory ] to setup ;;I need to create people and place them at random coordinates clear-all let reward_list [] crt humanpop ask turtles[ set color brown set shape "person" setxy random-xcor random-ycor ] ;;I need to make it so that food joints appear randomly around the interface ;;set the slider as food? crt food[ set shape "food" setxy random-xcor random-ycor set color yellow set size 1.5 set reward reward - 1 ] ;;I need to create fitness centers now crt fitness [ set shape "drop" setxy random-xcor random-ycor set color green set size 1.5 set reward reward + 1 ] end to go ;;I need to make the humans move around in a random pattern, visiting either the fitness centers or fast food joints ask turtles [ if shape = "person"[ set reward reward right random 360 fd 1 let turtlesmemory memory let turtletoface min-one-of turtles with [reward < 0] [distance myself] death]] end to death if reward < -10 [die] end
There is only one version of this model, created over 11 years ago by Hannah Warren.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.
Hannah Warren
help? (Question)
I'm trying to make it so that the humans can and will be attracted to either the food or fitness centers. And... depending on which center they visit, their energies will either increase or decrease by some random value. However, once their energies reach -10, they will die. I can't figure out how to do this. Help, anyone?
Posted over 11 years ago
Reuven M. Lerner
Getting help
Hi, Hannah. I'm afraid that the Modeling Commons communit is still relative small, and I'm not sure how many people saw your request for help. You might do well to send a note to the netlogo-users group, asking your question there and providing a link to the model that you uploaded (i.e., this page). That way, you'll reach a large number of people with NetLogo expertise, who can then view your model and offer comments and suggestions. I accidentally clicked on "recommend" for your model just now, although if that helps to call attention to it, all the better.
Posted over 11 years ago
Muhammad Irfan Azhar
Answer (Question)
Dear Hannah! one of the ways for doing your task will be to use variables for people. For example, a variable 't' could be assigned to a breed 'people'. You could assign random values to t. For example values ranging from 1 to 30 could be assigned to t. Depending on how often do you want people to go to food or fitness center, you can set conditions on the variable t. Like, if t&rt;20, person would go to fitness, else the person is attracted to food. With this condition, most of the agents will be attracted to food. you can make procedures like fitness, food and die for mimicking these scenarios. Then you could set conditions for varying energy. like if an agent spends 20 ticks in fitness, its energy reduces by 10 units, if an agent takes food, its energy increases by 20 or you could make these relations the way you like. I hope it will be useful for you. If there are some queries, you can ask further. Regards!
Posted over 11 years ago