def __init__(self, thread_index): Environment.__init__(self) self.thread_index = thread_index self.max_step = 100 self.control_points_per_step = 5 self.mean_seconds_per_step = 0.1 # in average, a step every n seconds self.horizon_distance = 1 # meters self.max_distance_to_path = 0.1 # meters # obstacles related stuff self.max_obstacle_count = 3 self.min_obstacle_radius = 0.15 # meters self.max_obstacle_radius = 0.45 # meters # information about speed parameters: http://www.ijtte.com/uploads/2012-10-01/5ebd8343-9b9c-b1d4IJTTE%20vol2%20no3%20%287%29.pdf self.min_speed = 0.1 # m/s self.max_speed = 1.4 # m/s self.speed_lower_limit = 0.7 # m/s # used together with max_speed to get the random speed upper limit self.max_speed_noise = 0.25 # m/s # the fastest car has max_acceleration 9.25 m/s (https://en.wikipedia.org/wiki/List_of_fastest_production_cars_by_acceleration) # the slowest car has max_acceleration 0.7 m/s (http://automdb.com/max_acceleration) self.max_acceleration = 0.7 # m/s self.max_steering_degree = 30 self.max_steering_noise_degree = 2 self.max_steering_angle = convert_degree_to_radiant( self.max_steering_degree) self.max_steering_noise_angle = convert_degree_to_radiant( self.max_steering_noise_degree) # splines related stuff self.spline_number = 2 self.control_points_per_spline = 50 # evaluator stuff self.episodes = deque() # shapes self.state_shape = self.get_state_shape() self.action_shape = self.get_action_shape()
def __init__(self, env_name, process_idx): Environment.__init__(self) self.last_state = [] self.last_action = [] self.last_reward = [] self.env = env_vrep.Simu_env(20000 + process_idx) self.env.connect_vrep() # self.conn, child_conn = Pipe() # self.proc = Process(target=worker, args=(child_conn, env_name, process_idx)) # self.proc.start() # self.conn.recv() self.reset()
def __init__(self): Environment.__init__(self)