Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

People not getting on elevator #18

Closed
aonsager opened this issue Jan 23, 2015 · 6 comments
Closed

People not getting on elevator #18

aonsager opened this issue Jan 23, 2015 · 6 comments
Labels

Comments

@aonsager
Copy link

It seems like there are certain cases where people will not get on elevators.

This is the simplest way to reproduce it that I've found:

{
    init: function(elevators, floors) {
        var elevator = elevators[0]; // Let's use the first elevator
        elevator.on("idle", function() {
            // The elevator is idle, so let's go to all the floors (or did we forget one?)

        });
    },
    update: function(dt, elevators, floors) {
        // We normally don't need to do anything here
    }
}

Adding elevator.goToFloor(0); to the idle event will make them get on.

@magwo magwo added the bug label Jan 23, 2015
@magwo
Copy link
Owner

magwo commented Jan 23, 2015

I noticed it too. I think it's because the users (passengers) will only enter an elevator upon the "entrance_available" event emitted by elevators. This event is triggered when an elevator "arrives" on a floor, not necessarily from another floor. So if the elevator is just standing still on a floor, it doesn't emit any events, and the user doesn't get on. Not sure how to best solve it.

@lakario
Copy link

lakario commented Jan 23, 2015

My solution calls goToFloor(), regardless of whether or not the elevator is currently on that floor (assuming that it's not already going there). This approach seems to prevent any idle elevators.

@g-p-g
Copy link

g-p-g commented Jan 23, 2015

I didn't notice this yesterday, now I do. Maybe the elevator is not opening its door and that's why people don't get in? :)

SignpostMarv added a commit to SignpostMarv/elevatorsaga that referenced this issue Jan 24, 2015
@qiuzuhui
Copy link

+1
and elevator indicator is wrong ?
elevator.js: line:220
elevator.trigger("indicatorstate_change", {up: elevator.goingDownIndicator, down: elevator.goingUpIndicator})

@roryokane
Copy link
Contributor

@qiuzuhui That separate bug about the elevator indicators has been fixed in #32.

@magwo
Copy link
Owner

magwo commented Jan 27, 2015

6ce62a1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants