da03fd1bde5d2d4836e11def61d19dcc2d4c2b6b,flow/envs/two_loops_one_merging.py,TwoLoopsOneMergingEnvironment,get_state,#TwoLoopsOneMergingEnvironment#,61

Before Change


                 for veh_id in self.sorted_ids]

        // divide the values by the maximum attainable speed
        normalized_vel = np.array(vel) / max_speed

        normalized_pos = []
        for i in range(len(pos)):
            if edge[i] == 0:
                // positions of vehicles in the ring are divided by the length
                // of the ring
                normalized_pos.append(pos[i])
            elif edge[i] == 1:
                // positions of vehicles in the merge are divided by the length
                // of the merge
                normalized_pos.append(pos[i])

        state = np.array([normalized_vel, normalized_pos, edge, is_rl]).T
        return state

    def sort_by_position(self):
        
        See parent class

After Change


        positions on the edge, for each vehicle.
        
        vel = self.vehicles.get_speed(self.sorted_ids)
        pos = [self.get_x_by_id(veh_id) for veh_id in self.sorted_ids]
        // is_rl = [int(veh_id in self.rl_ids) for veh_id in self.sorted_ids]

        // // normalize the speed
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: flow-project/flow
Commit Name: da03fd1bde5d2d4836e11def61d19dcc2d4c2b6b
Time: 2018-01-01
Author: cathywu@eecs.berkeley.edu
File Name: flow/envs/two_loops_one_merging.py
Class Name: TwoLoopsOneMergingEnvironment
Method Name: get_state


Project Name: flow-project/flow
Commit Name: c18e993f595d3b82b48eb29d9e83311874b98129
Time: 2018-01-01
Author: cathywu@eecs.berkeley.edu
File Name: flow/envs/two_loops_one_merging.py
Class Name: TwoLoopsOneMergingEnvironment
Method Name: get_state


Project Name: flow-project/flow
Commit Name: dbb0ec9bb22cf76b794817feede065528507856d
Time: 2017-03-10
Author: nishantkheterpal@gmail.com
File Name: cistar-dev/cistar/controllers/base_controller.py
Class Name: BaseController
Method Name: get_safe_action