From: "Luca (Email)" Date: 2011-12-29T15:52:12+09:00 Subject: I: model "lift-passengers" and concurrent programming -----Messaggio originale----- Da: Robert Klemme [mailto:shortcutter@googlemail.com] Inviato: luned́ 14 novembre 2011 09:27 A: ruby-talk ML Oggetto: 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/ -- Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f Sponsor: Capodanno a Riccione, Pacchetto Relax: Mezza Pensione + bagno turco + solarium + massaggio. Wifi e parcheggio gratis. 2 giorni euro 199 a persona Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid978&d)-12