spd_ex v0.1.0 SpdEx
Main module
Link to this section Summary
Functions
Check whether the calculation is converged or not
Generate n agents with continuous ID from 1 to n
Return fraction of cooepartors
From the given agent_list, search agents whose ID is in the given neighbors_id
Decide the next strategy by Imitation-Max rule
Set initial cooperators
Add neighbors to all agents. Only neighbor’s id is provided to focal agents
Main function
Count payoff obtained in one timestep
Decide the next strategy by PW-Fermi rule
Time evolution loop. The entire procedure is as follows;
- Agents get payoff
- Decide the next strategy based on PW-Fermi
- Update strategy
- Count the fraction of cooperators
- Check whether converged or not
- If converged, stop the calculation with a given dilemma setting. If not, go to the next timestep
Insert next strategy into current strategy
Write the fraction of cooperators to csv file
Link to this section Functions
Check whether the calculation is converged or not.
Generate n agents with continuous ID from 1 to n
Return fraction of cooepartors
From the given agent_list, search agents whose ID is in the given neighbors_id
Decide the next strategy by Imitation-Max rule
Set initial cooperators
Add neighbors to all agents. Only neighbor’s id is provided to focal agents.
Main function
Count payoff obtained in one timestep
Decide the next strategy by PW-Fermi rule
Time evolution loop. The entire procedure is as follows;
- Agents get payoff
- Decide the next strategy based on PW-Fermi
- Update strategy
- Count the fraction of cooperators
- Check whether converged or not
- If converged, stop the calculation with a given dilemma setting. If not, go to the next timestep.
Insert next strategy into current strategy
Write the fraction of cooperators to csv file