• Keine Ergebnisse gefunden

Entering and Exiting Agents

Im Dokument Agent-Based Modeling (Seite 147-155)

5.3 Modeling Pedestrians in Crowds

5.3.2 Entering and Exiting Agents

//from the Generate Agent functions int generate_people()

{

int gnumber=rand()%MAXIMUM_GENERATED_PERSONS;

int i=0;

int leader=0;

NUMBER_GROUP_GENERATE=NUMBER_GROUP_GENERATE+1;

for(i=0; i<gnumber;i++) {

if(i==0) {

leader=1;

} else {

leader=0;

}

NUMBER_PEOPLE_GENERATE=NUMBER_PEOPLE_GENERATE+1;

add_person_agent(NUMBER_PEOPLE_GENERATE, X, Y, X,Y, 5.0, 1, 0,0,1, NUMBER_GROUP_GENERATE,leader);

}

return 0;

}

The Generate agent can add new Person agents into the scene, using the function ‘add person agent()’. The agent will first have to calculate the vari-ables for the person memory and declare them as function parameters when creating agents.

For exiting agents, the person agent needs to have a function which returns a ‘1’ rather than a ‘0’, to allow it to be removed from the simulation. This can accompany an ‘if’ condition to check, if the exit point is reached, such as if(current_location==exit_position)

return 1;

else

return 0;

Figure 5.15 shows two snapshots from the simulation, where the person agents are superimposed into a screen to walk around a collection of buildings.

(a) Single agents. (b) Agents in groups.

FIGURE 5.15: Agents walking in the scene.

Figure 5.15(a) shows single person not associated in groups as compared to Figure 5.15(b) showing groups represented by different colors.

Various tools now exist that allow crowds to be modeled in different situa-tions. These include VICrowd, Legion, each allowing multiple rule interactions and control to be introduced in the model. Designing such models requires considerable input from modelers, social scientists and crowd researchers to build believable crowds. The more complexity of lower and higher levels on interaction, the more believable crowds are.

Chapter 6

Agents in Economic Markets and Games

6.1 Perfect Rationality versus Bounded Rationality . . . 125 6.2 Modeling Multiple Shopper Behaviors . . . 126 6.3 Learning Firms in a Cournot Model . . . 129 6.3.1 Genetic Programming with Agents . . . 143 6.3.2 Filtering Messages in Advance . . . 150 6.3.3 Comparing Two Data Structures . . . 151 6.4 A Virtual Mall Model: Labor and Goods Market Combined . . . . 152 6.5 Programming Games . . . 159 6.5.1 Nash Equilibrium . . . 160 6.5.2 Evolutionary Game Theory . . . 161 6.5.3 Evolutionary Stable State . . . 162 6.5.4 Game Theory versus Evolutionary Game Theory . . . 162 6.5.5 Continuous Strategies . . . 163 6.5.6 Red Queen and Equilibrium . . . 163 6.6 Learning in an Iterated Prisoner’s Dilemma Game . . . 164 6.7 Multi-Agent Systems and Games . . . 173 Economics, similar to social science, also uses mathematical concepts to help analyze and predict behavior of its systems. Traditionally, economics used differential equations, with various assumptions, including arguments of ra-tional individual behavior and rara-tional decision making. Game theory and economics, however, work hand-in-hand to help study people behavior and introduce concepts of payoff and utility when studying economics systems in research. Figure 6.1 shows economic models often viewed as black boxes, us-ing inputs to then observe and collect its outputs. Researchers often work backwards to explain the output behavior using mathematical notations.

Economic agent-based modeling is a separate research area used to explain the inner workings of economics. Tesfatsion [193] defines agent-based compu-tational economics (ACE) as “the compucompu-tational study of economic processes modeled as dynamic systems of interacting agents. Here ‘agent’ refers broadly to a bundle of data and behavioral methods representing an entity constituting part of a computationally constructed world.”

In economics the definition of an agent can vary from representing a group of agents, such as a firm composed of many individuals, or an individual itself 121

I n p u t s 1 o r m o r e O u t p u t s 1 o r m o r e

FIGURE 6.1: A black box represents an economic model where only inputs and outputs are known and little is known about what goes on inside.

C o n s u m e r s W o r k e r s

I n d i v i d u a l s

S o c i a l g r o u p i n g F i r m s

F a m i l i e s G o v e r n m e n t a g e n c i e s

C r o p s F o r e s t s

B i o l o g i c a l e n t i t i e s

W e a t h e r G e o g r a p h i c a r e a

P h y s i c a l e n t i t i e s M a r k e t s

I n s t i t u t i o n s

FIGURE 6.2: Groups in economic systems.

like a customer or a worker (Figure 6.2). Agent-based modeling is solely based on an emergent pattern of interactions among different agents involved. Simi-larly, economies are also based on behavior of each member and the interacting patterns of these members.

The black boxes in economic models can thus be replaced with boxes full of agents (Figure 6.3). The agents can represent themselves or be used to represent a group of agents, where the interactions on lower levels affect their performance in the upper layers. Agent-based models produce output variables which are a result of interactions between agents within different scenarios linked up together. The earliest use of agent-based models can be found in the works of Axelrod [14], where he studied the evolution of cooperation among agents using the iterated prisoner’s dilemma. Table 6.1 summarizes the main differences between traditional and complexity economics.

Each economic model is different, based on different perspectives and as-sumptions of modelers or economists,

Variables. Each model is made up of variables and equations. These models help understand the economy. If any one of the variables change the model changes. Examples of changing variables in models are estimating

I n p u t s 1 o r m o r e

O u t p u t s 1 o r m o r e

FIGURE 6.3: Replacing the black box with agents.

with or without expenditures, floating or fixed exchange rate or even increases in interest rate.

Limits. Every economic model has limits to what it is modeling.

Different kinds of consumers. Some consumers might be lazy while oth-ers spend more than required on products. There is heterogeneous mix-ture of characteristics in the real world.

Testing. Designing a test suite for testing different assumptions. This in-volves period testing where variables were the same for periods 1 and 2 but changed in period 3. Tesfatsion [193] argues that most models get rejected due to this.

Rules. Rules are determined out of some formulation of the past. These rules should be continually updated using learning methods. These learning methods will be conditional to the agents.

Behavioral uncertainty and learning in agents. Economic analysis how agents make choices in an evolving world. Holland et al. [90] argued why most economists turn to game theory to model strategic learning in games as economic games.

The SanteFe Institute presents their view on economic models [21]:

• Economic models are dispersed with parallel interaction among hetero-geneous agents. Heterogeneity implies that each individual is different from the other in terms of memory and characteristics.

• There is no global entity which controls their functions.

TABLE 6.1: Five big ideas that distinguish complexity economics [21]. inductive rules of thumb to make decisions have incom-plete information; are sub-ject to errors and biases;

learn and adapt over time

Modeled collectively; use complex deductive calcula-tion to make decisions; have complete information; make no errors and have no biases;

have no need for learning or adaptation (are already result of micro level behav-iors and interactions system with novelty and is responsible for its growth in order and complexity

No mechanism for endoge-nously creating novelty or growth in order and com-plexity

• Sometimes there is a hierarchy among the agents.

• There is learning in the agents as time progresses.

• Due to certain factors sometimes new market niches are seen developing.

• Importantly, economic models try to work away from the optimum or equilibrium because they are constantly trying to do better and never know whether they have reached an optimum point.

Dopfer argued that “economics has always been in a crisis since it broke away from social philosophy in the late eighteenth century” [52]. Since Aristo-tle’s time, economic theories have changed a number of times, when Aristotle originally discussed the nature of household and market exchanges which con-centrates mostly in political economics branch. Adam Smith’s publication of An Inquiry into the Nature and Causes of the Wealth of Nations contributed

to the discussion of free market which was much celebrated by economists thereafter. Smith argued that people’s personal relationships contribute to the way markets behave [185]. The theory of ‘invisible hand’ encourages the laissez-faire policy adopted by most governments that allows events to take their own toll and have less interference with behavior of markets as they shape themselves.

Similar theories were adopted by neoclassical economics which gave birth to rational consumers and buyers, assuming every individual is making the right choice to maximize their own utility or profit. Conventional models of markets used assumptions of this ‘rational choice’ and ‘efficient market hy-pothesis’, but were limited to explain real market performance in situations of trading and volatility as observed in the real world.

6.1 Perfect Rationality versus Bounded Rationality

Friedman [70] presented ideas around how exaggerated assumptions will not matter in economics when the economic models being written were making correct predictions. Even if individuals were assumed to be perfectly rational, it would not make any difference on the results if they were making irrational decisions. Comparatively, Simon presented a counter argument on bounded rationality.

“Economics illustrates well how outer and inner environments inter-act and, in particular, how an intelligent system’s adjustment to its outer environment (itssubstantive rationality) is limited by its ability, through knowledge and computation to discover appropriate adaptive behavior (itsprocedural rationality).” [179]

Every individual is selfish and the information each individual has is differ-ent. The decisions are made, based onwhat the individual knows, giving rise tobounded rationality, where there is rationality depending on the bounds of the individual’s information space.

Im Dokument Agent-Based Modeling (Seite 147-155)