Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hughway-env mistakes #641

Open
xss1006 opened this issue Dec 4, 2024 · 1 comment
Open

hughway-env mistakes #641

xss1006 opened this issue Dec 4, 2024 · 1 comment

Comments

@xss1006
Copy link

xss1006 commented Dec 4, 2024

When I try to use the highway-env scene for training, I get this error, but I haven't found a suitable solution. My code is as follows,AttributeError: 'OrderEnforcing' object has no attribute 'configure'
def init(self, seed=None):
# self.env = gym.make("highway-v0")
self.env = gym.make('highway-v0')
config= {
'observation': {"type": "Kinematics",
"vehicles_count": 21,
"features": ["presence", "x", "y", "vx", "vy", "cos_h", "sin_h"],
"absolute": True,
"order": "sorted"
},
'action': {'type': 'ContinuousAction',
'acceleration_range': (-4, 4.0)},
'simulation_frequency': 35,
'policy_frequency': 5,
'other_vehicles_type': 'highway_env.vehicle.behavior.IDMVehicle',
'screen_width': 600,
'screen_height': 150,
'centering_position': [0.3, 0.5],
'scaling': 5.5,
'show_trajectories': False,
'render_agent': True,
'offscreen_rendering': False,
'manual_control': False,
'real_time_rendering': False,
'lanes_count': 4,
"lane_change_reward": 0.8,
'controlled_vehicles': 1,
'initial_lane_id': None,
'duration': 60,
'ego_spacing': 2,
'vehicles_density': 1,
'collision_reward': -1,
'reward_speed_range': [20, 30],
'offroad_terminal': True
}
self.env.configure(config)

@eleurent
Copy link
Collaborator

eleurent commented Dec 8, 2024

You can replace the call to configure by env = gym.make('highway-v0', config=config).
I'll update the docs accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants