def test_env_fts_int_actions(): """Env FTS actions must become 1 int var in GR(1). """ env = env_fts_2_states() env.actions_must='mutex' env.actions.add('stop') spec = synth.env_to_spec( env, ignore_initial=False, bool_states=False, action_vars=('eact', 'act'), bool_actions=False ) assert('park' not in spec.env_vars) assert('go' not in spec.env_vars) assert('stop' not in spec.env_vars) assert('sys_actions' not in spec.env_vars) assert('env_actions' in spec.env_vars) print spec.env_vars['env_actions'] assert(set(spec.env_vars['env_actions']) == {'park', 'go', 'stop', 'env_actionsnone'})
def test_env_ofts_int_actions(): """Env OpenFTS actions must become 1 int var in GR(1).""" env = env_ofts_int_actions() env.sys_actions_must = 'mutex' spec = synth.env_to_spec(env, ignore_initial=False, statevar='eloc', bool_actions=False) _check_ofts_int_actions(spec)
def test_env_ofts_int_actions(): """Env OpenFTS actions must become 1 int var in GR(1).""" env = env_ofts_int_actions() env.sys_actions_must = 'mutex' spec = synth.env_to_spec( env, ignore_initial=False, statevar='eloc', bool_actions=False) _check_ofts_int_actions(spec)
def test_env_ofts_int_actions(): """Env OpenFTS actions must become 1 int var in GR(1).""" env = env_ofts_int_actions() env.sys_actions_must = 'mutex' # there exists an env deadend, hence the warning with pytest.warns(UserWarning): spec = synth.env_to_spec( env, ignore_initial=False, statevar='eloc', bool_actions=False) _check_ofts_int_actions(spec)
def test_env_ofts_bool_actions(): """Env OpenFTS has 2 actions, bools requested. """ env = env_ofts_int_actions() env.env_actions_must = 'mutex' env.env_actions.remove('stop') env.sys_actions.remove('hover') spec = synth.env_to_spec(env, ignore_initial=False, statevar='eloc', bool_actions=True) _check_ofts_bool_actions(spec)
def test_env_ofts_bool_actions(): """Env OpenFTS has 2 actions, bools requested. """ env = env_ofts_int_actions() env.env_actions_must = 'mutex' env.env_actions.remove('stop') env.sys_actions.remove('hover') # there exists an env deadend, hence the warning with pytest.warns(UserWarning): spec = synth.env_to_spec( env, ignore_initial=False, statevar='eloc', bool_actions=True) _check_ofts_bool_actions(spec)
def test_env_ofts_int_actions(): """Env OpenFTS actions must become 1 int var in GR(1). """ env = env_ofts_int_actions() env.actions_must='mutex' spec = synth.env_to_spec( env, ignore_initial=False, bool_states=False, action_vars=('eact', 'act'), bool_actions=False ) _check_ofts_int_actions(spec)
def test_env_ofts_bool_actions(): """Env OpenFTS has 2 actions, bools requested. """ env = env_ofts_int_actions() env.env_actions_must = 'mutex' env.env_actions.remove('stop') env.sys_actions.remove('hover') spec = synth.env_to_spec( env, ignore_initial=False, statevar='eloc', bool_actions=True ) _check_ofts_bool_actions(spec)
def test_env_fts_bool_actions(): """Env FTS has 2 actions, bools requested.""" env = env_fts_2_states() env.env_actions_must = 'mutex' # there exists an env deadend, hence the warning with pytest.warns(UserWarning): spec = synth.env_to_spec( env, ignore_initial=False, statevar='eloc', bool_actions=True) assert 'sys_actions' not in spec.env_vars assert 'env_actions' not in spec.env_vars assert 'park' in spec.env_vars assert spec.env_vars['park'] == 'boolean' assert 'go' in spec.env_vars assert spec.env_vars['go'] == 'boolean'
def test_env_fts_int_states(): """Env FTS has 3 states, must become 1 int var in GR(1). """ env = env_fts_2_states() env.env_actions_must = 'mutex' env.states.add('e2') spec = synth.env_to_spec(env, ignore_initial=False, statevar='eloc', bool_actions=False) assert 'e0' not in spec.env_vars assert 'e1' not in spec.env_vars assert 'e2' not in spec.env_vars assert 'loc' not in spec.env_vars assert 'eloc' in spec.env_vars print(spec.env_vars['eloc']) assert sorted(spec.env_vars['eloc']) == ['e0', 'e1', 'e2']
def test_env_fts_bool_actions(): """Env FTS has 2 actions, bools requested.""" env = env_fts_2_states() env.env_actions_must = 'mutex' spec = synth.env_to_spec( env, ignore_initial=False, statevar='eloc', bool_actions=True, ) assert 'sys_actions' not in spec.env_vars assert 'env_actions' not in spec.env_vars assert 'park' in spec.env_vars assert spec.env_vars['park'] == 'boolean' assert 'go' in spec.env_vars assert spec.env_vars['go'] == 'boolean'
def test_env_fts_int_states(): """Env FTS has 3 states, must become 1 int var in GR(1). """ env = env_fts_2_states() env.env_actions_must = 'mutex' env.states.add('e2') # there exists an env deadend, hence the warning with pytest.warns(UserWarning): spec = synth.env_to_spec( env, ignore_initial=False, statevar='eloc', bool_actions=False) assert 'e0' not in spec.env_vars assert 'e1' not in spec.env_vars assert 'e2' not in spec.env_vars assert 'loc' not in spec.env_vars assert 'eloc' in spec.env_vars print(spec.env_vars['eloc']) assert sorted(spec.env_vars['eloc']) == ['e0', 'e1', 'e2']
def test_env_fts_bool_actions(): """Env FTS has 2 actions, bools requested. """ env = env_fts_2_states() env.actions_must='mutex' spec = synth.env_to_spec( env, ignore_initial=False, bool_states=False, action_vars=('eact', 'act'), bool_actions=True, ) assert('sys_actions' not in spec.env_vars) assert('env_actions' not in spec.env_vars) assert('park' in spec.env_vars) assert(spec.env_vars['park'] == 'boolean') assert('go' in spec.env_vars) assert(spec.env_vars['go'] == 'boolean')
def test_env_fts_int_states(): """Env FTS has 3 states, must become 1 int var in GR(1). """ env = env_fts_2_states() env.actions_must='mutex' env.states.add('e2') spec = synth.env_to_spec( env, ignore_initial=False, bool_states=False, action_vars=('eact', 'act'), bool_actions=False ) assert('e0' not in spec.env_vars) assert('e1' not in spec.env_vars) assert('e2' not in spec.env_vars) assert('loc' not in spec.env_vars) assert('eloc' in spec.env_vars) assert(spec.env_vars['eloc'] == (0, 2))
def test_env_fts_bool_states(): """Env FTS has 2 states, must become 2 bool vars in GR(1). """ env = env_fts_2_states() env.actions_must = 'mutex' spec = synth.env_to_spec( env, ignore_initial=False, bool_states=False, action_vars=('eact', 'act'), bool_actions=False ) assert('loc' not in spec.env_vars) assert('eloc' not in spec.env_vars) assert('e0' in spec.env_vars) assert(spec.env_vars['e0'] == 'boolean') assert('e1' in spec.env_vars) assert(spec.env_vars['e1'] == 'boolean')
def test_env_fts_int_states(): """Env FTS has 3 states, must become 1 int var in GR(1). """ env = env_fts_2_states() env.env_actions_must = 'mutex' env.states.add('e2') spec = synth.env_to_spec( env, ignore_initial=False, statevar='eloc', bool_actions=False ) assert 'e0' not in spec.env_vars assert 'e1' not in spec.env_vars assert 'e2' not in spec.env_vars assert 'loc' not in spec.env_vars assert 'eloc' in spec.env_vars print(spec.env_vars['eloc']) assert sorted(spec.env_vars['eloc']) == ['e0', 'e1', 'e2']
def test_env_fts_int_actions(): """Env FTS actions must become 1 int var in GR(1). """ env = env_fts_2_states() env.env_actions_must = 'mutex' env.env_actions.add('stop') # there exists an env deadend, hence the warning with pytest.warns(UserWarning): spec = synth.env_to_spec( env, ignore_initial=False, statevar='eloc', bool_actions=False) assert 'park' not in spec.env_vars assert 'go' not in spec.env_vars assert 'stop' not in spec.env_vars assert 'sys_actions' not in spec.env_vars assert 'env_actions' in spec.env_vars print(spec.env_vars['env_actions']) assert (set(spec.env_vars['env_actions']) == {'park', 'go', 'stop', 'env_actionsnone'})
def test_env_fts_int_actions(): """Env FTS actions must become 1 int var in GR(1). """ env = env_fts_2_states() env.env_actions_must = 'mutex' env.env_actions.add('stop') spec = synth.env_to_spec(env, ignore_initial=False, statevar='eloc', bool_actions=False) assert 'park' not in spec.env_vars assert 'go' not in spec.env_vars assert 'stop' not in spec.env_vars assert 'sys_actions' not in spec.env_vars assert 'env_actions' in spec.env_vars print spec.env_vars['env_actions'] assert (set(spec.env_vars['env_actions']) == { 'park', 'go', 'stop', 'env_actionsnone' })
def test_env_fts_int_actions(): """Env FTS actions must become 1 int var in GR(1). """ env = env_fts_2_states() env.env_actions_must = 'mutex' env.env_actions.add('stop') spec = synth.env_to_spec( env, ignore_initial=False, statevar='eloc', bool_actions=False ) assert 'park' not in spec.env_vars assert 'go' not in spec.env_vars assert 'stop' not in spec.env_vars assert 'sys_actions' not in spec.env_vars assert 'env_actions' in spec.env_vars print(spec.env_vars['env_actions']) assert (set(spec.env_vars['env_actions']) == {'park', 'go', 'stop', 'env_actionsnone'})