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

  Bullhow might swot and pest value chain analysis

bullhow might swot and pest value chain analysis statistical data methodologies and other research processes used to

  Question 1a audiovisual production involves both

question 1a audiovisual production involves both imagination and technique. discussb there are basically five stages in

  Publishing and marketing plan a website

Without a publishing and marketing plan a website does not help the client to generate business. Your task in this part of the project is to think of a publishing and marketing plan for your website

  How to work on datasturetur assignment how to work on

how to work on datasturetur assignment how to work on datasturetur assignment how to work on datasturetur assignment

  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..

  Choose an industry in which two or more companies has

choose an industry in which two or more companies has historically competed to maintain a significant share of the

  Website designs with exemplary design features

Identify two Web websites that you feel exhibit exemplary design features. Explain why you selected each site. What design features stand out on each website?

  Equation for tangent cubic spline using mspline and mgeom

We are given the following boundary conditions for cubic spline section: Give equation P0(u) for tangent to this curve in terms of Mspline and Mgeom.

  Briefly discuss the issues an organization would want to

briefly discuss the issues an organization would want to consider or understand if it were interested in a business

  Shadow effect while rolling a sphere

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

  Develop a five-year strategic plan with cost estimates and

develop a five-year strategic plan with cost estimates and a time line.describe the situation facing mensa at the time

  Question 1a you are working as tv producer for the national

question 1a you are working as tv producer for the national tv station in your country. as such you have been assigned

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