1 Introduction

Computational methods have seen increasing popularity in the social sciences since the 1990s. The most essential feature of computational modelling in the social sciences is that simulation models allow for the representation and analysis of processes. Although society is widely recognised as dynamic, changing and evolving, most social science methodologies do not do justice to these dynamics. A second essential feature of computational modelling is that it allows for experimentation. Even though experimentation is in silico, in a virtual laboratory, it allows for the exploration of interdependencies between parameters over time in a controlled environment, engendering a deeper understanding of processes underlying the dynamics of social phenomena.

A particularly fruitful computational method for the social sciences is agent-based modelling (ABM). An agent-based model is a computer programme consisting of autonomous, heterogeneous entities (called agents) that interact with their environment and each other according to a set of individual behaviour rules. Each agent perceives and evaluates its environment (including other agents) and makes an autonomous decision about what to do next. The unique features of ABM are the modelling of heterogeneity, context dependent action and implementing qualitative behaviour rules.

One set of interesting social phenomena are collective dilemmas, such as the Tragedy of the Commons. Although often discussed in rather abstract terms, collective dilemmas exist in every shared kitchen, every community project, or wherever people work together and there is a chance of free riding. Collective dilemmas are of interest since in the real world they often seem to resolve despite their dilemma structure. This is similar to the finding of high cooperation in Prisoners’ Dilemma games in experiments with real people, contrary to the predictions of game theory. Similar to the resolution of this empirical incongruity, there is a plethora of approaches with which to analyse collective dilemmas, such as invoking institutions (Ostrom 1990), norms of fairness (Eek and Biel 2003), collective identity and group belonging (de Boer 2008) or collective reasoning (Gold and Sugden 2006).

It seems that there is no one solution to collective dilemmas. Examining the array of solutions, together with existing ABM models of other social phenomena, we develop a framework in which agent decision-making is made context dependent. Contextual Action Framework for Computational Agents (CAFCA) allows for the transcendence of atomistic and individualistic paradigms in modelling (by contexts providing structural feedback on decision making) and addresses complex behaviours in the real world without complicating the decision procedure of the agent (i.e. producing a black-box cognitive architecture).

The paper is structured as follows: first we describe approaches to contextual human and agent action, followed by a description of CAFCA after which we address potential criticisms of CAFCA before finally drawing conclusions.

2 Behaviour, action, context

Although inspired by the conundrum of collective dilemmas, CAFCA is meant as a much more general framework for the modelling of contextual action in ABM. We will briefly review some approaches to contextual human and agent action to provide a theoretical backdrop for CAFCA.

2.1 Contextual human action

There is relatively little explicit research about context in sociology. Weber’s Social Action Theory, distinguishing four motivations of actions resulting from different kinds of reasoning, is a theoretical exception (Weber 1947). Context dependency is often implicit, hidden in qualitative methodologies (e.g. grounded theory).

Environmental criminology approaches context by taking environmental influences on criminal action into account. Situational Crime Prevention explores ways to amend the environment to make crime difficult and essentially not worth committing but it is fully dependent on a rational choice reasoning paradigm (Clarke 1997). A development towards a contextual action framework is Wikström’s Situational Action Theory (Wikström 2010). Situational Action Theory is a theory of criminal behaviour that bridges the dichotomy of criminological research into pathological and situational crime and investigates the interaction between individual characteristics, such as self-control, and situational variables, such as deterrence.Footnote 1

A Kantian reasoning framework distinguishes between reasoning informed by our desires, interests and aims, i.e. strategic reasoning, and reasoning informed by duty and obligations, i.e. normative, deontic, moral reasoning, which can be interpreted as a contextualisation framework, cf. Rawls (1971) and Raz (2005).

Economics has spent relatively little time on contextuality, emphasising instead the universality of rationality. Nonetheless, normative considerations have been incorporated into some instrumental reasoning approaches, partly due to the empirical evidence that people do not reason as utility maximisers. Pure utility maximisation is amended to utility maximisation relative to a set of preferences. Normative considerations are then transported into the set of preferences, e.g. altruism (Rabin 1993). This is known as the transformation of preferences [e.g. Guala (2006)]. The transformation approach ontologically reduces normative to instrumental reasoning; however, behaviourally the distinction can be retained. An amendment of preferences informing action in collective dilemmas can also be seen as a social context, i.e. considerations of group belonging or membership (de Boer 2008) provide a social context for decision making, as does team reasoning in both its developments by Gold and Sugden (2006) and Sugden (1993, 2003). The first is a normative context, where invoking institutions (Ostrom 1990) or evolved norms of fairness (Eek and Biel 2003) are preference constraints constituting a context for decision making.

2.2 Contextual computational agent action

In an agent-based model each agent makes a decision after perceiving its particular environment, both social and physical. In most models context collapses into a social or physical environment with a single kind of reasoning applied to it. This kind of modelling has often been accused of being reductivist on two accounts, being individualist and behaviouralist. In order to make agent decision making more realistic, more and more elaborate agent architectures have been developed.Footnote 2 Cognitive architectures have the regrettable side-effect that they make models much harder to analyse and thus impede the understanding of the target system that is being modelled. In contrast, context dependent decision making is a relatively small field in ABM. We discuss three approaches which take the relationship between context and decision making more seriously.

One model is the CONSUMAT, a generic framework to simulate human behaviour in consumer decision situations. In its first version (Jager 2000), it was a four cell model encompassing repetition, deliberation, imitation, and social comparison. The choice of the decision making mode is mapped onto an agent’s needs and uncertainty concerning the results of behaviour. High levels of satisfaction and certainty lead to repetition, low certainty and high satisfaction result in imitation, high certainty and low satisfaction lead to deliberation and low certainty and low satisfaction cause social comparison. A recent version of the CONSUMAT model (Jager and Janssen 2012) also includes satisficing and uses social networks to inform the social comparison mode.

A second context sensitive agent-based model is Verhagen’s Norm Learning model (Verhagen 2001). Here, agents learn how to behave in an environment and also learn group norms for behaviour in that environment. In a decision situation, the agent tries to make the optimal choice. The result of the behaviour choice is used to update the agent’s own evaluation model. At the same time, it announces its situation to all agents in its group. The group members reply with their evaluation function for that situation. Using this feedback, the agent builds a second evaluation function, an internal representation of the groups evaluation function which in this model is called the norm. In different simulation studies the effect of leadership (by varying the weight of the evaluation of the leader versus that of the rest of the group) and autonomy (varying the weight an agent attaches to its own evaluation function versus its perceived group norm) were studied. The driving force to choose the one or the other is the conformity tendency of the agent.

A third context conscious agent specification is the Emil-A agent architecture and Emil-S simulation platform (Conte et al. 2013). Here agents can distinguish factual and normative contexts, apply different kinds of reasoning and choose actions accordingly. Emil-A is a first systematic implementation of normative dynamics, such as norm internalisation, into an agent architecture. Emil-S has been applied in several application areas, such as traffic rules (Lotzmann 2010), micro-finance (Lucas et al. 2010) and extortion racketeering (Nardin et al. under review; Troitzsch 2015).

From the discussion of the above approaches we can see that some work has been done to advance contextual aspects of agent-based modelling but that it has focussed largely on normative reasoning. The CONSUMAT is a contextual framework that models consumer decisions very well. However, not all human decisions are, or can be framed as consumer choice. The framework in the next section extends from the specific case of consumption to capture all decision making.

3 Introducing CAFCA

When modelling social phenomena it is important to model those aspects of human decision making relevant for the phenomenon at the level of specificity relevant for the purpose of the model. This means that behaviours have to be generalisable across agents, whilst particular for an individual in a specific situation or context. To preserve the particularity of individual decision making we suggest a framework based on the idea that decisions are highly contextual, i.e. dependent on an agent’s interpretation of a situation. In order to also ensure the needed generality, CAFCA is a two dimensional framework of contexts, as depicted in Fig. 1.

Each dimension has three elements: the social dimension constituted by the individual, social and collective and the reasoning dimension consisting of automatic, strategic and normative reasoning. Thus, the framework distinguishes nine contexts. In the individual mode the agent interprets the decision as independent of others. In the social mode agents recognise other agents in the situation but see themselves as distinct from or in competition with them. In the collective mode the agent not only recognises others but perceives itself as belonging to the others, as a member of a collective or team.

There is no need to argue for the existence of atomistic and social contexts as it has been widely accepted. The difference for decision making is that in the former outcomes are absolute whereas in the latter they are interdependent with the decisions of others. The addition of the collective context, however, needs some closer attention. Similar to the social context, outcomes are relative to the decisions of others. What distinguishes it from the social context, however, is the transformation of agency, from the individual to the collective or team (Hakli et al. 2010). This means that the other is not seen as an incumbent on the decision making but as a positive force for achieving a joint endeavour. Due to space restrictions we cannot here argue in detail for the ontological uniqueness of collective contexts but refer to extensive literature that supports its inclusion into our framework [see Elsenbroich (2014) for a review article].

Fig. 1
figure 1

The contextual action framework

Automatic action is non-reasoned action, a behavioural reaction to a stimulus. An individual automatic reaction is to simply repeat previous actions (e.g. stopping at red lights). In a social situation an automatic reaction is to perceive and imitate the actions of other agents (e.g. looking left–right–left when crossing the road). Imitation has been used extensively in agent-based modelling particularly for coordination phenomena (e.g. pedestrian modelling). A collective automatic reaction is also to perceive the actions of other agents, but rather than simply imitating their behaviours, an agent will understand others’ intentions and participate in the activity (e.g. helping an old lady cross the road).

Strategic reasoning is goal-directed reasoning where the goal is utility maximisation. The social dimension in strategic reasoning determines who is taken into account in the decision making. In the individual case this means assessing a situation in light of ones preferences and choosing the action that produces the optimal outcome, (e.g. consumer decisions). In the social case the payoffs of different agents are interdependent. This is the social extension of rational choice captured in game theory and related approaches. In the collective case an individual applies the strategic considerations not to its own utility but to the utility of a group, team or collective. It is based on team-reasoning, an extension to game theory discussed in Sect. 2.1.

Normative reasoning is rule following rather than goal directed. The social aspects determine the origin of the rules. In the individual case the rules are seen as given, like a set of laws, obligations or rights. An agent needs to be able to recognise the correct rule for the situation and resolve conflict in case of inconsistent rules. In the social case the rules are generated by the agent observing the behaviour of other agents. By generalising observed behaviour individuals extrapolate a social norm of how to behave. In the collective case rules are extrapolated by taking the collective into account. A rule from this origin needs group wide or universal applicability, like moral principles such as Utilitarianism or Kant’s Categorical Imperative.

The main difference between CAFCA and traditional environmental decision-making frameworks is that in CAFCA it is not just the action that is triggered by the situation but the kind of reasoning that leads to an action. For example, if an agent interprets a situation as normative and perceives the actions of others it will extrapolate a norm for behaviour that it will follow, whereas if it perceives the same situation as strategic it will try to outsmart other agents. Different agents can perceive the same situation differently, (re)acting differently. A detailed discussion of how agents perceive different contexts and how they might move from one context to another depends on factors that lie outside this discussion of CAFCA. Nonetheless, we will discuss some of the ideas surrounding this issue briefly in Sect. 4, where we also address criticisms of CAFCA.

3.1 Applications of CAFCA

CAFCA is first and foremost intended to support agent-based modelling and in this spirit we briefly discuss some practical applications.

  1. 1.

    CAFCA helps to conceptualise model specifications.

    In designing a model, the kinds of reasoning an agent might potentially employ and the social situations it might find itself in, need to be specified. Looking at the CONSUMAT, the agent moves between individual and social modes and automatic and deliberative modes (Jager and Janssen 2012). A model does not have to take into account all contexts; different target systems comprise different sets of contexts. CAFCA helps to conceptualise a target system and thus helps in operationalising agent behaviour for the model.

  2. 2.

    CAFCA supports modelling of genuine sociality.

    ABM have often been seen as presupposing individualism or atomism (Epstein 2011). By stripping individual agents of unnecessary complexity, enhancing the role of context and giving the context a social dimension, CAFCA opens up an ontology for modelling that goes beyond atomism. Furthermore, CAFCA provides a framework that takes both agency and structure seriously, thus bridging an age old dichotomy in the social sciences.

  3. 3.

    CAFCA takes away the need for complicated black-box cognitive agents.

    CAFCA allows for the modelling of complex phenomena without increasing the complexity of the agents. The strategy is to shift complexity into the context rather than an agent’s cognitive machine. Environmentally situated behaviour is a hallmark of agent-based modelling. CAFCA transforms a simple environmental reaction into a contextual action by considering the agent’s perception of the social aspects of the situation as well as what kind of reasoning is appropriate in this situation. By generalising over a set of contexts, CAFCA reduces the complexity of agents, thus combining context specificity with generalisability. Complex cognitive agent architectures can be accommodated in our framework but it is not necessary to have a complex architecture in the first place.

3.2 (A part of) CAFCA in action

CAFCA is a framework describing nine different modes of decision making for actions in an agent-based model. Although the nine modes are assembled into a three-by-three framework here, it is not the intention of CAFCA that a model should implement all those modes. On the contrary, the framework’s purpose is to assist a modeller in thinking about the target system, identifying which modes might be at work and experimenting with them in the model. The example we want to discuss is that of extortion racketeering by the Italian Mafia in Sicily.

Extortion racketeering has been explored mainly as a strategic interaction between extorters and victims, formalised in game theory [e.g. Smith and Varese (2001)]. Elsenbroich and Badham (under review) discuss the importance of taking the social context into account in the analysis of extortion rackets. Using an ABM allowed for modelling the fact that very few punishments are necessary to control a large territory and showing how fakers could survive in the shadow of real Mafiosi. The strategic interaction of the extorter and victim relies largely on deterrence. In game theory the possibility of punishment becomes an endogenous part of the utility function. In the ABM this probability is exogenised and becomes a function of the punishments observed in the neighbourhood. This is an implementation of a strategic-social mode of decision making into an ABM.

Elsenbroich and Badham (under review) extends the model to investigate the phenomenon of the rise of the Addio Pizzo movement and resulting increases in resistance against the Mafia. The model tests three hypotheses regarding how resistance might be harnessed by an organisation like Addio Pizzo. The first hypothesis is based on strategic social interaction, similar to the model discussed in Elsenbroich and Badham (under review) but with an added player: the consumer. Addio Pizzo emphasises the critical consumer aspects of their campaign, giving members stickers for the doors to show the consumer which shops are pizzo free. The implementation means that increasing levels of critical consumers lower the payoff an entrepreneur has from paying the pizzo. The second is based on a change of reasoning from strategic to normative. The conundrum in southern Italy and Sicily regarding extortion racketeering is that paying the pizzo seems to have become a social norm, transcending the simple deterrence effect and creating a positive feedback loop from neighbours paying the pizzo rather than just from seeing them being punished. Consumer pressure and normative changes are also considered in Troitzsch (2015) and Nardin et al. (under review), each implementing two boxes from CAFCA, the strategic-social and the normative-social. In Elsenbroich (under review) two additional decision-making modes are added to the model: the strategic-collective and the normative-collective modes from the right most column in CAFCA. The rationale is that Addio Pizzo create a collective, a team, and agents start maximising not their individual but the collective’s utility.

The operationalisations of the different kinds of reasoning produce the different contexts of relevant neighbourhood features an agent takes into account when making a decision. In this particular implementation, consumer decisions are a simple numerical amendment to the agent’s utility function.Footnote 3 Normative aspects make the agent take the behaviour of their surrounding agents into account. Whereas before only the punishment of other agents provided information for agents, adding a normative dimension to the decision making means that agents take into account the number of resistant and compliant entrepreneurs in their neighbourhood and amend their utility function accordingly. Collective aspects mean agents apply the consideration to the group rather than the individual, so the size of the group they consider to be part of provides the relevant change. Strategic, normative and collective modes of reasoning show different patterns in reducing resistance. Consumer pressure leads to excessive losses on the side of the entrepreneur, and even though financially it becomes much less viable to pay the protection money, resistance is short lived with the fear of punishment taking over. The normative-social case leads to higher fluctuations between resistance and acquiescence but does not lead to sustainable levels of resistance. Similarly, the strategic-collective case does not yield sustainable resistance although initial resistance is strong. For small group radii collective reasoning brings about high fluctuation in resistance levels whilst for larger groups resistance is almost nonexistent. However, the normative-collective case has a clear tipping point where small groups do not lead to any change in resistance and large groups lead to almost complete resistance.

The purpose of this model is to look at the influences of the different interactions with the environment regarding macro outcomes, such as levels of resistance, and CAFCA helps to conceptualise the different kinds of reasoning that might play a part in decision making as well as their interplay.

4 Addressing criticisms of CAFCA

So far we have discussed benefits of CAFCA, which uses a relatively broad ontology. Producing a broad ontology opens one up for criticisms, some of which we want to address in this section.

  1. 1.

    As ABM are simply stochastic simulations, the differentiation between different modes of reasoning boils down to different probability distributions.

    Although probabilities play a role in the specifications of ABM, stochastic simulations and ABM have to be distinguished.Footnote 4 In stochastic individual based simulations the dynamics of the model are defined by transition probabilities from one state to the next, e.g. micro-simulation models or stochastic actor-based models for network dynamics (Snijders et al. 2010). In agent-based models the dynamics are a result of interactions between agents and agents and the environment. In the example model discussed in Sect. 3.2 the different kinds of reasonings are not different probabilities assigned to action possibilities. They are different interactions with the environment, or context, informing the utility function in different ways. For example the strategic modes of reasoning extract information from the environment to judge the probability of punishment whilst normative modes take in the levels of resistance in order to extrapolate what norm the other agents follow and accordingly adapt to this norm.

  2. 2.

    The distinctions that CAFCA makes are non-existent. Normative preferences can go into strategic considerations, and internalised norms can lead to automatic behaviour.

    Whilst it is certainly the case that norms can lead to automatic behaviours (internalisation), as well inform the preferences of strategic decision making (e.g. altruism), this is not a rebuke of CAFCA’s central ontological commitment to the separability of nine modes of reasoning. In order for norms to be internalised, normative reasoning has to have previously occurred; in order for norms to inform preferences for strategic decision making, normative reasoning has to have already taken place. This is not about a lack of variation in the kinds of reasoning but about the possibility of transition between one and the other.

    Whilst it is certainly the case that norms can lead to automatic behaviours (internalisation) as well informing the preferences of strategic decision making (e.g. altruism), this is not a rebuke of CAFCA’s central ontological commitment to the separability of nine modes of reasoning. In order for norms to be internalised, normative reasoning has to have taken place previously; in order for norms to inform preferences for strategic decision making, normative reasoning has to have taken place previously. This is not about the kinds of reasoning not being different but about the possibility of transition between one and the other.

  3. 3.

    CAFCA determines to provide a full social ontology of contexts but does not discuss how agents recognise or select contexts.

    CAFCA does not contain any information about how contexts are recognised or selected. This is deliberate rather than an omission as we think that these questions can only be answered domain specifically.

    CAFCA does not contain any information about how contexts are recognised or selected. This is deliberate rather than an omission as we think that these questions can only be answered domain specifically.

    Above we discussed, the CONSUMAT is one of the first implementations of different contexts into an agent-based model. Agents are satisficers and decision heuristics are mapped along the dimensions of uncertainty and cognitive effort. If an agent is satisfied where it is it can simply repeat its past actions, thus not spend any cognitive effort. If dissatisfied it either has to start deliberating, i.e. apply strategic choice, or observe other agents, i.e. imitate or engage in social comparison, depending on its level of uncertainty, neither can the criteria of cognitive effort and uncertainty be applied to the contexts in CAFCA nor are the four contexts of the CONSUMAT necessarily captured by the two criteria.

    Although the transition between automatic and strategic deliberation can result from considerations about cognitive effort, it is difficult to evaluate whether strategic or normative considerations are more cognitively demanding. The switch from what can be done to what should be done might even depend on which social context an agents perceives itself to be in. For example, in an individual context strategic considerations might be prevalent, whereas understanding a situation as social or collective might trigger normative interpretations.

    Although the transition between automatic and strategic deliberation can result from considerations about cognitive effort, it is difficult to evaluate whether strategic or normative considerations are more cognitively demanding. The switch from what can be done to what should be done might even depend on which social context an agents perceives itself to be in. For example in an individual context strategic considerations might be prevalent whereas understanding a situation as social or collective might trigger normative interpretations.

    Finally, in the four contexts of the CONSUMAT, which in our model relate to the individual and social automatic and strategic, the reason for an agent to choose one or another might not be captured by the dimensions of uncertainty and cognitive effort. A situation might be recognised as an individually automatic context due to an internalised norm. The motivation is then not satisficing together with minimising cognitive effort but a triggering of the internalised norm.

    In addition to contextualised agent decision making, we thus also strongly argue for domain specific applications of the framework. Each target system, e.g. consumer choice, preventive health adoption, extortion rackets or sustainability practices, will need to be analysed individually to see which contexts are relevant and what motivates humans to switch contexts. There is, however, one existing research approach to context we are very sympathetic towards. Edmonds develops contextual social behaviour in such a way that decision-making is made dependent on the recognition of the context and context recognition is made dependent on context learning (cf. Edmonds 2013, 2014).

  4. 4.

    How does CAFCA compare to existing models? Does it make them more accurate? And can it replicate outcomes from existing models?

    In some ways CAFCA is not something new. There is a plethora of models in existence using a variety of reasoning rules to implement agent behaviours. Some are based on simple reactive behaviours to the environment, while others are an implementation of game theoretic principles, and yet others use psychological theories as a foundation. There are, however, two aspects of CAFCA that are new. The first one is that it adds collective reasoning to the modelling repertoire. Collective reasoning has become a major concern in social ontology (Hakli et al. 2010) as well as Game Theory (Bacharach 1999; Gold and Sugden 2006) but has to date not found its way into modelling. The second aspect is that CAFCA gathers and formalises disparate kinds of reasoning commonly used in modelling. This unification into one framework will help the conceptualisation of the target system and simplify operationalisation. Hence CAFCA is not in competition with, nor does it replicate or change existing models. It helps to conceptualise decisions made in existing models and allows for a comparison of different models of the same target system. For example, an ABM on the spread of an epidemic might take into account agent behaviour at different levels of abstraction, such as simple airborne contagion in a population (Hatchett et al. 2007), risk calculations and network connections (Epstein et al. 2008) or much more complex beliefs about vaccinations and other preventive behaviours [e.g. Badham and Gilbert (2015) taking into account personal beliefs and social norms]. The modelling decisions regarding which aspects to model and which to leave out are informed by the research question, and depending on this it will be relevant to model decision making at different levels of abstraction and take different contextual aspects into account. CAFCA is there to assist these decisions.

5 Conclusion and future work

In this article we have presented the Contextual Action Framework for Computational Agents (CAFCA), a two-dimensional framework to conceptualise the actions of human and artificial agents. Rather than focussing on complex architectures to capture the complexity of human decision making, CAFCA defines contexts, which give rise to certain behaviours. The contexts are defined by two dimensions, one being a social aspect, the other a reasoning aspect. It thus lifts environmentally stimulant responses to agents interpreting contexts within which they (re)act.

The purpose of CAFCA is first and foremost to provide a framework to operationalise context dependent human action for modelling social phenomena. Although intuitively human action is deeply contextual, social science either neglects context in favour of generalisability in statistical research or forsakes generalisability for context in qualitative approaches. CAFCA bridges these extremes by linking action to context whilst framing contexts at a generalisable level.

CAFCA allows for keeping the agent architecture relatively simple, avoiding black-box, untracktable simulation models without denying models the necessary complexity to do justice to social phenomena. It transcends atomistic paradigms often found in agent-based modelling by linking agent behaviours to the recognition of social contexts, including membership of collectives. It combines individualist and structuralist approaches in the social sciences by embedding individual decision making with the social, normative and collective aspects of decision making. Finally, it allows for the coexistence of different kinds of reasoning and explicates which behaviours they might lead to, depending on the social context.

The purpose of CAFCA is first and foremost to provide a framework to operationalise context dependent human action for modelling social phenomena. Although intuitively human action is deeply contextual, social science either neglects context in favour of generalisability in statistical research or forsakes generalisability for context in qualitative approaches. CAFCA bridges these extremes by linking action to context whilst framing contexts at a generalisable level.

CAFCA allows to keep the agent architecture relatively simple, avoiding black-box, untracktable simulation models without denying models the necessary complexity to do justice to social phenomena. It transcends atomistic paradigms often found in agent-based modelling by linking agent behaviours to the recognition of social contexts, including membership of collectives. It combines individualist and structuralist approaches in the social sciences by embedding individual decision making with social, normative and collective aspects of decision making. Finally, it allows the coexistance of different kinds of reasoning and explicates which behaviours they might lead to, depending on the social context.