BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013:...
Transcript of BISS 2013: Simulation for Decision Supportpszps/biss2013/resources/BISS_Lec03.pdf · BISS 2013:...
![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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/1.jpg)
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)
![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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/2.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/3.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/4.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/5.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/6.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/7.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/8.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/9.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/10.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/11.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/12.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/13.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/14.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/15.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/16.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/17.jpg)
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](https://reader033.fdocuments.in/reader033/viewer/2022051409/601f841cd8d6b22a812799e0/html5/thumbnails/18.jpg)
Questions
18