building up a simple agent-based model via the anylogic wizard · java class interface dimension...

27
Building Up a Simple AgentBased Model via the AnyLogic Wizard Nathaniel Osgood 10272009

Upload: hakien

Post on 16-Sep-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Building Up a Simple Agent‐Based Model via the AnyLogic Wizard

Nathaniel Osgood

10‐27‐2009

Page 2: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Incremental & Modification‐Based Development

• Frequently the hardest part of an AnyLogicproject is building up the basic structure

• Some of the most productive ways to use AnyLogic are by modifying existing models

• I would strongly recommend familiarizing yourself with– AnyLogic wizards (such as that shown here)

– AnyLogic Samples

– Any AnyLogic code that we can provide 

• Incrementally develop applications

Page 3: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Requesting a New Model

Page 4: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Filling in New Model Information

Page 5: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Filling in New Model Information

Page 6: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Selecting Model Type

Page 7: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Setting the Agent Name

Page 8: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Setting Agent Spatial Properties(Cells  vs. Continuous)

Page 9: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Setting Network Properties

Page 10: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Adding Initial State Charts

Page 11: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

The Resulting Main Object

Page 12: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

The Resulting Person Object

Page 13: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Running the Model

Page 14: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Run Setup Screen – Press Button!

Page 15: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

The Model in Operation

Page 16: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Adding Agent Interaction

Page 17: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

This means that the model has changedSince the last time it was saved.   You should consider saving the model when you see this!

Trigger transition based on reception of any message

Page 18: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Making Transition Depend on State

Page 19: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Adding a New Transition

Page 20: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

This is a Self‐TransitionAn Action is Fired, but No State Transition

Page 21: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Setting the Self‐Transition to Go off Occasionally

Page 22: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Setting the Action to Send a Message

Page 23: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Letting a Person Know What to Do when a Message is Received

Page 24: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

We Start with Exactly One Infective

Page 25: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Run the Model Again!

Page 26: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Starting the Model

Page 27: Building Up a Simple Agent-Based Model via the AnyLogic Wizard · Java Class Interface Dimension ... System D y nanua Statechart Actio nchart Analysis Data Set ... Set up agent pr

Network Spread of Influence