Skip to content

Commit

Permalink
benchmark tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vcoppe committed Jan 11, 2024
1 parent e6759df commit fbee244
Show file tree
Hide file tree
Showing 10 changed files with 5,977 additions and 34 deletions.
6 changes: 3 additions & 3 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ fn main() {

fn get_model() -> Model {
let (graph, mut cbs, config, agent_size) = get_cbs_from_files(
"resources/instances/grid_map.xml",
"resources/instances/task.xml",
"resources/instances/den520d_random/map.xml",
"resources/instances/den520d_random/den520d-random-20.xml",
"resources/config/config-2.xml",
29,
);

let limits = (0..graph.num_nodes())
.map(|id| {
let node = graph.get_node(GraphNodeId(id));
Expand Down
2 changes: 1 addition & 1 deletion resources/config/config-2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<connectedness>2</connectedness>
<focal_weight>1.0</focal_weight>
<agent_size>0.4</agent_size>
<timelimit>5</timelimit>
<timelimit>30</timelimit>
<precision>0.000001</precision>
</algorithm>
</root>
2 changes: 1 addition & 1 deletion resources/config/config-3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<connectedness>3</connectedness>
<focal_weight>1.0</focal_weight>
<agent_size>0.4</agent_size>
<timelimit>5</timelimit>
<timelimit>30</timelimit>
<precision>0.000001</precision>
</algorithm>
</root>
2 changes: 1 addition & 1 deletion resources/config/config-4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<connectedness>4</connectedness>
<focal_weight>1.0</focal_weight>
<agent_size>0.4</agent_size>
<timelimit>5</timelimit>
<timelimit>30</timelimit>
<precision>0.000001</precision>
</algorithm>
</root>
2 changes: 1 addition & 1 deletion resources/config/config-5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<connectedness>5</connectedness>
<focal_weight>1.0</focal_weight>
<agent_size>0.4</agent_size>
<timelimit>5</timelimit>
<timelimit>30</timelimit>
<precision>0.000001</precision>
</algorithm>
</root>
12 changes: 4 additions & 8 deletions src/search/cbs/cbs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,10 @@ where
let mut delayed_move = moves[0].clone();
while hi > lo + config.precision {
let mid = lo + (hi - lo) / 2.0;
if mid <= lo || mid >= hi {
// Can happen due to floating point precision
break;
}

delayed_move.interval.start = mid;
delayed_move.interval.end = mid + (moves[0].interval.end - moves[0].interval.start);
Expand Down Expand Up @@ -913,14 +917,6 @@ where
pub fn add_frozen(&mut self, agent: usize, solution: Solution<Arc<SippState<S, C>>, A, C, DC>) {
self.frozen.insert(agent, solution);
}

pub fn use_n_agents(&mut self, n_agents: usize) {
for agent in n_agents..self.n_agents {
self.frozen.remove(&agent);
}
self.n_agents = n_agents;
self.tasks.truncate(n_agents);
}
}

/// A node in the Conflict-Based Search tree.
Expand Down
Loading

0 comments on commit fbee244

Please sign in to comment.