1#ifndef MULTI_ROBOT_NAVIGATION_H
2#define MULTI_ROBOT_NAVIGATION_H
10#include <unordered_map>
64 const std::unordered_map<std::string, std::any> &
make_options,
65 const std::unordered_map<std::string, std::any> &reset_options)
override;
78 const std::vector<RobotPose> &
poses() const noexcept {
return poses_; }
80 const std::vector<std::array<real_t, 2>> &
goals() const noexcept {
return goals_; }
85 const std::vector<std::array<real_t, 2>> &
velocities() const noexcept {
return velocities_; }
116 std::vector<real_t> observe_(
uint_t robot)
const;
118 real_t closest_pair_()
const;
120 std::vector<RobotPose> poses_;
121 std::vector<std::array<real_t, 2>> goals_;
122 std::vector<std::array<real_t, 2>> velocities_;
123 std::vector<bool> dones_;
124 real_t circle_radius_{2.0};
125 real_t robot_radius_{0.15};
126 real_t goal_tolerance_{0.1};
130 real_t progress_weight_{1.0};
131 real_t time_reward_{-0.01};
132 real_t collision_reward_{-1.0};
133 real_t goal_reward_{10.0};
136 real_t min_separation_{0.0};
std::string version() const noexcept
Definition multi_agent_env_base.h:90
MultiAgentEnvBase(const std::string &name)
Definition multi_agent_env_base.h:110
uint_t n_agents() const noexcept
Definition multi_agent_env_base.h:79
const std::unordered_map< std::string, std::any > & make_options() const noexcept
Definition multi_agent_env_base.h:104
time_step_type reset()
Definition multi_agent_env_base.h:62
std::vector< action_type > joint_action_type
Definition multi_agent_env_base.h:43
MultiAgentTimeStep< std::vector< real_t > > time_step_type
Definition multi_agent_env_base.h:38
real_t max_w() const noexcept
Definition multi_robot_navigation.h:95
real_t robot_radius() const noexcept
Definition multi_robot_navigation.h:87
void make(const std::string &version, const std::unordered_map< std::string, std::any > &make_options, const std::unordered_map< std::string, std::any > &reset_options) override
Build the environment.
MultiAgentEnvBase< std::vector< real_t >, std::array< real_t, 2 > > base_type
Definition multi_robot_navigation.h:57
real_t min_separation() const noexcept
The smallest distance between the centres of two robots in the current episode.
Definition multi_robot_navigation.h:110
base_type::time_step_type time_step_type
Definition multi_robot_navigation.h:58
const std::vector< std::array< real_t, 2 > > & velocities() const noexcept
The velocity {vx, vy} of every robot in the last step.
Definition multi_robot_navigation.h:85
base_type::joint_action_type joint_action_type
Definition multi_robot_navigation.h:59
real_t dt() const noexcept
Definition multi_robot_navigation.h:91
real_t circle_radius() const noexcept
Definition multi_robot_navigation.h:89
real_t distance_to_goal(uint_t robot) const
The distance of robot to its goal.
time_step_type step(const joint_action_type &actions) override
Apply one action per agent.
time_step_type reset(uint_t seed) override
Start a new episode with the given seed.
uint_t observation_size() const noexcept
The size of the observation of one robot.
Definition multi_robot_navigation.h:76
real_t max_v() const noexcept
Definition multi_robot_navigation.h:93
const std::vector< RobotPose > & poses() const noexcept
Definition multi_robot_navigation.h:78
uint_t n_collisions() const noexcept
The moves cancelled by collisions in the current episode.
Definition multi_robot_navigation.h:105
const std::vector< std::array< real_t, 2 > > & goals() const noexcept
Definition multi_robot_navigation.h:80
Definition distributed_agent_env.h:19
Various utilities used when working with RL problems.
Definition bitrl_log.h:25
TimeStepTp
The TimeStepTp enum.
Definition time_step_type.h:15
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20
The pose of a robot of MultiRobotNavigation: position and heading.
Definition multi_robot_navigation.h:22
real_t x
Definition multi_robot_navigation.h:23
real_t theta
Definition multi_robot_navigation.h:25
real_t y
Definition multi_robot_navigation.h:24