File BasicTaskAssigner.h#

Definition (server/inc/task_assigners/BasicTaskAssigner.h)#

Includes#

  • heuristics/BasicHeuristicTable.h

  • utils/SMARTGraph.h

  • utils/Task.h

  • utils/common.h

Included By#

Classes#

Full File Listing#

class BasicTaskAssigner
#include <BasicTaskAssigner.h>

An abstract class for task assigners.

This class provides the interface for task assigners. It contains methods for updating start and goal locations, loading tasks from a file, and getting the current start and goal locations. It also provides methods for sampling locations from the map.

Subclassed by DistinctOneGoalTaskAssigner, OneGoalTaskAssigner, WindowedTaskAssigner

Public Functions

BasicTaskAssigner() = default#
BasicTaskAssigner(const SMARTGrid &G, const shared_ptr<HeuristicTableBase> heuristic_table, int screen, int num_of_agents, int seed, string task_file = "")

Constructor for BasicTaskAssigner.

Parameters:
  • G – The SMARTGrid representing the map.

  • heuristic_table – A shared pointer to the heuristic table.

  • screen – The screen number for logging.

  • num_of_agents – The number of robots.

  • seed – The random seed.

  • task_file – The file containing the tasks. If empty, tasks are randomly generated.

virtual void updateStartsAndGoals(vector<tuple<double, double, int>> &start_locs, set<int> finished_tasks_id) = 0

Virtual function to update start and goal locations.

Parameters:
  • start_locs – A vector of tuples representing the start locations.

  • finished_tasks_id – A set of finished task IDs.

inline vector<State> getStarts() const#
inline vector<vector<Task>> getGoalLocations() const#
inline set<int> getBackupTasks() const#
json getMAPFInstanceJSON() const#

Protected Functions

bool load_tasks(string task_file)#
void print_mapf_instance(vector<State> starts_, vector<vector<Task>> goals_) const#
int sample_workstation()#
int sample_endpiont()#
int sample_task_location()#
int sample_free_location()#

Protected Attributes

const SMARTGrid &G#
const shared_ptr<HeuristicTableBase> heuristic_table#
vector<State> starts#
vector<vector<Task>> goal_locations#
vector<list<Task>> tasks#
bool random_task = true#
int screen#
int num_of_agents#
int task_id#
int seed#
mt19937 gen#
discrete_distribution<int> workstation_dist#
discrete_distribution<int> endpoint_dist#
discrete_distribution<int> task_location_dist#
discrete_distribution<int> free_location_dist#
vector<CellType> next_goal_type#
set<int> backup_tasks#
class WindowedTaskAssigner : public BasicTaskAssigner#

Public Functions

WindowedTaskAssigner() = default#
WindowedTaskAssigner(const SMARTGrid &G, const shared_ptr<HeuristicTableBase> heuristic_table, int screen, int simulation_window, int num_of_agents, int seed, string task_file = "")#
void updateStartsAndGoals(vector<tuple<double, double, int>> &start_locs, set<int> finished_tasks_id) override#

Private Functions

int gen_next_goal(int agent_id, bool repeat_last_goal = false)#

Private Members

int simulation_window#