77ea67e58154f02617cda121847158973eb19700,cistar-dev/cistar/envs/lane_changing.py,SimpleLaneChangingAccelerationEnvironment,compute_reward,#SimpleLaneChangingAccelerationEnvironment#Any#Any#,63

Before Change


        
        See parent class
        
        return -np.linalg.norm(velocity - self.env_params["target_velocity"])

    def getState(self):
        
       See parent class

After Change


        See parent class
        
        // upper bound used to ensure the reward is always positive
        max_cost = np.array([self.env_params["target_velocity"]]*self.scenario.num_vehicles)
        max_cost = np.linalg.norm(max_cost)

        // cost associated with being away from target velocity
        // if the vehicle"s velocity is more than twice the target velocity, the cost does not become worse
        cost = velocity - self.env_params["target_velocity"]
        cost = np.linalg.norm(cost)

        ////////////////////////////////////////////////////////////////////////////////////////////
        if any(velocity < 0):
            print("------------------------------")
            print(velocity)
            print(np.array(self.rl_ids)[np.array(velocity) < 0])
            print("------------------------------")
        ////////////////////////////////////////////////////////////////////////////////////////////

        return max_cost - cost

        // return np.linalg.norm(np.array([0]*len(velocity)) - np.array([50]*len(velocity))) - \
        //     np.linalg.norm(velocity - self.env_params["target_velocity"])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 21

Instances


Project Name: flow-project/flow
Commit Name: 77ea67e58154f02617cda121847158973eb19700
Time: 2017-05-22
Author: akreidieh@gmail.com
File Name: cistar-dev/cistar/envs/lane_changing.py
Class Name: SimpleLaneChangingAccelerationEnvironment
Method Name: compute_reward


Project Name: flow-project/flow
Commit Name: 51db8e1776ea90ebe5995e9963b7ca30d0b268c5
Time: 2017-05-23
Author: eugenevinitsky@Eugenes-MacBook-Pro.local
File Name: cistar-dev/cistar/envs/loop_emission.py
Class Name: SimpleEmissionEnvironment
Method Name: compute_reward


Project Name: flow-project/flow
Commit Name: 9339457b4de4f40b6b958b32ea5ec3488070cf75
Time: 2017-05-22
Author: eugenevinitsky@airbears2-10-142-37-6.airbears2.1918.berkeley.edu
File Name: cistar-dev/cistar/envs/lane_changing.py
Class Name: SimpleLaneChangingAccelerationEnvironment
Method Name: compute_reward


Project Name: flow-project/flow
Commit Name: 77ea67e58154f02617cda121847158973eb19700
Time: 2017-05-22
Author: akreidieh@gmail.com
File Name: cistar-dev/cistar/envs/lane_changing.py
Class Name: SimpleLaneChangingAccelerationEnvironment
Method Name: compute_reward