def __init__(self, spec, data_callback=None): super().__init__(spec, data_callback) self.gamma2 = spec['composite_system']['gamma2'] self.norm_eps = spec["memory"]["norm_eps"] new_systems = { 'filter_system': FilterSystem( initial_state=spec['filter_system']['initial_state'], A=spec['reference_system']['Ar'], B=spec['main_system']['B'], tau=spec['filter_system']['tau'] ), 'filtered_phi': FilteredPhi( initial_state=spec['filtered_phi']['initial_state'], tau=spec['filter_system']['tau'], unc=self.unc ), } self.append_systems(new_systems) self.M_shape = self.systems["adaptive_system"].state_shape[:1] * 2 self.N_shape = self.systems["adaptive_system"].state_shape self.action_space = spaces.Dict({ "M": infinite_box(self.M_shape), "N": infinite_box(self.N_shape) })
def __init__(self, dt=0.01, max_t=10, rand_init=True, ode_step_len=2): self.main = aircraft.F16LinearLateral() self.aux = aircraft.F16LinearLateral() self.rand_init = rand_init self.observation_space = core.infinite_box((7, )) self.action_space = core.infinite_box((2, )) self.clock = core.Clock(dt=dt, max_t=max_t) self.t_span = np.linspace(0, dt, ode_step_len + 1) self.logging_off = True
def __init__(self, spec, data_callback=None): A = Ar = spec['reference_system']['Ar'] B = spec['main_system']['B'] Br = spec['reference_system']['Br'] self.unc = ParamUnc(initial_param=spec['main_system']['initial_param']) self.cmd = SquareCmd( length=spec["command"]["length"], phase=spec["command"]["phase"], pattern=spec["command"]["pattern"] ) self.data_callback = data_callback self.bar = None systems = { 'main_system': MainSystem( initial_state=spec['main_system']['initial_state'], A=A, B=B, Br=Br, unc=self.unc, cmd=self.cmd, ), 'reference_system': RefSystem( initial_state=spec['reference_system']['initial_state'], Ar=Ar, Br=Br, cmd=self.cmd ), 'adaptive_system': AdaptiveSystem( initial_state=spec['adaptive_system']['initial_state'], A=A, B=B, gamma1=spec['adaptive_system']['gamma1'], Q=spec['adaptive_system']['Q'], unc=self.unc ) } self.observation_space = infinite_box(( len(spec['main_system']['initial_state']) + len(spec['reference_system']['initial_state']), + len(np.ravel(spec['adaptive_system']['initial_state'])), + np.shape(Br)[1], )) self.action_space = infinite_box([]) super().__init__( systems=systems, dt=spec['environment']['time_step'], max_t=spec['environment']['final_time'], ode_step_len=spec['environment']['ode_step_len'], )
def __init__(self, spec, data_callback=None): super().__init__(spec, data_callback) self.mem_max_size = spec["memory"]["max_size"] self.norm_eps = spec["memory"]["norm_eps"] W_shape = np.shape(spec["adaptive_system"]["initial_state"]) self.phi_size = W_shape[0] self.y_size = W_shape[1] self.observation_space = infinite_box(( len(spec['main_system']['initial_state']) + len(spec['reference_system']['initial_state']) + len(np.ravel(spec['adaptive_system']['initial_state'])) + np.shape(spec["reference_system"]["Br"])[1] + self.mem_max_size * np.sum(W_shape), )) self.action_space = infinite_box((self.mem_max_size,))
def __init__(self, spec, data_callback=None): super().__init__(spec, data_callback) self.kl = spec["fecmrac"]["kl"] self.ku = spec["fecmrac"]["ku"] self.theta = spec["fecmrac"]["theta"] new_systems = { 'omega_system': MemorySystem( initial_state=np.zeros(self.M_shape), ), 'm_system': MemorySystem( initial_state=np.zeros(self.N_shape), ), } self.append_systems(new_systems) self.action_space = infinite_box((0,))