[go: up one dir, main page]

0% found this document useful (0 votes)
5 views20 pages

Agent-Based Modeling (ABM)

Agent Based Modeling (ABM) is a decentralized, individual-centric approach to modeling real-world systems, where active agents interact within an environment to produce emergent global behavior. The modeling process involves defining agents, their behaviors, and using statecharts to represent their event-driven actions. ABM applications are diverse, and the document outlines steps for creating ABM models, including agent population creation, statechart design, and statistical analysis.

Uploaded by

nashimounir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views20 pages

Agent-Based Modeling (ABM)

Agent Based Modeling (ABM) is a decentralized, individual-centric approach to modeling real-world systems, where active agents interact within an environment to produce emergent global behavior. The modeling process involves defining agents, their behaviors, and using statecharts to represent their event-driven actions. ABM applications are diverse, and the document outlines steps for creating ABM models, including agent population creation, statechart design, and statistical analysis.

Uploaded by

nashimounir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Agent Based Modeling

(ABM)
Methods in Simulation Modeling
◼ A method is a framework we use to map a real-world system to its
model.

• There are three methods:


- Discrete Event Modeling
- System Dynamics
- Agent Based Modeling
Definition

◼ Although you can find a number of various definitions of Agent


Based Modeling in the literature, from the viewpoint of
practical applications agent based modeling can be defined
simply as:

“Decentralized, individual-centric (as opposed to system level)


approach to model design.”
ABM model
◼ In ABM, the modeler:
 Defines the active agents (which can be people, companies, projects,
assets, vehicles, cities, animals, ships, products, etc.),
 defines their behavior (main drivers, reactions, history, …)
 puts them in a certain environment
 Maybe establishes connections, and runs the simulation.

◼ The global (system-level) behavior then emerges as a result of interactions


of many individual behaviors.

4
Agents

◼ Agents are NOT the same thing as cellular automata that live in discrete
space. There can be no space at all. When space is needed, in most cases it
is continuous, sometimes a geographical map or a facility floor plan.

◼ Agent based modeling does NOT assume clock "ticks" or "steps“. Most well-
built and efficient agent based models are asynchronous. Continuous time
dynamics may also be a part of agent or environment behavior

◼ Agents are NOT necessarily people. Anything can be an agent: a vehicle, a


piece of equipment, a project, an idea, an organization, an investment
5
Agents
◼ Agents DON"T have to be intellectual, adaptive, learning, or exhibit goal-
seeking behavior. Agents can be very primitive, dumb, seeking nothing, and
not able to learn.

◼ Agents DON'T have to be active. A passive object can be an agent.

◼ There can be many and there can be very few agents in an agent based
model.

◼ There are agent based models where agents do not interact at all. Consider
agents –patients with chronic non-contagious
6
Introduction to ABM
◼ The applications of ABM are vast and can be complex.

◼ There is no real one method to create ABM models.

◼ In this course, we will stick to one type of ABM models.


 Using Process Flowcharts
 Example: Market Consumer Model

7
Statechart
◼ Commonly, an agent’s behavior can be described by a state.

◼ A statechart (an extended version of state diagram) is a visual construct that


enables you to define event- and time-driven behavior of various objects
(agents).

◼ Statecharts are very helpful in simulation modeling. They are used a lot in
agent-based models, and also work well with process and system dynamics
models.

8
Statechart
◼ Statecharts consist of states and transitions.

◼ A state can be considered as a “concentrated history” of the agent and also


as a set of reactions to external events that determine the agent’s future.

◼ The reactions in a particular state are defined by transitions exiting that


state.

◼ Each transition has a trigger. When a transition is taken (“fired”) the state
may change, and a new set of reactions may become active. State transition
is atomic and instantaneous. Arbitrary actions can be associated with
9
transitions and with entering and exiting states.
Trigger Types

10
Trigger Types

11
Internal transition
◼ An internal transition is a cyclic transition that lies inside a state. The
transition's start and end points both lie on the state's border.

◼ Since an internal transition does not exit the enclosing state, it does not take
the statechart out of this state. Neither the exit nor entry actions are executed
when the transition occurs, and the current simple state in the state is not
exited.

12
Guards in transitions
◼ When a statechart enters a simple state, the triggers of all outgoing
transitions are collected and the statechart begins to wait for any of them to
occur.

◼ When a trigger event occurs, the guard of the corresponding transition is


evaluated. If the guard is True, the transition may be taken (though
alternative simultaneous events could reset the trigger). This algorithm of
guard evaluation is called “guards-after-triggers”.

13
Example: Laptop running on battery

14
Steps to create ABM model
◼ Step 1: Create a population of agents

◼ Step 2: Draw a schematic of the statechart for the agent type

◼ Step 3: Define the transitions and triggers and events (if any)

◼ Step 4: Code the changes in each state

◼ Step 5: Retrieve statistics

15
◼ Step 6: Create plots
Important functions for states and transitions
◼ shapeBody.setFillColor(color): controls the color of the agent
 shapeBody has all the shape and color of a human agent.
 For a Box use shapeBox

◼ sendToAll(“message”): sends message to all agents

◼ sendToRandom(“message”): sends message to a random agent

◼ Send(“message”, agent): sends message to a specific agent

16
◼ For guards: RandomTrue(prob): Returns True with a prob probability
Important functions for statistics
◼ Statistics can be retrieved in “main”.

◼ Click on the agent type. Under statistics add a statistic function and give it a
name.
 The name will be used in plots. Use: AgentType.StatisticsName()

◼ item.instate(agentType.State): retrieves the agents


 Select count/sum/mean… to determine the value.

17
Example 1: Passport retrieval
◼ In a town, a population of 200 people exist.

◼ The population will request a passport when they need to travel. Suppose
that a flight comes up to the town every month. (Use event to send message,
and use a guard with a random true probability of 0.005)

◼ The Passport expires every 1 year and the user will request a new passport
after that period.

◼ Color the agents without a passport in black and the ones with passports in
green.
18
Example 2: PC usage
◼ A lab has 35 PCs. Students enter the lab at a rate of 5 per hour.
 Use rate= 5/35 per day.
◼ Some leave the PCs running for a simulation (probability of 25%) and the PC
remains running for 10 hours. After the end of the simulation the PCs can be
used by other students.
◼ The students use the PC for a minimum of 0,5 hrs and a maximum of 2 hrs
(Use uniform distribution)

◼ Available PC in green, In-Use PC in Red, Simulation PC in Black.


19
Example 2: PC usage
◼ Statechart
Available

◼ We have a total of 35 PCs, In order to


have 5 PCs operating per hour, we need 0.5-2 hrs Rate = 1/7

each PC to have a 5/35 chance of being


used per hour. 10 hrs In-Use

◼ Therefore, use rate 5.0/35.0 or 1.0/7.0.


25% of used PCs

Simulation

20

You might also like