Skip to content

Commit

Permalink
fix(up): solution serialization sometime failed in the presence of no…
Browse files Browse the repository at this point in the history
…n-symbolic parameters
  • Loading branch information
arbimo committed Jul 11, 2024
1 parent 67ba7c8 commit 1b10740
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions planning/grpc/server/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ pub fn serialize_plan(
let end = serialize_time(ch.chronicle.end, assignment)?;

// extract name and parameters (possibly empty if not an action or method chronicle)
let name = if let Some(name) = ch.chronicle.name.first() {
let name = SAtom::try_from(*name).context("Action name is not a symbol")?;
let name = assignment.sym_value_of(name).context("Unbound sym var")?;
problem.model.shape.symbols.symbol(name).to_string()
} else {
"".to_string()
let name = match ch.chronicle.kind {
ChronicleKind::Problem => "problem".to_string(),
ChronicleKind::Method | ChronicleKind::Action | ChronicleKind::DurativeAction => {
let name = ch.chronicle.name.first().context("No name for action")?;
let name = SAtom::try_from(*name).context("Action name is not a symbol")?;
let name = assignment.sym_value_of(name).context("Unbound sym var")?;
problem.model.shape.symbols.symbol(name).to_string()
}
};

let parameters = if ch.chronicle.name.len() > 1 {
Expand Down

0 comments on commit 1b10740

Please sign in to comment.