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

Post on 01-Oct-2020

9 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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)

pos@cs.nott.ac.uk

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

3

AnyLogic IDE

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

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

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

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

Java Basics for AnyLogic

• AnyLogic Help

8

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

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.

Tutorial: Laptop Running on Battery

• Conceptual model elements

• What does the conceptual model look like?

11

12

Tutorial: Laptop Running on Battery

13

Challenge

• Try to add off-switch

• Try to add on/off switch

Challenge

14

15

Challenge

• Modelling more than one laptop

16

Challenge

17

Challenge

Questions

18

top related