

#Netlogo code code
The expected travel speed for the next trip is then calculated through a linear function of the memorised travel speeds.I am trying to port this pseudocode into NetLogo, and finding it difficult because NetLogo requires a literal to be used as a list index, rather than allowing a variable containing the index value (such as index in the code below) to be used.

Every time an agent travels to work, the memory is updated by deleting the oldest memorised event and adding the newest memory. The memory of agents relates to their cognitive effort and differs between agents. Basically, the higher the similarity with their peers in relation to their expectations and their choices, the less uncertain they feel.Īll inhabitants start with a memory of travel speed per travel mode, this can be based on average speed per travel mode. To calculate_relative_overall_need_satisfaction ifelse ( ( 1 - inhabitant_overall_need_satisfaction ) > inhabitant_aspiration_level)Īgents experience uncertainty from two factors: 1) difference between their travel speed expectation from that of their peers, and 2) difference between their current travel mode and that of their peers. With 0 being the best and 1 the worst Similarity among peers Similarity is based on selected travel mode, whereas superiority is based on travel-speed (so travel time/ travel distance). These two factors(similarity and superiority) are calculated to calculate the social need satisfaction. Agents generally feel more satisfied with their own choices when their choice is relatively similar to that of its peers, while at the same time they feel more satisfied when they are performing slightly better than their peers. Social need satisfaction calculationsĪn agent social need satisfaction relates to the level of satisfaction an agent gets from a specific choice in relation to the choices made by its peers. The aspiration level is fixed throughout the simulation and randomly set per agent at the beginning. These three needs are then joint in an overall need satisfaction calculation and compared to the “aspiration level” of the agent (to calculate the “relative overall need satisfaction”). Personal satisfaction has to do with what one likes to doĮxistence need satisfaction has to do with Social need has to do with satisfaction related to doing things similar and superior to peers/others NEEDS SATISFACTION CALCUALTIONSĪgent calculate an need satisfaction which is build up out of: Let prey other inhabitant if prey != nobody The 5 agents with the lowest “difference” score will be selected as peers. These four factors will then we used to calculate a difference score expressed as the difference between the agent and a potential peer. Relative difference in home-work distance (so if agents travel similar distance too work they are more likely to become peers). Travel mode is variable and is calculated every time step (potentially even several times in one time step- every time an agent needs to decide on a new travel.ĭistance between my home and home of potential peer_ (so if agents live near each other they are more likely to become peers). Selecting peers is based on the following four factors:ĭifference in travel mode preference_ (so if agents have the same preference hey are more likely to become peers) Travel mode preference is fixed throughout the simulation and will be set randomly at the start of the simulation)ĭifference in travel mode selected_, so if agents have the same travel mode they are more likely to become peers). Peers will be selected every time step (or before every relevant decision). Their relative satisfaction level and relative uncertainly then determine their behavioral strategy. The outcome determines their satisfaction level as well as the uncertainty they experience. Agents compare their experiences, decisions and preferences with their peers. The model can be divided into several main blocks:Īgents “interact” mainly with their peer network.
