biss 2013: simulation for decision supportpszps/biss2013/resources/biss_lec03.pdf · biss 2013:...

18
BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part 1 (Practice) Peer-Olaf Siebers (Nottingham University) Stephan Onggo (Lancaster University) [email protected]

Upload: others

Post on 01-Oct-2020

9 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

BISS 2013: Simulation for Decision Support

Lecture 03

Introduction to the AnyLogic IDE – Part 1 (Practice)

Peer-Olaf Siebers (Nottingham University)

Stephan Onggo (Lancaster University)

[email protected]

Page 2: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

Motivation

• Provide an introduction to AnyLogic IDE

• Introduce object oriented terminology

• Provide the minimum Java knowledge required for AnyLogic

• Design and implement a first model in AnyLogic

2

Page 3: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

3

AnyLogic IDE

Page 4: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

4

AnyLogic IDE

• Important Keys – F1: Help

– Ctrl-Space: Code completion support

– Ctrl-Enter: Perform refactoring (replace name occurrences)

– Run: Select the correct model

– Simulation: Set up simulation parameters

• AnyLogic Base Models

Page 5: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

Fundamental Object Oriented Terms http://www.cs.kent.ac.uk/people/staff/djb/oop/glossary.html

• Object-Oriented Design – Software design method that models the characteristics of abstract or

real objects using classes and objects.

• Class – Programming language concept that allows data and methods to be

grouped together; defines the implementation of a particular kind of objects; blueprint for objects

• Method – The part of a class definition that implements some of the behaviour

of objects of the class; a function defined in a class

5

Page 6: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

Fundamental Object Oriented Terms http://www.cs.kent.ac.uk/people/staff/djb/oop/glossary.html

• Object – An instance of a particular class. The class to which an object belongs

defines the general characteristics of all instances of that class.

• Constructor – Creates a new instance of a class

• Instance – An object of a particular class; created using the new operator

followed by the class name

6

Page 7: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

Fundamental Object Oriented Terms http://www.cs.kent.ac.uk/people/staff/djb/oop/glossary.html

• Subclass – A class that is derived from a particular class

• Inheritance – The concept of classes automatically containing the variables and

methods defined in their superclass

7

Page 8: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

Java Basics for AnyLogic

• AnyLogic Help

8

Page 9: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

Java Basics for AnyLogic

• Slides: http://www.xjtek.com/file/207/

• Book Chapter: http://www.xjtek.com/files/book/Java_for_AnyLogic_users.pdf

• Bootcamp: http://www.cs.usask.ca/faculty/ndo885/Classes/ConsensusABM/Lectures.html#JavaForAnyLogicTutorials

9

Page 10: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

10

Tutorial: Laptop Running on Battery

• Modelling task – When the laptop is on and the user is working, i.e. is pressing the

keyboard keys and moving the mouse, the laptop stays on. After 5 minutes of user inactivity the laptop turns off the screen to save power. If the user remains inactive for another 10 minutes, the laptop switches to sleep mode to further minimise the battery usage. To wake the laptop up you need to press the power button.

– In any of the three states On, Screen Off and Sleep the laptop consumes the battery power. When the battery level falls down to 10% the laptop is forced to shut down regardless of the state.

Page 11: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

Tutorial: Laptop Running on Battery

• Conceptual model elements

• What does the conceptual model look like?

11

Page 12: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

12

Tutorial: Laptop Running on Battery

Page 13: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

13

Challenge

• Try to add off-switch

• Try to add on/off switch

Page 14: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

Challenge

14

Page 15: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

15

Challenge

• Modelling more than one laptop

Page 16: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

16

Challenge

Page 17: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

17

Challenge

Page 18: BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013: Simulation for Decision Support Lecture 03 Introduction to the AnyLogic IDE – Part

Questions

18