Develop a simulation of an elevator

Assignment Help Computer Graphics
Reference no: EM13540587

Elevator project

Develop a simulation of an elevator that travels between floors 1 and N where N is an input. Time is sequenced in discrete steps starting at 1; at each time step, the elevator may ascend one floor, descend one floor, or remain at its current floor, as determined by its strategy. The first line of the input file indicates the number N of floors. This is followed by one line per person using the elevator: her id, call time (when she calls for the elevator), origin floor (where she boards the elevator), and destination floor (where she debarks the elevator). For example:

5
100 2 1 4
101 3 4 5
102 3 3 2
103 5 5 1
104 5 1 4

Here, individual 100 boards at time 2 from floor 1 with a destination of floor 4. Assume sensible inputs (e.g., times are positive integers, floors are integers in the range 1 through N).

Whenever the elevator stops at a floor from which people have called it (i.e., their origin floor but not before their call time), they all board the elevator. And whenever the elevator stops at any passengers' destination floor, they all get off the elevator. (Everyone behaves so as to minimize their travel time.) The simulation stops when every individual has been brought to their destination floor (subject of course to their call time and origin floor constraints).

A strategy determines the floor the elevator begins on at time 1, and a policy for moving to the next floor (up one floor, down one floor, or remaining at the current floor) from one time step to the next. Here is a simple strategy:

Strategy 1: Start at floor 1. In each time step, successively go up one floor until reaching the top floor N, then successively go down one floor until reaching the bottom floor 1, and continue this ‘up to the top floor then down to the bottom floor' policy.

1. A scenario diagram for the case where a customer calls the elevator, the elevator arrives, she boards, the elevator moves (over time) to her destination floor, and she debarks. You may devise other diagrams but this one is essential. You are welcome to discuss and work on your design on our discussion board and during class time (but you should implement the project on your own).

2. Implement Strategy 1 as part of your project. In addition, devise and implement a second strategy that is generally more efficient than Strategy 1. Where sim is a Simulation object, we run a simulation like this:

sim.run(filename_string, strategy_symbol)

The symbol :strategy2 should identify your (more efficient) strategy.

3. Write a method

sim.multirun(nbr_runs, filename_prefix, strategy)

that runs your program nbr_runs many times on the input files named by filename_prefix with suffixes 000.in, 001.in, ..., and returns the average efficiency. For example:

sim.multirun(15, 'myelev', :strategy2)

runs your Strategy 2 on the files myelev000.in, ..., myelev014.in and returns the average of the 15 efficiency values. I will give you a set of input files to test your program on, and you should report the average efficiency you obtain on these files for both strategies. You can also use these input files to compare your strategy to other strategies, with respect to efficiency. I'll also give you a short Ruby program to generate your own test files.

4. Submit your Ruby code for this project, in addition to your scenario diagram, in a zip archive by the due date.

Reference no: EM13540587

Questions Cloud

Calculate the tension in the other string : The angles with respect to the vertical are Q=10.5°, and T=23.5°. State if true, false, or can not tell. The mass of W can be less than that of Z. The charge on W can be positive and that on Z negative.
Explain what volume of chlorine gas at 646 torr and 32oc : What volume of chlorine gas at 646 torr and 32oC would be produced by the reaction of 14.75 g of MnO2 according to the following chemical equation. MnO2(s) + 4 HCl(aq) ----> MnCl2(aq) + Cl2(g) + 2 H2O(l)
Arrange the strength of intermolecular forces : Arrange the following substances in order of increasing strength of intermolecular forces: H2O, He, I2, and N2
Find the magnitude and direction of the fourth displacement : While surveying a cave, a spelunker follows a passage 190{\rm m} straight west, then 210{\rm m} in a direction 45.0^\circ east of south, and then 260{\rm m} at 30.0^\circ east of north. After a fourth unmeasured displacement, she finds herself back w..
Develop a simulation of an elevator : Develop a simulation of an elevator - devise and implement a second strategy - Develop a simulation of an elevator that travels between floors 1 and N where N is an input.
Calculate the angular acceleration of the cylinder : A solid cylinder of mass 10 kg is pivoted about a frictionlessaxis through the center O. What is the angular acceleration of the cylinder
What is the electric flux through a spherical surface : A hollow, conducting sphere with an outer radius of 0.256 and an inner radius of 0.190 has a uniform surface charge density of +6.91×10?6 . A charge of -0.690 is now introduced into the cavity inside the sphere. What is the new charge density on the ..
Find the angular acceleration of stainlesssteel annular disk : The stainless steel annular disk is allowed to rotate on a frictionless table with the rotation axis at its center. find the angular acceleration of the stainless steel annular disk
Explain how many resonance structures does hso4 : How many resonance structures does HSO4- have. The way I've been doing it would make it 12 but that seems like it'd be too many.

Reviews

Write a Review

Computer Graphics Questions & Answers

  Create a simple warm-up program using your g3d

Create a simple warm-up program using your G3D programming and graphics environment.

  Shadow effect while rolling a sphere

Shadow effect while rolling a sphere as well as the options of shading and lighting.

  Relative positioning and interactive positioning

Relative Positioning and Interactive Positioning by Dragging and Clicking and some Simple Animation

  Draw a teapot at the global origin

Draw a teapot at the global origin

  Concepts of computer graphics

Concepts of Computer Graphics and develop a program using OpenGL

  The security policy document outline

Using the GDI Case Study below, complete the Security Policy Document Outline

  Develop the image manipulations

Develop the image manipulations

  What does resolution mean

What does resolution mean How is resolution connected to ppi and dpi units

  Differentiate between a bitmap image and a vector image

Differentiate between a bitmap image and a vector image Explain the following terms

  Essential elements of a design pattern

configuration of an Iterator pattern, patterns could be used in a Library System, Singleton, Template, Decorator, Façade,What does Alexander means by the following declaration "But it is impossible to form anything which has the temperament of natu..

  Framework of user interface design

design of user interfaces, natural mapping, GUI applications, web page design different to designing for printed media, risks exposed in this "phone as individual proxy" approach, interaction designers of ubicomp applications, Storyboards are usual..

  What are the factors affecting picture composition

Define picture composition What are the factors affecting picture composition. Elaborate on each factor Describe the basic lines present in a composition

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd