void postRiderEvent(int event, int floor, int elevator) {
		int direction = dirNeither;
		if (elevator != -1) {
			Lib.assertTrue(elevator >= 0 && elevator < numElevators);
			direction = elevators[elevator].direction;
		}

		RiderEvent e = new RiderEvent(event, floor, elevator, direction);
		for (int i = 0; i < numRiders; i++) {
			RiderState rider = riders[i];
			if ((rider.inElevator && rider.elevator == e.elevator)
					|| (!rider.inElevator && rider.floor == e.floor)) {
				rider.events.add(e);
				rider.schedule(1);
			}
		}
	}