• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Assignment about elevators

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
So I did not start working on this assignment, but I'm having a hard time planning it out.
So the assignment is to program the elevator system (2 coordinated elevators) of a 10 floor apartment.
Can someone give me a general tip on how should i make it?
 
Marshal
Posts: 81615
593
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We don't give out complete solutions, but please show us what you have achieved so far.
 
Aron Gaspar
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:We don't give out complete solutions, but please show us what you have achieved so far.


Oh I am not asking for complete solutions. Just a general idea of with which tools and how should i start working on it.
I am not at home but I will insert it here when i start working on it
 
Bartender
Posts: 11188
89
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, some solutions would be terrible and some would be great. What criteria is going to be used to judge the success of your assignment?

Can you come up with a list of rules that will govern your elevators?
 
Aron Gaspar
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carey Brown wrote:Well, some solutions would be terrible and some would be great. What criteria is going to be used to judge the success of your assignment?

Can you come up with a list of rules that will govern your elevators?


The teacher did not state any specifics except the number of elevators and the floors. That is one reason why am I stuck at how to build it up. He also said the more complex but efficient it is, the better will be the results.
 
Carey Brown
Bartender
Posts: 11188
89
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm assuming "results" has something to do with the "time" it takes to get various passengers to their destinations. So far there are too many unknowns beyond the algorithm that you choose.

Are the speeds of the elevators specified? Do you take acceleration and deceleration into account? The distance between floors?
 
Aron Gaspar
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carey Brown wrote:I'm assuming "results" has something to do with the "time" it takes to get various passengers to their destinations. So far there are too many unknowns beyond the algorithm that you choose.

Are the speeds of the elevators specified? Do you take acceleration and deceleration into account? The distance between floors?


i was thinking about 40 miles per hour at max speed. I will also add an emergency stop with instant stop. Acceleration and Deceleration would be logical and cool, but i really have no idea how to implement that. I think each floor will be 14 ft.
 
Carey Brown
Bartender
Posts: 11188
89
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Emergency stop"? Didn't think of that. Is that a requirement?
 
Campbell Ritchie
Marshal
Posts: 81615
593
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is probably simpler if you guess that the lefts will move at a constant speed, and add a few seconds per stop to allow for acceleration. But check what the requirements say.
 
Carey Brown
Bartender
Posts: 11188
89
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can a door be held open when it is at a stop?
 
Aron Gaspar
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carey Brown wrote:Can a door be held open when it is at a stop?


Hmm I did not think about that. This is getting more and more complicated. I'm not sure I could solve that though.

Carey Brown wrote:"Emergency stop"? Didn't think of that. Is that a requirement?


Nope, I just wanted to add as I can implement it and it adds to the depth of the whole assignment.
 
Carey Brown
Bartender
Posts: 11188
89
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What kind of user interface or API are you supposed to provide?
 
Marshal
Posts: 6209
501
IntelliJ IDE Python TypeScript Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You say this is an assignment but you don't say what level of programming your class is for. The reason I ask is because it will give us an idea of how elaborate your solution is expected to be. For example taking into consideration lift speed in mph, acceleration, deceleration, emergency stop, holding doors open, etc etc each add extraordinary complexity to your system and make it very difficult to complete. I'm going to make an assumption that this is an introductory or maybe second year programming module?

If so then I'd recommend simplifying things as much as possible and model time in steps and your elevator as a sequence of states where the transition from one state to another takes 1 step of time. For example: Given elevators A and B and floors 1 to 10

TimeActionElevator AElevator B
0Call to level 311
1Call to level 412
223
3Elevator B occupant selects 233
442
5Elevator A occupant selects 342
632

In this example I have made up some rules:
  • Elevators move 1 floor per time step
  • Occupants take 1 time step to enter elevator and select a floor

  • Your rules may be different but this is how I would start thinking about it.
     
    You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
    Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
    https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic