pub struct CbsConfig {
pub objective: Objective,
pub prioritize_conflicts: bool,
pub bypass: bool,
pub splitting: Splitting,
pub heuristic: CbsHeuristic,
pub conflict_avoidance: bool,
}Expand description
What cbs_with optimizes and which improvements it uses.
None of the improvements changes the objective value of the result; they only reduce the number of constraint-tree nodes.
Fields§
§objective: ObjectiveWhat the search minimizes.
prioritize_conflicts: boolSplit cardinal conflicts first, then semi-cardinal ones, then the rest (earliest first within a class). Needs an MDD per conflicting agent and node.
bypass: boolBypass (Boyarski et al. 2015): when a child is as cheap for its replanned agent as the parent and has fewer conflicts, take over its paths instead of splitting.
splitting: SplittingHow a conflict is split into two children.
heuristic: CbsHeuristicThe admissible high-level heuristic added to a node’s sum of costs. Admissible for
Objective::SumOfCosts only; ignored for Objective::Makespan.
conflict_avoidance: boolThe conflict avoidance table (Sharon et al. 2015): among an agent’s cheapest paths, the low level returns one with the fewest conflicts with the other agents’ current paths. The root plans the agents one after another, each avoiding the earlier ones.
use mapf_search::{Agent, CbsConfig, Grid, Instance, Limits, Objective, cbs_with};
// Four agents cross a free 4x4 grid; ties among cheapest paths decide how often
// they meet.
let grid = Grid::new(4, 4);
let agents = vec![
Agent { start: 0, goal: 15 },
Agent { start: 3, goal: 12 },
Agent { start: 12, goal: 3 },
Agent { start: 15, goal: 0 },
];
let instance = Instance::new(grid, agents)?;
let plain = CbsConfig::plain(Objective::SumOfCosts);
let avoiding = CbsConfig { conflict_avoidance: true, ..plain };
let without = cbs_with(&instance, plain, Limits::NONE);
let with = cbs_with(&instance, avoiding, Limits::NONE);
let cost = |result: &mapf_search::MapfResult| result.solution().map(|s| s.sum_of_costs);
assert_eq!(cost(&with), cost(&without));
assert!(with.stats.expanded <= without.stats.expanded);