Core Package
l2r.core.controller
l2r.core.templates
Note
The templates module provides useful abstract classes which we recommend using for compatability with the RacingEnv.
- class l2r.core.templates.AbstractAgent(*args, **kwargs)[source]
Bases:
abc.ABC
Abstract agent class. A potentially useful template for racing agents.
- class l2r.core.templates.AbstractInterface(*args, **kwargs)[source]
Bases:
abc.ABC
Abstract simulator interface to receive data from the simulator.
- class l2r.core.templates.AbstractReward(*args, **kwargs)[source]
Bases:
abc.ABC
Abstract reward class. It is recommended that new reward policies follow this template so that they are compatible with the RacingEnv.
- abstract get_reward(state, **kwargs)[source]
Return the reward for the provided state.
- Parameters
state (varies) – the current environment state
- set_track(inside_path, outside_path, centre_path, car_dims)[source]
Store the track and vehicle information as class variables. This is useful for evaluating the reward based on the position of the vehicle.
- Parameters
inside_path (matplotlib.Path) – ENU coordinates of the inside track boundary
outside_path (matplotlib.Path) – ENU coordinates of the outside track boundary
centre_path (matplotlib.Path) – ENU coordinates of the track’s centerline
car_dims (list) – dimensions of the vehicle in meters: [length, width]