all.bodies
- class all.bodies.Body(agent)
Bases:
Agent
A Body wraps a reinforcement learning Agent, altering its inputs and outputs.
The Body API is identical to the Agent API from the perspective of the rest of the system. This base class is provided only for semantic clarity.
- act(state)
Select an action for the current timestep and update internal parameters.
In general, a reinforcement learning agent does several things during a timestep: 1. Choose an action, 2. Compute the TD error from the previous time step 3. Update the value function and/or policy The order of these steps differs depending on the agent. This method allows the agent to do whatever is necessary for itself on a given timestep. However, the agent must ultimately return an action.
- Parameters:
state (all.environment.State) – The environment state at the current timestep.
- Returns:
The action to take at the current timestep.
- Return type:
torch.Tensor
- property agent
- eval(state)
- process_action(action)
- process_state(state)