Example #1
0
 def get_aeb_info(cls, spec):
     '''
     Get from spec the aeb_list, aeb_shape and aeb_sig, which are used to resolve agent_space and env_space.
     @returns {list, (a,e,b), array([a, e, b])} aeb_list, aeb_shape, aeb_sig
     '''
     aeb_list = spec_util.resolve_aeb(spec)
     aeb_shape = util.get_aeb_shape(aeb_list)
     aeb_sig = np.full(aeb_shape, np.nan)
     for aeb in aeb_list:
         aeb_sig.itemset(aeb, 1)
     return aeb_list, aeb_shape, aeb_sig
Example #2
0
 def get_aeb_info(cls, spec):
     '''
     Get from spec the aeb_list, aeb_shape and aeb_sig, which are used to resolve agent_space and env_space.
     @returns {list, (a,e,b), array([a, e, b])} aeb_list, aeb_shape, aeb_sig
     '''
     aeb_list = spec_util.resolve_aeb(spec)
     aeb_shape = util.get_aeb_shape(aeb_list)
     aeb_sig = np.full(aeb_shape, np.nan)
     for aeb in aeb_list:
         aeb_sig.itemset(aeb, 1)
     return aeb_list, aeb_shape, aeb_sig
Example #3
0
def test_resolve_aeb(spec_name, aeb_list):
    spec = spec_util.get('base.json', spec_name)
    resolved_aeb_list = spec_util.resolve_aeb(spec)
    assert resolved_aeb_list == aeb_list
Example #4
0
def test_resolve_aeb(spec_name, aeb_list):
    spec = spec_util.get('base.json', spec_name)
    resolved_aeb_list = spec_util.resolve_aeb(spec)
    assert resolved_aeb_list == aeb_list