What a multi-agent environment returns after a reset or a joint step: an observation, a reward and a done flag for every agent.
More...
|
| | MultiAgentTimeStep ()=default |
| | MultiAgentTimeStep (TimeStepTp type, std::vector< observation_type > observations, std::vector< real_t > rewards, std::vector< bool > dones, bool truncated=false, std::unordered_map< std::string, std::any > extra={}) |
| | A time step of n agents, with every vector of size n.
|
| TimeStepTp | type () const noexcept |
| | The type of the step: FIRST after a reset, LAST once the episode is over.
|
| bool | first () const noexcept |
| bool | mid () const noexcept |
| bool | last () const noexcept |
| | Whether the episode is over.
|
| bool | truncated () const noexcept |
| | Whether the step limit ended the episode before every agent was done.
|
| uint_t | n_agents () const noexcept |
| const observation_type & | observation (uint_t agent) const |
| const std::vector< observation_type > & | observations () const noexcept |
| real_t | reward (uint_t agent) const |
| const std::vector< real_t > & | rewards () const noexcept |
| real_t | total_reward () const noexcept |
| | The sum of the rewards of the agents, the team's reward.
|
| bool | done (uint_t agent) const |
| const std::vector< bool > & | dones () const noexcept |
| const std::unordered_map< std::string, std::any > & | extra () const noexcept |
| | Anything else the environment reports, collisions for example.
|
| template<typename T> |
| T | get_extra (const std::string &name) const |
| | Read an entry of extra().
|
template<typename ObservationType>
class bitrl::envs::multi_agent::MultiAgentTimeStep< ObservationType >
What a multi-agent environment returns after a reset or a joint step: an observation, a reward and a done flag for every agent.
An agent is done when it finished its own task, a robot that reached its goal for example; the environment ignores its actions from then on. The episode is over, last(), when every agent is done, or when the environment stopped it at its step limit, truncated(). Agents are numbered 0, 1, ..., n_agents() - 1 in every vector.