Fail Policy Integration#
When the MAPF planner fails to find a solution within the time limit, the fail policy module determines how to handle the failure. The fail policy can be either a fast but suboptimal planner that replan from scratch, or a use partial solutions from the MAPF planner to generate a plan.
Our Provided Fail Policies#
We provide three fail policies, including:
PIBT (Okumura et al. 2019): the Priority Inheritance with Backtracking.
LRA (Li et al. 2021): the Local Repair Guided Waits.
GuidedPIBT (Chen et al. 2024): Guided PIBT.
Add New Fail Policies#
Implementing a new fail policy requires no RPC communication since it is handled within LSMART. The fail policy shall inherit the abstract class Class FailPolicy and implement the pure virtual functions defined in the class. We refer the users to Class PIBT for a fail policy that replan from scratch and Class LRAStar for a fail policy that uses partial solutions from the MAPF planner.
-
class FailPolicy#
The base class for all fail policies in LSMART.
This class defines the interface and common functionality for fail policies used in the LSMART framework. Fail policies are responsible for handling situations where the main MAPF solver fails to find a solution within the given constraints. To implement a new fail policy, inherit from this class and implement the pure virtual methods.
Subclassed by GuidedPIBT, LRAStar, PIBT
Public Functions
Constructor for the FailPolicy class.
- Parameters:
G – Reference to the BasicGraph representing the map
path_planner – Reference to the SingleAgentSolver used for single agent path planning
heuristic_table – Shared pointer to the HeuristicTableBase for heuristic calculations
vm – Boost program options variable map for configuration
-
virtual bool run(const vector<State> &starts, const vector<vector<Task>> &goal_locations, const vector<Path> &guide_paths = vector<Path>(), int time_limit = 60, const vector<int> &waited_time = vector<int>()) = 0#
Given a MAPF instance, solve it using the fail policy.
- Parameters:
starts – Vector of start states for each agent
goal_locations – Vector of goal locations for each agent
guide_paths – Optional vector of guide paths for each agent. If the MAPF solver fails, the guide paths are usually the partial solution returned by the MAPF solver.
time_limit – Time limit (in seconds) for the fail policy to find a solution
waited_time – Vector of timesteps each agent has already waited. Used if considering tasking wait time.
- Returns:
True if a solution is found, false otherwise
-
virtual void save_results(const std::string &fileName, const std::string &instanceName) const = 0#
Save the results of the fail policy to a file.
This function can be left unimplemented if not needed.
- Parameters:
fileName – Name of the file to save the results to
instanceName – Name of the MAPF instance
-
virtual void clear() = 0#
Clear any internal data structures used by the fail policy.
-
virtual string get_name() const = 0#
Get the name of the fail policy.
- Returns:
Name of the fail policy as a string.
-
vector<vector<tuple<int, int, double, int>>> convert_path_to_smart(const vector<vector<Task>> &goal_locations)#
Convert the solution of the fail policy from the internal representation (
vector<Path>) to SMART path format (vector<vector<tuple<int, int, double, int>>>).- Parameters:
goal_locations – The goal locations for each agent
- Returns:
The converted SMART path format