-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(grpc, solver): select the depth of each template individually fr…
…om the warping plan
- Loading branch information
Showing
6 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
// license that can be found in the LICENSE file. | ||
pub mod chronicles; | ||
pub mod serialize; | ||
pub mod warm_up; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use aries_planning::chronicles::ChronicleTemplate; | ||
|
||
pub fn depth_from_option_plan(plan: Option<String>, ch: &ChronicleTemplate) -> u32 { | ||
plan.map_or(0, |p| depth_from_plan(p, ch)) | ||
} | ||
|
||
pub fn depth_from_plan(plan: String, ch: &ChronicleTemplate) -> u32 { | ||
let ch_name = format!("{:?}", ch.label); | ||
|
||
plan.split("\n") | ||
.map(|line| line.trim()) | ||
.filter(|line| line.starts_with(ch_name.as_str())) | ||
.count() as u32 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters