def consider_down(state: SimulatorState) -> bool: current_floor = state.get_elevator_floor() floors = state.get_floors() for i in range(current_floor): if len(floors[i]) > 0: return True return False
def assert_elevator_location(self, simulator_state:SimulatorState, elevator_floor): self.assertEqual(simulator_state.get_elevator_floor(), elevator_floor)
def __init__(self, initial_state:SimulatorState): self.floors = Floors(initial_state.floors) self.elevator = Elevator(initial_state.get_elevator_floor())