def __init__(self): BaseEnv.__init__(self, **cfg.FECMRAC.env_kwargs) self.x = System() self.xr = ReferenceSystem() self.W = CMRAC() self.filter = Filter(basis=self.x.unc.basis) self.basis = self.x.unc.basis self.cmd = Command() self.logger = fym.logging.Logger(Path(cfg.dir, "fecmrac-env.h5")) self.logger.set_info(cfg=cfg)
def __init__(self): BaseEnv.__init__(self, **cfg.DoubleMRAC.env_kwargs) self.x = System() self.xr = ReferenceSystem() self.P = cfg.P self.W = CMRAC(self.P, cfg.B) self.F = BaseSystem(np.zeros_like(cfg.Wcirc.dot(cfg.Wcirc.T))) self.J = PerformanceIndex() self.cmd = Command() self.basis = self.x.unc.basis self.BTBinv = np.linalg.inv(cfg.B.T.dot(cfg.B)) self.logger = fym.logging.Logger(Path(cfg.dir, "double-mrac-env.h5")) self.logger.set_info(cfg=cfg)
def __init__(self): BaseEnv.__init__(self, **cfg.HMRAC.env_kwargs) self.x = System() self.xr = ReferenceSystem() self.P = scipy.linalg.solve_continuous_are(cfg.Am, cfg.B, cfg.Q_lyap, cfg.R) self.W = CMRAC(self.P, cfg.B) self.J = PerformanceIndex() self.cmd = Command() self.basis = self.x.unc.basis self.BTBinv = np.linalg.inv(cfg.B.T.dot(cfg.B)) self.logger = fym.logging.Logger(Path(cfg.dir, "hmrac-env.h5")) self.logger.set_info(cfg=cfg)
def __init__(self): BaseEnv.__init__(self, **cfg.ValueLearner.env_kwargs) self.x = System() self.xr = ReferenceSystem() self.P = cfg.P self.W = CMRAC(self.P, cfg.B) self.F = BaseSystem(np.zeros_like(cfg.Wcirc.dot(cfg.Wcirc.T))) self.J = PerformanceIndex() self.basis = self.x.unc.basis self.filter = ResidualFilter(basis=self.basis, B=cfg.B) self.cmd = Command() self.BTBinv = np.linalg.inv(cfg.B.T.dot(cfg.B)) self.logger = fym.logging.Logger(Path(cfg.dir, "value-learner-env.h5")) self.logger.set_info(cfg=cfg)
def __init__(self): super().__init__( { "main": BaseEnv({ "main_1": BaseSystem(np.zeros((3, 3))), "main_2": BaseSystem(np.ones(4)), }), "sub": BaseSystem([2, 2, 2]), }, dt=0.01, max_t=10)
def __init__(self): BaseEnv.__init__(self, **cfg.HMRAC.env_kwargs) self.multirotor = MultiRotor(config=cfg.multirotor_config) self.xr = ReferenceSystem() self.B = self.multirotor.Jinv.dot( self.multirotor.u_factor.dot(self.multirotor.B[1:])) self.P = scipy.linalg.solve_continuous_are(cfg.Am, self.B, cfg.Q_lyap, cfg.R) self.W = CMRAC(self.P, self.B, cfg.HMRAC.Gamma) self.What = BaseSystem(cfg.W_init) self.J = PerformanceIndex() self.filter = ResidualFilter(basis=self.basis, B=self.B) # Not BaseEnv or BaseSystem self.cmd = Command() self.wind = Wind() self.ut = self.multirotor.m * self.multirotor.g / self.multirotor.n self.BTBinv = np.linalg.inv(self.B.T.dot(self.B)) self.logger = fym.logging.Logger(Path(cfg.dir, "hmrac-env.h5")) self.logger.set_info(cfg=cfg)
"env.kwargs": dict(dt=0.01, max_t=10), "multicopter.nrotor": 6, "multicopter.m": 3., "multicopter.LQRGain": { "Q": [1, 1, 1, 1], "R": [1, 1], }, "actuator.tau": 1e-1, } cfg = parser.parse(json_dict) # ``parser.update`` cfg = parser.parse() def load_config(): parser.update( cfg, { "env.kwargs": dict(dt=0.01, max_t=10), "agent.memory_size": 1000, "agent.minibatch_size": 32, }) load_config() cfg.env.kwargs.dt = 0.001 # ``parser.decode`` cfg = parser.parse() parser.update(cfg, {"env.kwargs": dict(dt=0.01, max_t=10)}) env = BaseEnv(**parser.decode(cfg.env.kwargs))