Пример #1
0
def test_up_cast_out2(specialized_domain, general_domain, action):
    cast = autocast(func_out2, specialized_domain, general_domain)
    assert cast(action) == {'agent': [action]}
Пример #2
0
def test_up_cast_out1(specialized_domain, general_domain, state):
    cast = autocast(func_out1, specialized_domain, general_domain)
    assert cast(state) == Memory([state])
Пример #3
0
def test_down_cast_out2(general_domain, specialized_domain, action):
    cast = autocast(func_out2, general_domain, specialized_domain)
    assert cast({'agent': [action]}) == action
Пример #4
0
def test_down_cast_out1(general_domain, specialized_domain, state):
    cast = autocast(func_out1, general_domain, specialized_domain)
    assert cast(Memory([state])) == state
Пример #5
0
def test_up_cast_in(specialized_domain, general_domain, state, action):
    cast = autocast(func_in, specialized_domain, general_domain)
    assert cast(Memory([state]), {'agent': [action]}) == (state, action)
Пример #6
0
def test_down_cast_in(general_domain, specialized_domain, state, action):
    cast = autocast(func_in, general_domain, specialized_domain)
    assert cast(state, action) == (Memory([state]), {"agent": [action]})