Skip to content

Commit

Permalink
fix(planning): make sure all action templates are given a fluent-hier…
Browse files Browse the repository at this point in the history
…archy level, even if they do not contribute meaningful effects.
  • Loading branch information
arbimo committed Apr 19, 2024
1 parent 1d7d2f6 commit dabf671
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions planning/planning/src/chronicles/analysis/fluent_hierarchy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ pub fn hierarchy(pb: &Problem) -> HashMap<TemplateID, usize> {
}
println!()
}
for template_id in 0..pb.templates.len() {
// templates that have no effect on a fluent in the hierarchy (no attributed level yet)
// are placed at the last level
templates_lvl.entry(template_id).or_insert(scc.len());
}
println!("\nAction hierarchy: ");

for (template, lvl) in templates_lvl.iter().sorted_by_key(|(_template, lvl)| **lvl) {
Expand Down

0 comments on commit dabf671

Please sign in to comment.