

This is a good indicator of how well a strategy is doing relative to the maximum possible average of 5 points per interaction. PlotsĪVERAGE-PAYOFF - The average payoff of each strategy in an interaction vs. UNKNOWN - This strategy is included to help you try your own strategies. UNFORGIVING - Cooperate until an opponent defects once, then always defect in each interaction with them. If an opponent defects on this interaction, defect on the next interaction with them. TIT-FOR-TAT - If an opponent cooperates on this interaction cooperate on the next interaction with them. Strategy descriptions are found below: Strategies Each of these determines how many turtles will be created that use the STRATEGY. N-STRATEGY: Multiple sliders exist with the prefix N- then a strategy name (e.g., n-cooperate). GO ONCE: Same as GO except the turtles only take one step. GO: Have the turtles walk around the world and interact. The number of turtles and their strategies are determined by the slider values. SETUP: Setup the world to begin playing the multi-person iterated prisoner's dilemma.
#Random float netlogo how to
In this model, something good is awarded- money.) HOW TO USE IT Buttons In PD BASIC, you were awarded something bad- jail time. (Note: This way of determining payoff is the opposite of how it was done in the PD BASIC model. When two turtles interact, they display their respective payoffs as labels.Įach turtle's payoff for each round will determined as follows: | Partner's Action While some strategies don't make use of this information, other strategies do.) (Note that each turtle remembers their last interaction with each other turtle. The turtles with different strategies wander around randomly until they find another turtle to play with. One such approach to doing this is to create a world with multiple agents playing a variety of strategies in repeated prisoner's dilemma situations. This makes it difficult to determine a single "best" strategy. Tit-for-tat does poorly with the random strategy, but well with itself. For instance, always defect does best of any against the random strategy, but poorly against itself. Each possible strategy has unique strengths and weaknesses that appear through the course of the game. The PD TWO PERSON ITERATED model demonstrates an interesting concept: When interacting with someone over time in a prisoner's dilemma scenario, it is possible to tune your strategy to do well with theirs. If you are unfamiliar with the basic concepts of the prisoner's dilemma or the iterated prisoner's dilemma, please refer to the PD BASIC and PD TWO PERSON ITERATED models found in the PRISONER'S DILEMMA suite. It is intended to explore the strategic implications that emerge when the world consists entirely of prisoner's dilemma like interactions. This model is a multiplayer version of the iterated prisoner's dilemma.

#Random float netlogo code
(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.Do you have questions or comments about this model? (suggested things for the user to try to do (move sliders, switches, etc.) with the model) (suggested things for the user to notice while running the model) (how to use the model, including a description of each of the items in the Interface tab) (what rules the agents use to create the overall behavior of the model) (a general understanding of what the model is trying to show or explain) "treat-cost " 1.0 0 - 1184463 true " " "plot sum-cure-consume WHAT IS IT? "cured " 1.0 0 - 14070903 true " " "plot count turtles with " "sick " 1.0 0 - 5298144 true " " "plot count turtles with " Ifelse (abs xcor < 18 and abs ycor < 18)[ if near hospital, random throw to non hospital area Turtles move if not in hospital at random. If random-float 1000 average-symptomappear-time pay attention if use die, the code after die will not process because of the deathrate too small, the random hardly get Set sum-cure-consume sum-cure-consume + average-cureconsume-oneday process all the turtles on hospital-area Set sick-time random 7 set the sick-time random, so that the sicker that has sym can go to hospital
Set hospital-patches patches with Īsk non-hospital-patches Īsk n-of ((number-people * initial-infected-percent) / 100) turtles[ Non-hospital-patches area of non-hospital Temp-sicker caculate the sicker in every step Sum-cure-consume caculate the total consume of cure Sick-time from infected, caculate by days, cured goto 0Ĭure-time from go into hospital, caculate by days Sick? if true, the turtle is infectiousīody-statue four value: 0 normal 1 infected 2 cured
