File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,21 @@ pub fn serialize_plan(
2626 let action = serialize_action_instance ( ch, problem, assignment) ?;
2727 actions. push ( action) ;
2828 }
29- // sort actions by increasing start time
29+ // sort actions by increasing start time.
3030 actions. sort_by_key ( |a| real_to_rational ( a. start_time . as_ref ( ) . unwrap ( ) ) ) ;
31+
32+ fn is_temporal ( feature : i32 ) -> bool {
33+ feature == ( up:: Feature :: ContinuousTime as i32 ) || feature == ( up:: Feature :: DiscreteTime as i32 )
34+ }
35+ if !_problem_request. features . iter ( ) . any ( |feature| is_temporal ( * feature) ) {
36+ // the problem is not temporal, remove time annotations
37+ // not that the sorting done earlier ensures the plan is a valid sequence
38+ for action in & mut actions {
39+ action. start_time = None ;
40+ action. end_time = None ;
41+ }
42+ }
43+
3144 Ok ( up:: Plan { actions } )
3245}
3346
You can’t perform that action at this time.
0 commit comments