Elevator Algorithm B99901013 楊定 B99901025 王育軒 B99901026 陳昶亦.

Slides:



Advertisements
Similar presentations
Overview of Mass Storage Structure
Advertisements

Disks Disk Hardware (1) Disk parameters for the original IBM PC floppy disk and a Western Digital WD hard disk.
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Picture It Very Basic Game Picture Pepper. Original Game import java.util.Scanner; public class Game { public static void main() { Scanner scan=new Scanner(System.in);
BackTracking Algorithms
Anany Levitin ACM SIGCSE 1999SIG. Outline Introduction Four General Design Techniques A Test of Generality Further Refinements Conclusion.
Disk Scheduling Based on the slides supporting the text 1.
Disk scheduling examples. Problem parameters: u Disk has 100 cylinders, labeled u Time to move from cylinder A to cylinder B is a linear function.
Satisfaction Equilibrium Stéphane Ross. Canadian AI / 21 Problem In real life multiagent systems :  Agents generally do not know the preferences.
Input/Output Management and Disk Scheduling
Hard Drive Simulation By Steven Hyink Perry Kukura.
Chapter 1 pp 1-14 Properties of Algorithms Pseudocode.
Based on the slides supporting the text
Chapter 1 pp 1-14 Properties of Algorithms Pseudocode.
Searching Arrays Linear search Binary search small arrays
 Elevator Scheduling Lingfeng Luo Zhao Han. Elevator Scheduling Problem  Elevator as a control System  Behavior depends on programmed algorithms 
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Disk and I/O Management
Presented by Ravi Teja Pampana
Device Management. So far… We have covered CPU and memory management Computing is not interesting without I/Os Device management: the OS component that.
Programming & Data Structures
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 10: Mass-Storage Systems.
Operating Systems CMPSC 473 I/O Management (4) December 09, Lecture 25 Instructor: Bhuvan Urgaonkar.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 12: Mass-Storage Systems.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
Prime numbers Jordi Cortadella Department of Computer Science.
 2000 Deitel & Associates, Inc. All rights reserved. Optional Case Study - Chapter 4 Outline 4.1 Introduction 4.2 Class Operations 4.3 Creating Class.
I/O Management and Disk Structure Introduction to Operating Systems: Module 14.
7.2 Priority Queue ADTs Priority queue concepts
I/O Management and Disk Scheduling. I/O Hardware Incredible variety of I/O devices Common concepts Port (a connection point) Bus (daisy chain or shared.
Rensselaer Polytechnic Institute CSC 432 – Operating Systems David Goldschmidt, Ph.D.
Disks and Disk Scheduling Steve Muckle Monday, March 31st Spring 2003.
Real-Time systems By Dr. Amin Danial Asham.
Disk Scheduling CS Introduction to Operating Systems.
Chapter 11 File Systems and Directories. Chapter Goals Files, directories, and file systems Text and Binary files Disk-scheduling algorithms 11-2.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
1.  Disk Structure Disk Structure  Disk Scheduling Disk Scheduling  FCFS FCFS  SSTF SSTF  SCAN SCAN  C-SCAN C-SCAN  C-LOOK C-LOOK  Selecting a.
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department.
An alternative subtraction algorithm. In order to subtract, the top number must be larger than the bottom number To make the top number.
1 CS.217 Operating System By Ajarn..Sutapart Sappajak,METC,MSIT Chapter 13 Mass-Storage Systems Slide 1 Chapter 13 Mass-Storage Systems.
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
I/O Scheduling Computer Organization II 1 Disk Scheduling Carrying out disk accesses in the order they are received will not always produce optimal performance.
M ASS S TORAGE S TRUCTURES Lecture: Operating System Concepts Lecturer: Pooja Sharma Computer Science Department, Punjabi University, Patiala.
Presentation-4 Group-A1 Professor Mohamed Khalil Anita Kanuganti Hemanth Rao.
G5AIAI Introduction to AI Graham Kendall Heuristic Searches.
Elevator (Disk) Scheduling COMPSCI 210 Recitation 26th Oct 2012 Vamsi Thummala.
Elevator Scheduling Mingzhou Hu Yujian Gao Haogang Su Xiangya Yan.
Chapter 29 Peer-to-Peer Paradigm Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Searching Arrays Linear search Binary search small arrays
Chapter 10: Mass-Storage Systems
Input/Output Devices ENCE 360
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Secondary Storage Secondary storage typically: Characteristics:
Parallel Density-based Hybrid Clustering
Optional Case Study - Chapter 4
Disk Scheduling Algorithms
Trees.
I/O Systems Chapter 15 11/7/2018 Crowley OS Chap. 15.
قراءة القوائم المالية وفـاء شـريف علي. محلل مالي
Moving-head Disk Machanism
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
Chapter 37 Hard Disk Drives
15.082J & 6.855J & ESD.78J Visualizations
Thank You!! For More Information Visit: m/ Call to :
Trees.
Disk Scheduling Carrying out disk accesses in the order they are received will not always produce optimal performance. Seek time is the reason for differences.
Group Members First Names
The Shortest Path Algorithm
Operating Systems Disk Scheduling A. Frank - P. Weisberg.
Presentation transcript:

Elevator Algorithm B99901013 楊定 B99901025 王育軒 B99901026 陳昶亦

At first…. At first , our goal is to find a efficient way for an elevator model like 二活 , which has four elevators and twelve floors.

Let’s do it So we start our work like this… Student A is at 4F , he wants to go to 6F so elevator α come to A now additional student B is at 8F , he wants to go to 2F so elevator β come to B now another student C is at 3F , he wants to go to 10F so elevator γ come to C another student D is at 7F , he wants to go to 4F So elevator δ come to D

However However , we sadly found that with more and more student , the situation is beyond our control. Student D student E student F ….Student Z…StudentAA Student AB….StudentZZ…… 8F 4F 9F 11F 3F…………..@#%&*#$@*#$!%

Q_____Q That is goddamn hard……

We need change!! In order to keep us alive , we have to try another way Our model now is a twenty floors building with one elevator, we use the model to test the three elevator algorithm , to compare them , hoping the result is the same to our initial model

Algorithm we used 1.FCFS Which means “First Come First Serve.” It is the most simple and traditional way to control elevators. The first one who sends the request can take the elevator first. 2.SSTF Which means “Shortest Seek Time First” It works depending on the shortest distance. It will find out which floor is the closest to the elevator. The elevator goes to that floor, and search the next requested floor according to their distance.

Algorithm we used 3. SCAN&LOOK LOOK is similiar to the SCAN. SCAN makes elevators moving from top to the bottom. Elevators turn back when they reach the top or the bottom. LOOK is an optimization of SCAN. The different is that the elevator turns back when there is no request in the elevator’s direction (up or down) in the time.

Our Code (1) struct Request{ int Where; int When; // Have the same concept about order // From 1~200 bool visited; }request[100]; struct Elevator{ int now; int sum; int T; }elevator;

Our Code (2) Concept of real time (causality) Other Useful Function Use in SSTF and LOOK(SCAN) Output at any time depends on input at the same time and in the past. Elevators can only respond the request which is sent before now Ex. if(request[i].When<=elevator.T)….. Ex2. elevator.T+=step….. Other Useful Function bool AllRun() bool AllRun2(int deraction, int Time)

Our Code (3) Three main functions Void FCFS() Void SSTF() NOT real time algorithm The most simple one According to their orders Void SSTF() Real time algorithm Search requests by their time and just finding which is the closest Void LOOK(int z) Search requests not only by their time but the elevator’s direction z=0 means going up, z=1 means going down Steadier than SSTF

Result

Conclusion Obviously, according to our model , SCAN&LOOK is the best way among the three algorithm to manipulate an elevator. So , we think SCAN&LOOK should be chosen when decide which algorithm to be chosen to manipulate an elevator.

Thank you~~~