Events in AnyLogic. Nathaniel Osgood MIT

Similar documents
AGENT-BASED MODELING BOOTCAMP FOR HEALTH RESEARCHERS AUGUST 2012 A SIMPLE NETWORK-BASED INFECTION SPREAD AGENT-BASED MODEL

Specifying Agent Properties. Nathaniel Osgood MIT

Collecting, Outputting & Inputting Data in AnyLogic

Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Module 02 Lecture - 45 Memoization

Exercise Unit 2: Modeling Paradigms - RT-UML. UML: The Unified Modeling Language. Statecharts. RT-UML in AnyLogic

Fundamental Anylogic Classes. Nathaniel Osgood

BISS 2013: Simulation for Decision Support

Tutorial: Functions and Functional Abstraction. Nathaniel Osgood CMPT

IT 540 Operating Systems ECE519 Advanced Operating Systems

Exercise Rating: Intermediate

Computer Science 4500 Operating Systems. In This Module. Deadlock Definition. Module 7 Deadlocks

Computer Science 4500 Operating Systems

Installing Visual Studio for Report Design

Introduction to Modeling. Lecture Overview

REPAST SIMPHONY SYSTEM DYNAMICS GETTING STARTED

AGENT-BASED MODELING BOOTCAMP FOR HEALTH RESEARCHERS AUGUST 2012 CREATING A HETEROGENEOUS POPULATION

TCP : Fundamentals of Computer Networks Bill Nace

Network Environments in AnyLogic. Nathaniel Osgood Agent-Based Modeling Bootcamp for Health Researchers

Cover sheet for Assignment 3

In This Lecture You Will Learn: Specifying Control. Statechart. Event, State and Transition

COMPUTER SCIENCE 4500 OPERATING SYSTEMS

6.001 Notes: Section 15.1

Deadlocks. Prepared By: Kaushik Vaghani

OUTBOUND. Queue Manipulation Wizard. Synthesys CRM & Outbound Management

Object Interconnections

CSCI 8530 Advanced Operating Systems. Part 10 Clock and Timer Management


Lecture 13: more class, C++ memory management

CS Operating Systems

CS Operating Systems

Reliable Transport I: Concepts and TCP Protocol

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

In the following sections we work through some illustrative tutorials demonstrating some functional areas of the product.

AnyLogic and Java. Nathaniel Osgood. Agent-Based Modeling Bootcamp for Health Researchers

Appointment Campaigns

ETSF05/ETSF10 Internet Protocols Transport Layer Protocols

Motivation State Machines

CS 344/444 Computer Network Fundamentals Final Exam Solutions Spring 2007

Uniprocessor Scheduling

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #23 Loops: Precedence of Operators

We will show that the height of a RB tree on n vertices is approximately 2*log n. In class I presented a simple structural proof of this claim:

A Simple Example. The Synchronous Language Esterel. A First Try: An FSM. The Esterel Version. The Esterel Version. The Esterel Version

OUTLOOK TIPS AND TRICKS GINI COURTER, M.B.A., TRIAD CONSULTING

High Performance Computing Prof. Matthew Jacob Department of Computer Science and Automation Indian Institute of Science, Bangalore

H2 Spring B. We can abstract out the interactions and policy points from DoDAF operational views

Liveness properties. Deadlock

Patient Portal User Guide The Patient s Guide to Using the Portal

HTTPS The New B2Bi Portal. Bank of America s secure web transmission interface user guide

PL/SQL Block structure

Real-Time Programming Languages (ADA and Esterel as Examples)

25Live Event Request Submission Tutorial

In the previous lecture, we examined how to analyse a FSM using state table, state diagram and waveforms. In this lecture we will learn how to design

In the previous lecture, we examined how to analyse a FSM using state table, state diagram and waveforms. In this lecture we will learn how to design

2. Which of the following resources is not one which can result in deadlocking processes? a. a disk file b. a semaphore c. the central processor (CPU)

1. The Normal Distribution, continued

Overview and Instructions

Sensitivity Analysis. Nathaniel Osgood. NCSU/UNC Agent-Based Modeling Bootcamp August 4-8, 2014

Exercise 2. and the following set of terms: Compute, using the boolean model, what documents satisfy the query

MY CCP Customization

HGC SUPERHUB HOSTED EXCHANGE

Bases of topologies. 1 Motivation

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #33 Pointer Arithmetic

APPOINTMENTS AND EVENTS

Comp 248 Introduction to Programming Chapter 4 & 5 Defining Classes Part B

Network Performance: Queuing

Procedures Oracle FLEXCUBE Universal Banking Release 12.0 [May] [2012] Oracle Part Number E

Lecture 6: Reliable Transmission. CSE 123: Computer Networks Alex Snoeren (guest lecture) Alex Sn

CS519: Computer Networks. Lecture 5, Part 4: Mar 29, 2004 Transport: TCP congestion control

Scheduler Plug-In Help Kepware Technologies

Scheduling Reports Launch the Scheduling Tool... 1 Description... 1 Overview of Scheduling Components... 2

CUSTOMER PORTAL USER MANUAL. Marketing

GUARD1 PLUS Documentation. Version TimeKeeping Systems, Inc. GUARD1 PLUS and THE PIPE are registered trademarks

Web Portal User Guide

Fall UI Design and Implementation 1

Sardar Vallabhbhai Patel Institute of Technology (SVIT), Vasad M.C.A. Department COSMOS LECTURE SERIES ( ) (ODD) Code Optimization

CS 167 Final Exam Solutions

Session 2: Models, part 1

15.1 Data flow vs. traditional network programming

Administration. Objects and Arrays. Objects. Agenda. What is an Object? What is a Class?

Multiprocessor and Real- Time Scheduling. Chapter 10

Tracked Opportunities

Suggested Solutions (Midterm Exam October 27, 2005)

Software Design and Analysis for Engineers

Lecture 22 Concurrency Control Part 2

Statecharts 1.- INTRODUCTION 1.- INTRODUCTION

AlwaysAssist User Guide Vision Care Provider Portal Page 0

SPYPHONE SMS INTERCEPTOR

Community Access Portal (CAP) manual. (Updated for SPARCS N4 version 2.6)

Course: Advanced Software Engineering. academic year: Lecture 14: Software Dependability

You can configure different reason codes with the same reason code label across various teams.

Interface. 2. Interface Adobe InDesign CS2 H O T

EASY

10/21/2016. ECE 120: Introduction to Computing. Let s Extend Our Keyless Entry FSM. FSM Designs Also Allow Use of Abstraction

Altus Call Recording. Dashboard Admin User Guide. Document Version Maryland Way, Suite 300 Brentwood, TN Tel

My SA Rodeo AccountManager. How To Guide

For Volunteers An Elvanto Guide

PRIORITY QUEUES AND HEAPS

Speaker Verification in BeVocal VoiceXML

Blackboard 5 Level One Student Manual

NCI s Learning Management System (LMS) Instructor-Led Training (ILT) Learner Guide

Transcription:

Events in AnyLogic Nathaniel Osgood MIT 15.879 March 14, 2012

Events & Scheduling in AnyLogic Reminder: In simulating stock & flow models, time advances in steps Euler integration: Fixed-sized Steps Runga-Kutta: Fixed or variable sized steps For each timestep, we compute the flows & update the stocks AnyLogic jumps from event to event The data structure that keeps track of such events is called the schedule The associated process is called the scheduler

Implicit Events we ve Seen Transitions Fixed rate (Poisson arrival) Timeout Condition Message transmission (schedules event for the receiver) Starting a model Stopping a model In this course, we term these implicit events because they are not reified as objects in the model

The Schedule At a given time, the schedule keeps track of a number of queued events Events may get added to the schedule (e.g. when we enter a new state) Events get deleted from the schedule When they fire off and are complete When another mutually exclusive event preempts them (e.g. a person dies before they recover from an infection)

Explicit Events Explicit Events can also be declared from the pallette Dynamic events can have multiple instances Each instance can be scheduled at different times The instances disappear after event firing Regular (static) events can be rescheduled, enabled/disabled, but can only have one scheduled firing at a time There are some subtleties with explicit events

(Explicit) Event Subtleties Be very careful of what you count on for recomputation of rate may think was recomputed, but hasn t been Event rates (and likely event timeout times) are only computed occasionally, not continuously These are computed when Explicitly call event methods start() restart() onchange()» e.g. if wish to update rates associated with transitions, Main can periodically call onchange() on each agent An event in Main can take care of this task When event fires and requires restarting (For outgoing transitions) when enter a state in a statechart Calling reset will disable a rate until re-enable (e.g. with call to restart())

Event Times: Common Options for Event Scheduling At a specified rate (Poisson arrivals) Interarrival time is exponentially distributed! Mean time between events is reciprocal of rate (i.e. 1/rate) One-time Can go off at a particular time (specified as a calendar time or as a double-precision value) At some initial time and then cyclically beyond with set timeout period The timeout period is set according to the time unit This goes off after exactly the timeout time When boolean condition changes (depends on onchange being called) Manually (via restart() see following slides)

Event Subtleties Be very careful of what you count on for recomputation of rate may think was recomputed, but hasn t been Event rates (and likely event timeout times) are only computed occasionally, not continuously These are computed when Explicitly call event methods start() restart() onchange() When event fires and requires restarting (For outgoing transitions) when enter a state in a statechart Calling reset will disable a rate until re-enable (e.g. with call to restart())

Built-In Events In addition to handling occurrence of explicit events, models automatically support catching certain built-in types of events To handle these events, code is inserted into certain handler areas for each of different sorts of classes

Example: Built-In Events (Agent 1) Handler : Code is executed when the specified event (e.g., arrival at a destination, message arrival) occurs.

Example: Built-In Events (Agent 2)

Example: Built-In Events (Main)

Dynamic Events (Closure-Like) Like a static event, a dynamic event is associated with an action to invoke when it occurs A static event has a single associated schedule Just as a class can be associated with multiple instances, Dynamic events can have multiple instances Each instance can be scheduled at different times The schedule for each different instance proceed in parallel The instances disappear after event firing We can think of each dynamic event instance as its own onetime ( one-shot ) event

Parameterization of Dynamic Events With a dynamic event, we create the event during simulation, but at a different time than it occurs Frequently the action we want to performed in a dynamic event depends on specific context known at the time that it was created For example, we want to create or delete a particular person, or a person with particular characteristics Specification of dynamic events at design time defines custom parameters ( arguments ) Parameters values can be used to communicate context from time of creation of the dynamic event until when it fires Particular values for these parameters are then given at time when dynamic event instance is created

Specifying a Dynamic Event Step 1 1) Click here, 2) use mouse to click in Canvas to add Dynamic event Click on the Model label in the Palette window

Specifying a Dynamic Event Step 2

Attractive Use of Dynamic Events 1 Scheduling Future Birth at time of Conception Mating of deer during rut occurs long before births of fawns Contacts between deer during rut could be simulated in the model At time of contact, create single dynamic event to schedule associated future birth Could save away information of history relevance e.g. Characteristics of parents Infection status Genotype Stress level Location of where conception occurred

Attractive Use of Dynamic Events 2 Adding in Individuals to Population over a Time Interval Dynamic events can be very handy if have a known number of actions that need to take place spread out over some period of time Example: Given: Known count of Immigrants with particular characteristics to be added to model population over course of each month Suppose we don t know when these individuals arrive during the month We can simply create the same count of dynamic events, whether each dynamic event takes care of Creating a person with known characteristics Adding that person to the model population This approach will be discussed in an upcoming guest lecture