NetLogo banner

NetLogo Publications
Contact Us

Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Farsi / Persian


NetLogo User Community Models

(back to the NetLogo User Community Models)

[screen shot]

If clicking does not initiate a download, try right clicking or control clicking and choosing "Save" or "Download".(The run link is disabled for this model because it was made in a version prior to NetLogo 6.0, which NetLogo Web requires.)


This model studies how social decision, known as magnetization, changes over time. Social decision is modeled as the average opinion of all agents. Agents have one of two opinions. They adjust their opinion over time based on their current opinion, the opinions of their related agents, and the global ease of opinion change. As agent opinion changes, so does social decision.


The two possible opinions are modeled as +1 and -1 and are also called the spin of the agent. When the model is initially setup, each agent is randomly assigned an opinion. As the simulation runs, agents adjust their opinion. This adjustment depends on two factors; the difference between an agent's opinion and the opinions of their neighbors, and the global temperature variable. If the sum of all the spins of an agent's neighbors has an opposite sign than the agent's spin, then then the agent changes its opinion. If the signs are the same, then there is still the possibility that the agent will switch spins. This depends on the temperature variable and a random component; the full details are described in the code under the GO section. As the simulation runs and agents change their opinion, the user can track the magnetization over time.


There are three different options in the setup of the simulation: Preferential Attachment, Fully Connected, and Random Network.

-Preferential Attachment: Arranges N agents into preferential groups determined by the m0 and m variables.
-Fully Connected: Arranges N agents into a circle and connects each agent with every other agent.
-Random Network: Arranges N agents into a circle. Then each agent creates links with m random other agents. Though each agent may only select m targets, it is possible for one agent to be the target of more than m other agents.

After selecting the setup procedure, the agents will appear on the screen. Agents are colored two different shades of blue. Darker blue represents spin -1, and lighter blue represents spin +1. To get a better look at the colors of the agents, press the resize button to increase their size. Press it again to change the agent size back to normal.

When using the Preferential Attachment setup, the Layout button may be pushed to give a better view of the structure. Press the Layout button again to stop the movement. By selecting On from the manual-layout? switcher, you can use the spring-length, repulsion-constant, and spring-constant sliders to adjust the layout options.

You may now start the simulation by pressing the Go button. Agent's will adjust their opinion and change their color. In addition, the change in magnetization will be tracked on the plot on the right side of the interface. Adjusting the plotting-interval slider will change the update frequency of the plot. When you have finished, press the Go button again to stop the simulation. The magnetization will be recorded in the monitor box labeled magnetization. This is the average spin of all the agents, and it represents the social decision of the agents.

If you wish to move the agents around, press the move-nodes button. This will allow you to move the various agents. There are four options under the style chooser. These will allow you to adjust the layout of the agents, and also the set spin option will allow you to change the spin of selected agents. In conjunction with the set spin option, the set-spin-1? chooser decides what spin the agents are changed too; +1 if it is On, and -1 if it is Off. The calib button will then recalculate the magnetization after the spins are adjusted. Furthermore, the move-type chooser will allow you to adjust which agents move, if it is just the agent you select, or if additional agents will move as well. The agent being moved and the number of other agents being moved with it are tracked by the two corresponding monitor boxes.


Notice how magnetization changes over time, and how this differs how models of the three setup types.


Adjust the initial magnetization to see how this affects magnetization over time. Adjust the sliders under the Variables header to see how they affect the various setups, and therefore the magnetization. Adjust the temperature variable to alter the likelihood of opinion changing, which in turn will affect the magnetization and social decision of the simulation.


Given that it is still possible for an agent to change its opinion despite complete magnetization given a high enough temperature variable, it may be interesting to see what happens when one adjusts the procedure that determines if an agent changes its opinion due to change. This function depends on the temperature, the agent's own spin, the sum of spins from the agent's linked neighbors, and a random uniform draw. By changing this function, one may change the outcome of the magnetization in this simulation. The function is found in the GO section of the code.


Confident Voter
Heterogeneous Voter
Social Consensus

(back to the NetLogo User Community Models)