def calculate_heuristic(state: SimulatorState) -> int: floors = state.get_floors() total = 4 * len(floors[3]) total += 3 * len(floors[2]) total += 2 * len(floors[1]) total += len(floors[0]) return total
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_floors(self, simulator_state:SimulatorState, expected_floor_map): for (i, floor) in enumerate(simulator_state.get_floors()): self.assertCountEqual(floor, expected_floor_map[i])