From: Robert Klemme Date: 2011-11-14T17:27:21+09:00 Subject: Re: model "lift-passengers" and concurrent programming On Sun, Nov 13, 2011 at 8:51 PM, Roman Faceless wrote: > I'm trying to write a model of an elevator with one button. Elevator can > take passengers along the way when going down. What about the way up? > But in my code some error. Because passengers press a button only when > the elevator carries passengers. And no passengers push the button when > the elevator is free. > > I took a producer-consumer model. Somehow I have the feeling I am missing information. Can you give a bit more description of the problem you are trying to solve? How do passengers decide when to enter? What's the producer and consumer? How do you record the current floor? Btw, please try to properly indent code and use empty lines to separate section. This goes a long way making your code more readable which in turn increases the likeliness to get help. :-) Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/