Artificial Intelligence and Simulation in Business PDF
Artificial Intelligence and Simulation in Business PDF
INTELLIGENCE
A N D S I M U L AT I O N
IN BUSINESS
Dr. Arash Mahdavi Tyler Wolfe-Adam
W H I T E PA P E R
CONTENTS
Introduction ...............................................................................................................................................02
01 G ener al P u rp o se S i m u l at i o n To o l s a n d An y L o g i c .............................................0 4
03 Deep Re i n fo rce m e n t Le a r n i n g i n Ac t i o n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 5
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
ABOUT AUTHORS
Dr. Arash Mahdavi is a simulation modeling Tyler Wolfe-Adam works at The AnyLogic
expert, head of training at The AnyLogic Company in North America as a program
Company in North America, and AnyLog- support and technical specialist. He holds
ic-AI integration lead. He holds a PhD a degree in computer science from De-
degree in civil engineering from Purdue Paul University. He is an active member
University where he applied a system-of-systems approach and agent- and core contributor to the Anylogic-AI
based modeling to profitability analysis of construction companies. Dr. initiative.
Mahdavi recently authored simulation textbook “The Art of Process-Centric
Modeling”. He has trained hundreds of professionals and faculty members
from Fortune 100 companies and elite research universities.
“ This whitepaper is about using simulation and artificial intelligence together. It shows how their
combination benefits practitioners in both fields and how AnyLogic simulation software enables
the joint use of these technologies in business today. From reading this paper and the case stud-
ies it contains, you will develop a deeper understanding of how the technologies work, the three
ways in which they intersect, and why they are powerful when used together.
01
INTRODUCTION
I N T RO D U C T I O N
Artificial intelligence, machine learning, and deep learning are common S U P E RV I S E D
terms that you can often hear in everyday conversation. Familiar as they
are, before looking at the value of their intersection with simulation, it is In supervised learning, labeled training data is used – inputs are
worth highlighting some important details. provided to an algorithm alongside known solutions. The labeled
training data provides examples for algorithms to learn from. And, using
the labeled pairs of input and output data, an algorithm will learn how to
The Encyclopedia Britannica simply defines artificial intelligence (AI)
map any given input to an output.
as ‘the ability of a computer… to perform tasks commonly associated After training, an algorithm can be used to classify inputs, such as whether
with intelligent beings’. This is a broad definition for a whole email is email, or predict values, such as stock prices.
discipline of terms and methods that aim to make computers behave
intelligently. U N S U P E RV I S E D
02
INTRODUCTION
A limitation of ML paradigms is their need for handcrafted input and AN ARTIFICIAL NEURAL NETWORK
assumptions about what is important. This handcrafted, manual, element
is difficult to scale and is reliant on human intelligence for guidance and
informative feature extraction. There is, however, another way and, as an
advancing subset of ML, deep learning is dealing with these limitations.
Deep learning is used to solve the same types of problems as the other
three ML paradigms but differentiates itself by discovering important
features for itself and learning directly from raw data, without the need for
human intervention.
03
GENERAL
PURPOSE
S I M U L AT I O N
TO O L S A N D
A N Y LO G I C
GENERAL PURPOSE SIMULATION TOOLS AND ANYLOGIC
GENERAL PURPOSE
S I M U L AT I O N TO O L S A N D A N Y LO G I C
Classical modeling tools such as Microsoft
Excel allow analytical solutions to be
calculated using formulas and scripts.
Going further, more sophisticated analytical
tools are also available, such as linear or
integer programming for optimization.
The logic of a simulation model is a set of rules that tells the simulation Experiments can be performed to explore possibilities by varying the
engine how to get from the current state of the system to the next. As the inputs, running the same model multiple times to see the effect of
model progresses in virtual time, various trajectories of the system can be randomness on the outputs, or a combination of both. This dynamic
observed, and output statistics collected. approach ultimately allows a more detailed analysis of a system, and for
problems to be solved, in ways that other tools cannot provide.
05
GENERAL PURPOSE SIMULATION TOOLS AND ANYLOGIC
There are three primary simulation methodologies for modeling a real-world system – system dynamics, discrete event, or agent-based:
System dynamics operates at a high abstraction Discrete event simulation models a system at a Agent-based modeling can work at any
level (less detail), in a typically deterministic medium-low abstraction level and focuses on abstraction level and is made up of subsystems
environment, and with a continuous modeling systems in which a sequence of operations or (local models) that may work independently or
of time. These models use stock-and-flow tasks need to be performed. This type of mod- collaboratively. Behaviors are typically described
diagrams to capture causal relationships, elling is built using generic blocks that control through states and through communication
feedback loops, and non-linear behaviors of the flow of entities in different contexts (e.g., between agents. Both discrete event and agent-
complex systems over time. patients in a hospital, cars in a manufacturing based models tend to be stochastic but can also
facility, packages in a warehouse). be deterministic.
06
GENERAL PURPOSE SIMULATION TOOLS AND ANYLOGIC
07
H OW A R E
S I M U L AT I O N
AND AI
BEING USED
TO G E T H E R ?
HOW ARE SIMULATION AND AI BEING USED TOGETHER?
H OW A R E S I M U L AT I O N A N D A I B E I N G
U S E D TO G E T H E R ?
There exists immediate potential for AI and simulation to further develop their mutually beneficial relationship, specifically in three key areas:
Before examining these areas, it’s important to first understand how labeled data that is representative of a real system’s outputs; second,
companies and organizations currently benefit from simulation. that a simulation model can be used as a virtual environment to test the
implications of incorporating AI into existing systems.
In the process of building a mature simulation model to represent a real-life
system, it is necessary to perform verification and validation. Verification is The third area comes from how useful information is extracted from
the iterative process of running a model and checking for any errors where a simulation model. A business or organization that has developed a
the programmed logic does not match assumptions and specifications, then simulation model will use it to run experiments and learn from the virtual
going back to fix those issues. Validation is the subsequent process that representation of their real system in a risk-free way. These experiments –
checks the model representativeness of the real or proposed system. Once a such as parameter variation, Monte Carlo, and optimization – facilitate the
simulation model has been sufficiently verified and validated, the outputs of decision-making process and help analysis and strategy development. One
simulation and the real world parallel each other. shortcoming of these types of experiments is that they have limitations
when extracting useful strategies from systems with high stochasticity
There are two implications to this that line up with the first two key areas or with many decision variables. These experiments cannot automatically
of where AI and simulation intersect: the first is that simulation models can suggest adaptive dynamic policies and rely on human experts to produce
be used as a source to generate an unlimited amount of synthetic, clean, potential policies, algorithms, or heuristics for testing in simulation.
09
HOW ARE SIMULATION AND AI BEING USED TOGETHER?
1. SYNTHETIC DATA
almost all machine learning algorithms heavily rely on input data being
provided in both quantity and quality. Data collection is a significant
task that needs many expertly designed, and often costly, processes to
be put into place. Even when the process can be streamlined, there is no
guarantee that sufficient data can be gathered due to the hard constraints the behavior of a system or the influence of interacting parts; they only
of monitoring a real-world system (e.g., one day of data takes one day to generate new data by inference from historical data. Unlike statistical or
produce). Moreover, machine learning algorithms, especially in supervised mathematical methods, a sufficiently verified and validated simulation
learning, need labeled data. The labeling process usually needs to be model can be used to generate unlimited amounts of relevant, clean,
done by humans, adding to the time, cost, and difficulty of generating structured, and labeled synthetic input data.
the necessary data.
Compared to mathematically generated data, simulation-based synthetic
To combat this, there are methods that can be used to create synthetic data is not entirely constrained to historical data. Simulation models
data from historical data, such as statistical algorithms. However, the main rely on rules and inherently capture the causal relationships in a system.
issue with this approach and similar methods, is that they do not capture Since these models uncover the essentials of how the system works, their
10
HOW ARE SIMULATION AND AI BEING USED TOGETHER?
outputs may also uncover counterfactuals and scenarios that have never
been experienced. This ability gives simulation unique capabilities for
generating synthetic data in terms of comprehensiveness, accuracy, and
representativeness.
The model can track all levels of outputs and statistics, ranging from broad
information – such as the yearly profit of a company – down to the most
minute detail – such as a breakdown of the minutes worked by a specific
worker. This level of precision allows the data output by a model to have
a similar level of precision applied to the labels. Since each data point
originates from a specific, known part of a model, both the individual data
points and the results are accurately labeled.
11
HOW ARE SIMULATION AND AI BEING USED TOGETHER?
2. TESTBED
12
HOW ARE SIMULATION AND AI BEING USED TOGETHER?
3. LEARNING ENVIRONMENT
RL borrows many ideas from how intelligent beings, like humans, learn
from their environment, specifically how experience is gained through
trial and error. The only difference is that a computer program, or learning
agent, does the learning.
1 “Reinforcement Learning: An Introduction” Richard S. Sutton, Andrew G. Barto, 2nd Edition, ch. 1, Nov 13, 2018
13
implementation costs will be high.
Additional costs from learning in the real world may be incurred through
injury to people or damage to property. Legal restrictions can also limit
testing and impose further constraints.
Simulations can also run faster than real-time and in parallel, allowing
quick and concurrent accumulation of knowledge.
14
DEEP
R E I N FO RC E M E N T
LEARNING IN
AC T I O N
DEEP REINFORCEMENT LEARNING IN ACTION
D E E P R E I N FO RC E M E N T L E A R N I N G
I N AC T I O N
There are many examples in the past half-decade that showcase
the potential of deep reinforcement learning. A significant moment
in the field was the 2016 defeat of Go world champion, Lee Sedol,
by DeepMind’s AlphaGo.
Not content with its board game success, Google’s self-driving research led
to Waymo starting a self-driving taxi service in Phoenix, Arizona, in April
2017. As the first commercial autonomous vehicle hire service, Waymo One
is currently in use by 400 members of the public who pay to be driven to
their schools and workplaces within a 100 square mile area.
16
DEEP REINFORCEMENT LEARNING IN ACTION
The training for the AI was entirely based on self-play. The system
started with no experience and was only provided with an incentive
to win. It then played games against itself, experiencing 45,000 years
of play over a period of 10 real months – averaging 250 years of
simulated gameplay per day.
17
EXAMPLE MODEL:
TRAFFIC LIGHT
TIMING – AI VS
O P T I M I Z AT I O N
EXAMPLE MODEL: TRAFFIC LIGHT TIMING – AI VS OPTIMIZATION
Two Schedule elements were used to determine the arrival rates for
each axis of traffic (one for the north/south, one for the east/west). The
simulation starts at 8:00 AM and finishes 8 hours later at 4:00 PM. The cars
traveling east/west had a consistently high rate throughout the simulation
(500 cars per hour). However, the north/south direction experienced light
traffic in the morning (50 cars per hour) and heavier traffic that peaked
between 2:00 to 3:00 PM (900 cars per hour).
19
EXAMPLE MODEL: TRAFFIC LIGHT TIMING – AI VS OPTIMIZATION
For this model, the key performance indicator (KPI) was defined as the The model was then advanced another ten seconds. The reward given to
average time a car spends in the system; this was tracked through a the learning agent is a function that was adopted from the work by Arel
Dataset object which was added to whenever cars left the system. As et al.1 (2010) and is a numeric value between -1 to 1. For the observations,
this model made use of reinforcement learning, the observation and the sum is taken for the cars in the forward lanes (moving towards the
actions taken by the learning agent, and the reward structure also center) and for the cars in the intersection. Initially, the reward is set as the
needed to be defined. difference between these two values. It is then normalized by dividing the
maximum of the values.
Every ten seconds, an observation was sent to the learning agent that
consisted of ten values: the first eight described the total amount of time The learning agent was trained on 100 episodes using the cyclical process
spent in the model for all cars within 150 meters of the intersection for each described above and then added back into the model for testing. To give
of the eight lanes; the ninth element was also the total time spent in the a comparative idea of performance, an Optimization Experiment was also
model, but for the cars in the intersection; the tenth element was the index run on the model and output what phase length it determined was best for
of the current traffic light phase. From that information, the learning agent each axis. When using the optimized values, the mean time in system value
then took one of two actions: do nothing and keep the current phase of the was 1.54 minutes. However, using the AI policy in the model, achieved a
traffic light or move to the next phase. mean time in system of 1.03 minutes – a 33% improvement!
The power of replacing static values with a dynamic ANN allows dynamic
adaptation to any given situation. Even for situations never experienced
before, with knowledge from similar situations, a policy can outperform
values determined by black-box optimization experiments.
The model is simple for illustrative purposes and, as a result, the policy it
learned can be outperformed by a human. However,
the beauty of the policy is that no human assistant was involved in the
learning process; the AI learned a meaningful policy on its own, based on
its interaction with the simulation model.
If a more realistic case were setup and trained on, the learning agent would
start to show its advantages over human curated algorithms.
1 I. Arel, C. Liu, T. Urbanik and A. G. Kohls, “Reinforcement learning-based multi-agent system for network traffic signal control,” in IET Intelligent Transport Systems, vol. 4, no. 2, pp. 128-135, June 2010.
20
C A S E ST U DY:
C O R E M OV E M E N T
RESOLUTION – AN
I N D U ST R I A L P RO B L E M
R E S O LV E D BY A I A N D
S I M U L AT I O N
CASE STUDY: CORE MOVEMENT RESOLUTION – AN INDUSTRIAL PROBLEM RESOLVED BY AI AND SIMULATION
Being highly customizable, AnyLogic allowed the utilization of Java-based machine learning packages and
provided a robust simulation environment in which to train the learning agent.
22
CASE STUDY: CORE MOVEMENT RESOLUTION – AN INDUSTRIAL PROBLEM RESOLVED BY AI AND SIMULATION
The adopted learning algorithm was a double deep Q network (DDQN), AN EXAMPLE OF A BOTTLENECK AND BLOCKAGE DURING THE
implemented by Skymind in their DL4J package. Since the problem MANUFACTURING OF CORES WITH DIFFERENT PRODUCTION CYCLES
consisted of different tasks, each one was addressed separately, and the
combination of these solutions was used to address the main problem. The
result was a policy that replaced the complicated heuristics, which were
difficult to maintain and debug.
23
CONCLUSION
We are now at a point where AI is expanding beyond research environments and into the real world. To facilitate this, the power of
simulation is increasingly being used to leverage the promises of AI. Companies working with either technology stand to benefit
from their combination.
With the origins of machine learning starting in the 1950’s, it is not a new spanning thousands of real projects that are deployed across almost all
topic. However, it wasn’t until recently, and the availability of the necessary industries. This will allow an expansion beyond the focus on toy and game
computing power, that the theorized concepts could start to be applied. simulations and into real-world systems.
Simulation practitioners will soon notice a dramatic increase in the demand Regardless of background, both industries can easily collaborate. However,
for their expertise. With real-world systems being too complicated for while both simulation and AI are clearly compatible with one another, there
the constant redevelopment of hand-coded environments, there will be a is still a separation of expertise. Overall, the compatibility of the two fields
significant need for general-purpose simulation modelers. This will provide enables easy collaboration and practitioners can benefit without the need
simulation practitioners with many opportunities in the upcoming boom. for retraining. With AnyLogic’s interoperability and flexibility, it provides a
natural fit for these two industries to come together.
Concurrently, the benefit to the AI practitioners is that they can use
simulation models today; simulation has a rich and mature ecosystem
24
ADDITIONAL White Papers
Case Studies
R E S O U RC E S
Videos
25
C O N TAC T S
T HE ANY LOG I C COM PAN Y
[email protected]
Contact your local office >>