<commit_before>from cistar.envs.loop import LoopEnvironment

from rllab.spaces import Box

import traci

import numpy as np



class SimpleVelocityEnvironment(LoopEnvironment):

    @property
    def action_space(self):
        return Box(low=0, high=15, shape=(self.num_rl_vehicles,))

    @property
    def observation_space(self):
        return Box(low=-np.inf, high=np.inf, shape=(self.num_vehicles,))

    def compute_reward(self, velocity):
        return -np.linalg.norm(velocity - self.env_params["target_velocity"])

    def getState(self):
        return np.array([self.vehicles[vehicle]["speed"] for vehicle in self.vehicles])

    def apply_action(self, car_id, action):
        '''Action is an acceleration here. Gets locally linearized to find velocity.'''
        traci.vehicle.slowDown(car_id, action, 1)

    def render(self):
        pass<commit_msg>testing tests<commit_after>from cistar.envs.loop import LoopEnvironment

from rllab.spaces import Box

import traci

import numpy as np



class SimpleVelocityEnvironment(LoopEnvironment):

    @property
    def action_space(self):
        return Box(low=0, high=13, shape=(self.num_rl_vehicles,))

    @property
    def observation_space(self):
        return Box(low=-np.inf, high=np.inf, shape=(self.num_vehicles,))

    def compute_reward(self, velocity):
        return -np.linalg.norm(velocity - self.env_params["target_velocity"])

    def getState(self):
        return np.array([self.vehicles[vehicle]["speed"] for vehicle in self.vehicles])

    def apply_action(self, car_id, action):
        '''Action is an acceleration here. Gets locally linearized to find velocity.'''
        traci.vehicle.slowDown(car_id, action, 1)

    def render(self):
        pass
{'fraction_non_alphanumeric': 0.1093210586881473, 'fraction_numerical': 0.004602991944764097, 'mean_word_length': 3.674731182795699, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5028401', 'n_tokens_mistral': 558, 'n_tokens_neox': 519, 'n_words': 130}