11/5 - 20071 VIP Elevator – first model A VDM++ Project Made By: Sune Wolff.

Slides:



Advertisements
Similar presentations
PHYS707: Special Topics C++ Lectures Lecture 2. Summary of Today’s lecture: 1.More data types 2.Flow control (if-else, while, do-while, for) 3.Brief introduction.
Advertisements

Getting started with ML ML is a functional programming language. ML is statically typed: The types of literals, values, expressions and functions in a.
Previously… Processes –Process States –Context Switching –Process Queues Threads –Thread Mappings Scheduling –FCFS –SJF –Priority scheduling –Round Robin.
Events Chapter 7. Interactivity The real world is interactive User determines order of actions instead of programmer.
Introduction to Kernel
Vienna Development Method SIM5104. one of the longest-established Formal Methods for the development of computer- based systemsFormal Methods Originating.
ObjectDraw and Objects Early Chris Nevison Barbara Wells.
Semaphores, mutexes and condition variables. semaphores Two types – Binary – 0 or 1 – Counting 0 to n Wait – decrements > 0 forces a wait Post or signal.
18/ VIP Elevator – second model A VDM++ Project Made By: Sune Wolff.
Sequences for system modelling. At the end of this lecture you should be able to: provide a definition of a VDM sequence; identify situations in which.
Ranga Rodrigo. Class is central to object oriented programming.
ACM Web Development Workshop - PHP By Luis Torres.
Singleton Christopher Chiaverini Software Design & Documentation September 18, 2003.
Sequences At the end of this lecture you should be able to: provide a definition of a VDM sequence; utilize and interpret sequence notation; make appropriate.
Sequences At the end of this lecture you should be able to: provide a definition of a VDM sequence; utilize and interpret sequence notation; make appropriate.
Web Design and Development for E-Business By Jensen J. Zhao Copyright 2003 Prentice Hall, Inc. Web Design and Development for E-Business Jensen J. Zhao.
Queues Chapter 3. Objectives Introduce the queue abstract data type. – Queue methods – FIFO structures Discuss inheritance in object oriented programming.
HFOOAD Chapter 2 Requirements. We create software for a reason. We create software fro people. We need to know what the people want in the software we.
 2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 4 Outline 4.1 Introduction 4.2 Class Operations 4.3 Creating Class.
 2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 3 Outline 3.1 Introduction 3.2 Class Attributes 3.3 Statechart Diagrams.
Linux Operations and Administration
TIVDM1Modelling ordered collections1 Peter Gorm Larsen.
TIVDM1Modelling ordered collections1 Peter Gorm Larsen.
Java – Methods Part II Lecture Notes 6. Objects, Classes and Computer Memory When a Java program is executing, the memory must hold: 1. Templates for.
© 2011 Terma A/S 1 VDM-RT: Distributed Real-time Modeling Industrial PhD Student, Sune Wolff Terma A/S Engineering College of.
TIVDM2Real-Time and Distributed Development in VDM++1 Peter Gorm Larsen
Personal Medical Unit Lars Sarbæk Kristiansen Kasper J. Nielsen Martin Kjeldsen
Programming Principles Chapter 1. Objectives Discuss the program design process. Introduce the Game of Life. Discuss object oriented design. – Information.
TIVDM1Modelling unordered collections1 Peter Gorm Larsen.
Data Structures Using C++
Internet Software Development Controlling Threads Paul J Krause.
Topics Sending an Multipart message Storing images Getting confirmation Session tracking using PHP Graphics Input Validators Cookies.
Functions. Built-in functions You’ve used several functions already >>> len("ATGGTCA")‏ 7 >>> abs(-6)‏ 6 >>> float("3.1415")‏ >>>
2Object-Oriented Program Development Using C++ 3 Basic Loop Structures Loops repeat execution of an instruction set Three repetition structures: while,
Overview The Basics – Python classes and objects Procedural vs OO Programming Entity modelling Operations / methods Program flow OOP Concepts and user-defined.
1 Chapter 13-1 Applied Arrays: Lists and Strings Dale/Weems.
Exercise 2 Introduction to C# CIS Create a class called Employee that contains the following private instance variables: Social Securitystring.
Robotics NXT-G: variables, file Rotation sensor Lab: Use buttons to hit specific ball. Homework: Postings. Start planning mapping the room.
Input Validation 10/09/13. Input Validation with if Statements You, the C++ programmer, doing Quality Assurance (by hand!) C++ for Everyone by Cay Horstmann.
TIVDM1Modelling relationships1 Peter Gorm Larsen.
Elevator Example.
TIVDM1Sortation System, Tray Allocation1 Tray allocation for a sortation system Iteration III TI-VDM1 Project by José Antonio Esparza and Kim Bjerge.
Alice in Action with Java Chapter 4 Flow Control.
Sequence diagrams Practice 7. Task 1  The “Author” sends his paper to the “Editor” by the message “manuscript” and waits the confirmation.
Classes in PHP Web Engineering. What is Class? A class is a collection of variables and functions working with these variables. Variables are defined.
 2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 6 Outline 6.1 Introduction 6.2 Implementation: Visibility 6.3 Implementation:
1 Object-Oriented Programming Using C++ CLASS 2 Honors.
VIP Elevator A VDM++ Project Made By: Sune Wolff.
 Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do.
Elevator Example. Problem GSU schedules to upgrade all the campus elevators in 6 months. Due to incompatibility with the new hardware, the current software.
WORKING OF SCHEDULER IN OS
Recursion Powerful Tool
Set Comprehensions In mathematics, the comprehension notation can be used to construct new sets from old sets. {x2 | x  {1...5}} The set {1,4,9,16,25}
Set Comprehensions In mathematics, the comprehension notation can be used to construct new sets from old sets. {x2 | x  {1...5}} The set {1,4,9,16,25}
Introduction to Kernel
Formal Methods in SE Lecture 21.
Self navigating vehicle
VDM: Vienna Development Method
Tuples and Lists.
A lightening tour in 45 minutes
Optional Case Study - Chapter 4
PORTAL LIFT CONTROL Pioneers in access control solutions.
If, else, elif.
all loops initialization – set up the loop
Use Cases Based on the paper
PROGRAMMING IN HASKELL
LabVIEW基礎課程(一) 參考書籍: LabVIEW for Everyone (Jeffrey Travis/Jim Kring)
Navigation Schedule: Timing Topic 45 minutes Lecture
CHAPTER FOUR VARIABLES AND CONSTANTS
3.3 – Invoke Workflow File Exercise 3.2: Extract as Workflow
Presentation transcript:

11/ VIP Elevator – first model A VDM++ Project Made By: Sune Wolff

11/ System Summary VIP and neighbours share elevator. Elevator moves between 5 floors. Call buttons used to call elevator. VIP has door sensor installed Turnstiles can be used to restrict access to the neighbours. VIP do not like to share the elevator. VIP do not like to wait to long.

11/ Class Diagram

11/ World class World instance variables private environment: Environment; operations public World: () ==> World World() == (environment := new Environment(5); ); public Run: () ==> () Run() == is not yet specified; end World

11/ Environment class Environment instance variables private elevator: Elevator; operations public Environment: (nat) ==> Environment Environment(max) == (elevator := new Elevator(max); ); end Environment

11/ Elevator instance variables private currentFloor: Floor := ; private numNeighboursInside: nat := 0; private numVipInside: nat := 0; private maxUsersInside: nat; private innerQueue: Queue := new Queue(3); private outerQueue: Queue := new Queue(3); private tsController: Turnstile := new Turnstile(false); types public Floor = | | | | ; public VipFloor = | ; public User = | ;

11/ Queue instance variables private elevatorQueue: seq of Elevator`Floor := []; private maxInQueue: nat; private VipQueue: Elevator`Floor; public VipInQueue: bool := false; public PutInQueue: Elevator`Floor * Elevator`User ==> () PutInQueue(f, u) == (if (u = ) then (VipInQueue := true; VipQueue := f) else (elevatorQueue := elevatorQueue ^ [f]); ) pre (len elevatorQueue < maxInQueue) post (len elevatorQueue = len elevatorQueue~ + 1); Notice the use of sequence concatenation

11/ Queue public GetNextFromQueue: () ==> Elevator`Floor GetNextFromQueue() == (dcl tempQueue : Elevator`Floor; if (len elevatorQueue = 0 and VipInQueue = true) then return VipQueue; if (VipInQueue = false) then (tempQueue := elevatorQueue(1); elevatorQueue := tl elevatorQueue); return tempQueue; ) pre (len elevatorQueue > 0) or (VipInQueue = true) post (len elevatorQueue = len elevatorQueue~ - 1); Notice use of sequence tail operator

11/ Turnstile class Turnstile instance variables private locked: bool; operations public Turnstile: bool ==> Turnstile Turnstile(l) == (locked := l); public IsTurnstileLocked: () ==> bool IsTurnstileLocked() == (return locked); public LockTurnstile: () ==> () LockTurnstile () == (locked := true) pre locked = false post locked = true; public UnlockTurnstile: () ==> () UnlockTurnstile () == (locked := false) pre locked = true post locked = false; end Turnstile

11/ Class Diagram

11/ Future Improvements Introduce classes for buttons and sensors  Make use of mapping Make elevator more intelligent  Keep track of direction  Choose next floor based on direction and distance Introduce automatic test  Read test sequence from file Make sure the VIP receives special treatment  No neighbours in elevator when VIP wants to use it  Execute VIP order as soon as possible