NetLogo4_1‎ > ‎


Using social psychology theory for modelling farmer decision-making

This model is described in Millington (2012) Using social psychology theory for modelling farmer decision-making, In: R. Seppelt, A.A. Voinov, S. Lange, D. Bankamp (Eds.) International Environmental Modelling and Software Society (iEMSs) 2012 International Congress, Managing Resources of a Limited Planet. Leipzig, Germany That document also contains an ODD description of the model (but also see description below).

You can download the NetLogo code (and associated scenario files) and run the model with NetLogo (version 4.1) on your local machine.

Model source code: iEMSs12_model.nlogo

Example scenario files:

Powered by NetLogo The applet requires Java 5 or higher. Java must be enabled in your browser settings. Mac users must have Mac OS X 10.4 or higher. Windows and Linux users may obtain the latest Java from Sun's Java site.



This model is for the exploration of individuals’ self-identity change. The model is developed in the context of theory outlined in Stryker and Burke (2000) and Burton and Wilson (2006). In particular, it is intended to be used to examine and investigate questions regarding farmer self-identity, structure-agency, and the ‘temporal discordance’ in the transition towards a post-productivist agricultural regime (Burton and Wilson 2006).


The model represents agents that have a self-identity composed of four sub-identities in an identity standard; Producer, Diversifier, Conservationist and Agri-business. Each of these sub-identities has a salience towards the overall agent identity. The total salience for all four sub-identities equals 1.0 with values for each sub-identity denoting its relative importance towards overall agent identity. Salience values are held in a list named id-standard.

Agents express their identity through behaviours. Each behaviour represents a sub-identity, and hence there are four possible behaviours that agents can express. In the NetLogo version of the model these behaviours are manifested as patches that compose the agents ‘farm’ (an agentset named behaviours-expressed). The maximum number of expressed behaviours (i.e. patches) an agent can own is 20. The minimum number is given by minimum-behaviours (in version 1 this is uniform across all agents and has a default value of 10). Each patch has a behaviour variable which is the behaviour expressed it represents.

Agents monitor the difference between their identity, their expressed identity and the expressed identities of other agents in their social network. An agent’s expressed identity is represented as a standard, in the same format as id-standard and is named id-expressed. The social network is the set of agents that a given agent can observe the id-expressed of. The mean expressed identity of an agent’s social network is thus also represented as a standard, named id-expressed-social. The cumulative difference between id-standard and id-expressed is held in each timestep by the id-error-behaviour variable, and the cumulative difference between id-standard and id-expressed-social is held by the id-error-social variable. For an agent’s social network, the extent to which agents connected to a given agent are in turn linked to each other is enumerated by the agent’s cluster-coefficient.

At each timestep agents attempt to minimise id-error-behaviour or id-error-social depending on whether the agent was able to modify their expressed behaviours. Agents may not be able to modify their expressed behaviour because of resource constraints. These resource constraints are determined by the value agents can gain from expressing each behaviour (uniform across the simulated world), the costs of exhibiting behaviours (uniform across the simulated world), the yield agent-variable (can be uniform for all agents or vary across the simulated world) and whether an individual agent is able to express the Agri-business sub-identity (indicated by the available-A agent-variable). Together, for each agent the value of these variables determines how much profit and agent can turn in a given timestep and contributes to an agent’s wealth. If in anytime step an agent’s wealth becomes negative, they are removed from the simulation.

Representation of space and time are abstract and not intended to represent any real units.


In each timesteps agents execute the following steps:

  1. Update behaviours-expressed;
  2. Update id-error-behaviour (as id-expressed may have changed in step i);
  3. Potentially add links to other agents who have changed their behaviour in a similar manner (in this timestep);
  4. Update id-expressed-social and id-error-social (as the social network, and the behaviours expressed by it, may have changed in step iii and step i respectively);
  5. Adjust id-standard to reduce id-error-behaviour or id-error-social;
  6. Update id-error-behaviour (because id-standard may have changed in step v);
  7. Potentially remove links to agents that no longer share a similar identity (because id-standard may have changed in step v);
  8. Update id-error-social (because id-standard may have changed in v and social network may have changed in step vii).

Agents may update their behaviours-expressed (step i) using one of three strategies depending on their circumstances. First, agents may update behaviour to maximising profit. Second, agents may update their behaviour to minimise id-error-behaviour but ensuring that profit is > 0 (satisficing). Third, agents may update their behaviour to minimise id-error-behaviour with no regard for income (this third strategy is employed when values and costs are not represented in the model). If the Agri-business sub-identity has either the greatest or second-greatest value in an agent’s id-standard, the agent will maximise profit, otherwise the agent will satisfice. Profit is calculated as income – costs. Income is set by the user and in the case of the Producer behaviour weighted (multiplied) by the yield of each agent. Costs are uniform for all behaviours (at 0.5 per expressed behaviour). In each timestep agents are able to make only a single behaviour change (i.e. change the behaviour of only one patch in behaviours-expressed). Agents identify the most appropriate combination of behaviours by evaluating all possible swaps in behaviour. Agents also consider removing an expressed behaviour, and consider adding a behaviour if able to express the Agri-business sub-identity (i.e. available-A is true). If no change improves profit or reduces id-error-behaviour (depending on the strategy), no changes in behaviour are made.

If a change in behaviour is made, agents must visit the meeting-point corresponding with the behaviour change they have made (if the user has set meeting-point? on). For example, if the agent has changed a Producer behaviour to a Conservationist behaviour, they must visit the conservationist meeting point. There is a single conservationist meeting point and a single diversifier meeting point in the simulated world. There may be a single or multiple producer meeting points (multiple if multiple-meeting-points? is set on). If there are multiple producer meeting points, they are positioned in each corner of the world and agents go to the meeting point nearest to them. While at the meeting point, agents make a reciprocal link with a randomly selected agent also at the meeting-point at that time (i.e. the agents each become a member of the other’s social network, step iii).

After updating id-expressed-social and id-error-social (step iv), agents adjust their id-standard to reduce id-error-behaviour or id-error-social (step v). If a change in behaviour was made (or no change was made because id-error-behaviour = 0 and profit > 0) id-standard is updated reduce id-error-social. However, if no change in behaviour was made (and id-error-behaviour > 0), id-standard is updated to reduce id-error-behaviour.

After updating id-error-behaviour (step vi, because id-standard may have changed in step v), agents potentially remove links to agents that no longer share a similar identity (because id-standard may have changed in step v). Agents cut outgoing links (to the agents they observe) if the most represented behaviour in the observed id-expressed is not also the highest salience in the observers’ id-standard or the most represented in their own id-expressed. Finally, agents update id-error-social (because id-standard may have changed in v and social network may have changed in step vii).


Basic principles.
The basic principles underlying the design of agent identity and identity change can be found in Stryker and Burke’s (2000) review of identity theory. The motivation comes from the issues and hypothesised farmer self concepts discussed in Burton and Wilson (2006). In particular, the four identities represented here correspond to those discussed by Burton and Wilson (2006).

Burton and Wilson (2006, p. 96) discuss the difference between the importance of agency and structure for the P/PP/MF; "Human ‘agency’ (e.g. farmers in the context of our study) is, thereby, expressed through social systems (e.g. farming culture), beliefs, attitudes and identities (e.g. occupational or religious identities), while ‘structure’ is based on rules (e.g. agricultural policy; politics), resources (e.g. farmland) or other exogenous forces (e.g. the wider political economy of farming) influencing farmers’ actions and thought."

In this model, agency is represented through the expression of farming culture (farmers' identity standards and interaction and change in those standards) through abstract 'behaviours'. Structure can be represented by setting values for behaviours, specifying farmer yield values, or restricting what behaviours can be expressed by farmers.

Hence Burton and Wilson (p.97) argue that, "if the implied linearity in the P/PP/MF model was true (i.e. transition from productivism to post-productivism to multifunctional agricultural regimes as highlighted above), it could be hypothesised that both structure (e.g. agricultural policies, rural political economy) and agency (farmers’ identities and ‘farming culture’) would ‘move along’ the P/PP/MF spectrum at the same pace and in the same manner."

They therefore set out the following aims for their paper; "First, we wish to incorporate structure– agency concepts into theorisations of agricultural change in order to plug the existing gap in our understanding of the postulated P/PP/MF transition. Second, using social psychology theory, we will investigate whether farming identities have moved towards ‘post-productivism’ or even ‘multifunctionalism’ in order to test the assumption that rural agency is moving according to the same patterns and pace as agricultural/rural structure."

The former aim is the basis of the modelling approach taken here. It is acknowledged that "it is difficult to predict if and how the seemingly entrenched productivist self-concepts of farmers in the UK (as well as in Europe, advanced economies as a whole, and even in economically less developed countries (cf. Wilson and Rigg, 2003)) are likely to change." (Burton and Wilson 2006, p.111) and prediction of this type is expressly not the objective of this modelling. Rather the objective is to explore dynamics and scales of potential change in self-concepts and expressed behaviours through the investigation of a logically rigorous representative framework (i.e. the simulation model).

Expressed behaviours and identity standards are expected to vary across the simulated world in response to variation in values, costs, social networking rules and yield distribution.

Agents ‘adapt’ to their environment by modifying their identity standard and changing their expressed behaviour. In turn, this creates structure for other agents as they perceive the behaviour through their social network.

Agents aim to reduce their difference between their identity standard and both their expressed identity and the mean expressed identity of agents in their social network, while ensuring wealth does not become negative.

Agents have no capacity to learn.

Agents have no capacity to predict future neighbours’ expressed behaviour or values and costs. Agents also have no memory about the past.

Agents are able to sense the id-expressed of their social network and the values different behaviours will accrue them.

Agents interact only by adding or removing one another from their social network, and then by observing the expressed identity of those agents within their social network.

When at meeting points, agents randomly select other agents at the meeting point to add to their social network. When checking if an expressed behaviour should be changed, behaviours are checked in a random order – if two different behaviour changes result in the same id-error or profit the first change checked is retained.

Agents create their own social networks (other than their initial neighbours as specified by initial-social-network) – the observations of the expressed identities of this social network in part influences agents’ identity standard and expressed identities.

Data for all individual agents in the world can exported in each timestep by setting the export-turtle-data? switch to ‘on’. Fields in the data table exported are: tick (timestep), Agent (id number), id-error-behaviour, id-error-social, wealth, profit, yield, count-contacts (number of other agents in the agent’s social network), cluster-coeff (cluster coefficient), id-standard-P, id-standard-D, id-standard-C, id-standard-A, id-expressed-P, id-expressed-D, id-expressed-C, id-expressed-A, count-behaviours (total number of behaviours expressed), behaviour-available-P, behaviour-available-D, behaviour-available-C, behaviour-available-A. Data are exported to files named IdentityChange_AgentDataXX.csv, where XX is a unique id number. Files are in comma separated value format. Data in plots can also be exported at the end of a model run.


At initialization, the number of agents created is set by the number-of-agents chooser. Each of these agents is assigned an id-standard and an agentset of behaviours-initial patches. Agents' id-standard can be uniform across all agents (set initial-standards chooser to ‘Homogeneous’ and set values for each behaviour using id-standard-X sliders), vary at random between agents (set initial-standards chooser to ‘Random’) or vary between agents using id-standard-X sliders as the mean of a normal distribution for random sampling (set initial-standards chooser to ‘Distribution’; standard deviations of distributions are 0.1 and if corresponding slider is set 0 that behaviour will always be zero in agents’ initial identity standard). Expressed behaviours of agents can be set to identically match their id-standard (i.e. minimise id-error, set expressed-matches-standard? to on). If expressed behaviours of agents do not match their id-standard, expressed behaviours can vary between agents in the same ways as initial identity standard by selecting the corresponding value in the initial-expressed chooser.

Agents’ yield values can be uniform across all agents with value 1.0 (set variable-yield? chooser to ‘No’), can be random between agents with values between 0.5 and 1.0 (set variable-yield? chooser to ‘Random’) or can be set according to the spatial distribution of yield across the world (set variable-yield? chooser to ‘From Map’). Four different spatial distributions of yield can be used: 1) spatially uniform with value 0.75 (set yield-map to ‘Uniform’), 2) continuously increase from a value of 0.5 at the far left of the world to a value of 1.0 at the far right of the world (no variation from top to bottom of the world, set yield-map to ‘Gradient’), 3) four different values (0.5, 0.66, 0.83 and 1.0) uniform within the four quadrants of the world (set yield-map to ‘Quadrant’), 4) four different values (0.5, 0.66, 0.83 and 1.0) alternating across a grid, of which each grid cell is 1/10th of the world width and world height (set yield-map to ‘Grid’). The spatial distribution of yield across the world can be viewed by setting display-yield? on and clicking the update-display button.

Initially, the wealth variable of agents has a value 25, and profit, income and costs have values of zero.

Agents’ initial social networks can contain all other agents in the world (set initial-social-network chooser to ‘All’), can contain a random selection of agents, the number of which is sampled from normal distribution with mean of five and standard deviation of two (set initial-social-network chooser to ‘Random’), or can be limited to only immediate neighbours in space, either the eight in the Moore neighbourhood (set initial-social-network chooser to ‘Moore Neighbours’) or the four in the von Neumann neighbourhood (set initial-social-network chooser to ‘vonNeumann Neighbours’). Agents’ social networks can be shown on the world by setting the show-links? switch on and the show-agent-links slider to the value of the number-of-agents. To view the links of a single agent, change the show-agent-links slider value to the id of the desired agent.

Next, for each agent, id-expressed, id-expressed-social, id-error-behaviour, id-error-social, and cluster-coefficient are calculated. Values of last-id-error-social and last-id-error-behaviour are set to zero. Agents’ behaviours-available are set for all four behaviours from the available-X sliders if the use-values? switch is off. If use-values? is on, the available-A slider is used to set the agri-business behaviour only.

If the scenarios-from-file? switch is on input data are read from file (see below) and corresponding values set for the first timestep.


Users can specify input files for scenarios of values through time or behaviour availability through time and between agents. To use these set scenario-from-file? on. If use-values? is on file provided must be for values with filename in the format ValuesScenarioXX.txt where XX is the value specified by the scenario-id slider. If use-values? is false scenarios are for behaviours available and b-a_uniformAgents and b-a_uniformTime switches are used. If b-a_uniformAgents is on, file behaviours-available_uniformAgentsXX.txt will be used; if b-a_uniformTime is on, file behaviours-available_uniformTimeXX.txt will be used; if both are off, behaviours-available_allXX.txt will be used (in each case XX is specified by the scenario-id slider). Examples of the format each of these files can be found in


Burton, R.J.F. and G.A. Wilson (2006) Injecting social psychology theory into conceptualisations of agricultural agency: Towards a post-productivist farmer self-identity? Journal of Rural Studies 22 95–115

Stryker S. and P.J. Burke (2000) The Past, Present, and Future of an Identity Theory Social Psychology Quarterly 63(4) 284-297