Jump to content

Simulation with AnyLogic/Print version

From Wikibooks, open books for an open world


Simulation with AnyLogic

The current, editable version of this book is available in Wikibooks, the open-content textbooks collection, at
https://en.wikibooks.org/wiki/Simulation_with_AnyLogic

Permission is granted to copy, distribute, and/or modify this document under the terms of the Creative Commons Attribution-ShareAlike 3.0 License.

Agent-Based Modeling

Bass Diffusion. Agent Based Model

[edit | edit source]

AnyLogic supports different modeling techniques. This tutorial covers the agent-based modeling approach, successfully applied in a wide range of fields such as ecology, sociology, economics, traffic simulation, and many others. Agent-based modeling is used to model markets (agent is a potential customer), competition and supply chains (agent is a company), population (agent is a family, a citizen, or a voter), etc. Agent-based models allow getting an insight into the general behavior of the system assuming the behavior of its elements, without having any global knowledge about the system.

AnyLogic is the only simulation tool, which allows creating flexible models with agents, interacting with each other and their environment. AnyLogic supports all known ways of specifying the agent behavior – statecharts, synchronous and asynchronous event scheduling.

This tutorial will briefly take you through the process of constructing a simulation model using AnyLogic. It is intended to introduce you to AnyLogic interface and many of its main features. We will create a simple illustrative example—the product life cycle model, used for forecasting sales of new products. The first steps will take you through the process of construction of the classic Bass diffusion model. The model describes a product diffusion process. Potential adopters of a product are influenced into buying the product by advertising and by word of mouth from adopters – those who have already purchased the new product. Adoption of a new product driven by word of mouth is likewise an epidemic. Potential adopters come into contact with adopters through social interactions. A fraction of these contacts results in the purchase of the new product. The advertising causes a constant fraction of the potential adopter population to adopt each time period.

Then we will expand our model by considering some details and introducing you to some advanced features of AnyLogic useful in agent-based modeling.

Note that there are several reference files available for this model representing the milestones of the editing. You can use reference files if you experience any difficulties creating a model and you would like to compare your model with the reference file. You can use Welcome Page to open those examples. Welcome Page appears automatically when you open AnyLogic. It can be opened whenever you like from AnyLogic menu: Help|Welcome.

You can also run this model online.

  1. 100% developed  as of July 21, 2009 Step 1. Creating a new model
  2. 100% developed  as of July 21, 2009 Step 2. Creating agents
  3. 100% developed  as of July 21, 2009 Step 3. Adding Adoption from Advertisement
  4. 100% developed  as of July 21, 2009 Step 4. Counting the product adopters
  5. 100% developed  as of July 21, 2009 Step 5. Adding charts
  6. 100% developed  as of July 21, 2009 Step 6. Configuring simulation
  7. 100% developed  as of July 21, 2009 Step 7. Running the model
  8. 100% developed  as of July 21, 2009 Step 8. Adding adoption from word of mouth
  9. 100% developed  as of July 21, 2009 Step 9. Adding the Product Consumption Logic
  10. 100% developed  as of July 21, 2009 Step 10. Adding agent animations
  11. 100% developed  as of July 21, 2009 Step 11. Making people contacts distance-based


System Dynamics

Bass Diffusion Model

[edit | edit source]

AnyLogic supports different modeling techniques. This document covers System Dynamics modeling approach. There are many spheres where system dynamics simulation can be successfully applied — the range of SD applications includes business, urban, social, ecological types of systems. AnyLogic allows you to create complex dynamic models using standard SD graphical notation.

This tutorial will briefly take you through the process of constructing a simulation model using AnyLogic. It is intended to introduce you to AnyLogic interface and many of its main features. We will create a simple illustrative example — the product life cycle model, used for forecasting sales of new products.

The first 10 steps will take you through the process of construction of the classic Bass diffusion model. The model describes a product diffusion process. Potential adopters of a product are influenced into buying the product by advertising and by word of mouth from adopters – those who have already purchased the new product. Adoption of a new product driven by word of mouth is likewise an epidemic. Potential adopters come into contact with adopters through social interactions. A fraction of these contacts results in the purchase of the new product. The advertising causes a constant fraction of the potential adopter population to adopt each time period.

Then we will expand our model by considering some details and introducing you to some advanced features of AnyLogic useful in creating system dynamics models. The expanded model may help you to better plan the entry strategy, target the right consumer and anticipate demand so as to have an efficient and effective promotion strategy.

Note that there are several reference files available for this model representing the milestones of the editing. You can use reference files if you experience any difficulties creating a model and you would like to compare your model with the reference file. You can use Welcome Page to open those examples. Welcome Page appears automatically when you open AnyLogic. It can be also opened whenever you like from AnyLogic menu: Help|Welcome.

You can also run this model online.

  1. 100% developed  as of July 21, 2009 Step 1. Analyzing the model
  2. 100% developed  as of July 21, 2009 Step 2. Creating a new model
  3. 100% developed  as of July 21, 2009 Step 3. Adding stocks
  4. 100% developed  as of July 21, 2009 Step 4. Adding adoption flow
  5. 100% developed  as of July 21, 2009 Step 5. Adding constants
  6. 100% developed  as of July 21, 2009 Step 6. Defining initial values of stocks
  7. 100% developed  as of July 21, 2009 Step 7. Adding auxiliaries
  8. 100% developed  as of July 21, 2009 Step 8. Configuring simulation
  9. 100% developed  as of July 21, 2009 Step 9. Running the model
  10. 100% developed  as of July 21, 2009 Step 10. Adding charts
  11. 100% developed  as of July 21, 2009 Step 11. Modeling replacement purchases


Discrete Event Simulation

Discrete-Event Simulation

[edit | edit source]

AnyLogic provides Enterprise Library, a discrete-event simulation library containing objects you can use to rapidly simulate complex discrete-events systems like:

  • Manufacturing processes with detailed shop floor layout
  • Simple and complex service systems (e.g. banks, airports, hospitals etc.)
  • Business processes with activity based costing
  • Logistics and supply chain models

Enterprise Library allows you to create flexible models, collect basic and advanced statistics, and effectively visualize the process you are modeling to validate and present your model.

This tutorial shows you the basic steps of creating models of different natures – in the fields of manufacturing, service and business processes. Enterprise Library allows you to create models of different natures where discrete events happen – for example, parts processing during manufacturing or document processing during document circulation. There are many other spheres where discrete event simulation can be successfully applied. Moreover, in case you need to extend your model and go beyond pure discrete event simulation, you can seamlessly use any other AnyLogic modeling techniques in your model. For instance, you can use statecharts to describe complex, non-trivial behavior. For more information about the modeling techniques and ways AnyLogic supports, please refer to AnyLogic Help.


Pedestrian Simulation

Pedestrian Simulation

[edit | edit source]

AnyLogic provides the Pedestrian Library, a higher-level library for simulating pedestrian flows in “physical” environment. It allows creating models of pedestrian buildings (like subway stations, security checks, etc.) or streets (big number of pedestrians). The Pedestrian Library allows you to create flexible models, collect basic and advanced statistics, and effectively visualize the process you are modeling to validate and present your model. You may collect statistics on pedestrian density in different areas, to assure acceptable performance of service points with hypothetic load, estimate lengths of stay in specific areas, detect potential problems with interior geometry – effect of adding obstacles and many other applications. In models created with Pedestrian Library, pedestrians move in continuous space, reacting on different kinds of obstacles (walls, different kinds of areas) and other pedestrians.

In this tutorial you will learn how to create models with Pedestrian Library. We will create a simple illustrative example of subway entrance . This model demonstrates how to simulate simple pedestrian flow and services using AnyLogic Pedestrian Library

Note that there is a reference model Subway Entrance available representing the milestones of the editing. You can use it if you experience any difficulties creating a model and you would like to compare your model with the reference file. Use Sample Models page of the Welcome page to open this example.

Please refer to Pedestrian Library Reference Guide for more information about Pedestrian Library blocks and their functions and parameters.

You can run this model online.

Subway Entrance Model

[edit | edit source]
  1. Step 1. Creating a new model
  2. Step 2. Creating a model animation
  3. Step 3. Adding a passenger flow
  4. Step 4. Configuring the simulation
  5. Step 5. Running the model
  6. Step 6. Adding ticket control gates
  7. Step 7. Changing passenger arrival rate interactively
  8. Step 8. Adding ticket windows