Beispiel #1
0
def test_reefer_positions():
    env = RoRoDeck()
    env.vehicle_data[5][4] = 1  # enable reefer for test
    env.reset()

    env.current_Lane = 0
    assert env.grid_reefer.T[env.current_Lane][-1] == 1
    assert len(env.vehicle_data.T) == len(env.get_possible_actions_of_state()) == 5

    env.current_Lane = 4
    assert env.grid_reefer.T[env.current_Lane][-1] == 0
    assert len(env.get_possible_actions_of_state()) == 4
    assert 4 not in env.get_possible_actions_of_state()
Beispiel #2
0
def test_shifts_caused():
    env = RoRoDeck()
    env.reset()

    current_lane = env.current_Lane
    env.step(0)
    env.current_Lane = current_lane
    assert env._get_number_of_shifts(1) == 1
    assert env._get_number_of_shifts(0) == 0