def perturbAction(self, action): """ :param action: current action :return action_pert: perturbed action """ #MTE if self.MTE == True: if (self.tk == self.tk_mte) and (self.n_mte < self.max_mte): self.n_mte += 1 pr = np_uniform(0., 1.) if (pr < self.pr_MTE) and (self.tk < self.NSTEPS - 2): self.tk_mte += 1 return array([0., 0., 0.]) #Modulus error du_norm = np_normal(1., self.sigma_u_norm) np.clip(du_norm, 1. - 10. * self.sigma_u_norm, 1. + 10. * self.sigma_u_norm) #Rotation error du_rot = np_normal(0., self.sigma_u_rot, 3) np.clip(du_rot, -3. * self.sigma_u_rot, 3. * self.sigma_u_rot) #Rotation matrix Arot = array([[1., -du_rot[2], du_rot[1]], [du_rot[2], 1., -du_rot[0]], [-du_rot[1], du_rot[0], 1.]]) #Perturbed action action_pert = du_norm * (Arot.dot(action)) return action_pert
def stateErrors(self): """ :return drk, dvk: errors on position (km), and velocity (km/s) at step tk """ #Position error drk = np_normal(0., self.sigma_r, 3) #Velocity error dvk = np_normal(0., self.sigma_v, 3) return drk, dvk
def decide_weight(self): return self.J/self.conection_count/self.prob + np_normal(0.0, 0.01)
def decide_weight(self): return np_normal(self.J/self.conection_count, self.sigma/self.conection_count)