Automated Vehicle (AV) agents¶
- class routerl.environment.MachineAgent(id, start_time, origin, destination, params, action_space_size)[source]
A class that models Autonomous Vehicles (AVs), focusing on their learning mechanisms and decision-making processes for selecting optimal routes.
- Parameters:
id (int) – The id of the agent.
start_time (float) – The start time of the agent.
origin (float) – The origin of the agent.
destination (float) – The destination value of the agent.
params (dict) – The parameters of the machine agent as specified in here.
action_space_size (int) – The size of the action space of the agent.
- act(_) None [source]
Deprecated
- Parameters:
_ (Any) – The current state of the agent.
- Returns:
None
- get_reward(observation: list[dict]) float [source]
This method calculated the reward of each individual agent, based on the travel time of the agent, the group of agents, the other agents, and all agents, weighted according to the agent’s behavior.
- Parameters:
observation (list[dict]) – The current observation of the agent.
- Returns:
float – The reward of the agent.
- get_state(observation: list[dict]) list[int] [source]
Generates the current state representation based on recent observations of agents navigating from the same origin to the same destination.
- Parameters:
observation (list[dict]) – The recent observations of the agent.
- Returns:
list[int] – The current state representation.
- property last_reward: float
Set the last reward of the agent.
- Returns:
float – The last reward of the agent.
- learn(_) None [source]
Deprecated
- Parameters:
_ (Any) – The current state of the agent.
- Returns:
None