Skip to content

Commit

Permalink
fix(ci): update upf proto version
Browse files Browse the repository at this point in the history
  • Loading branch information
Shi-Raida committed Jun 28, 2023
1 parent 11b19ad commit b903a92
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 7 deletions.
61 changes: 56 additions & 5 deletions planning/grpc/api/src/unified_planning.proto
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,50 @@ message Hierarchy {
TaskNetwork initial_task_network = 3;
}

// ============= Scheduling =======================

// Activity in a scheduling problem.
message Activity {
// Name of the activity that must uniquely identify it.
string name = 1;

// Typed and named parameters of the activity.
repeated Parameter parameters = 2;

// Duration of the activity
Duration duration = 3;

// Conjunction of conditions that must hold if the activity is present.
repeated Condition conditions = 4;

// Conjunction of effects that this activity produces.
repeated Effect effects = 5;

// Conjunction of static constraints that must hold if the activity is present.
repeated Expression constraints = 6;
}

// Extension of `Problem` for scheduling
message SchedulingExtension {
// All potential activities of the scheduling problem.
repeated Activity activities = 1;

// All variables in the base problem
repeated Parameter variables = 2;

// All constraints in the base problem.
repeated Expression constraints = 5;
}

message Schedule {
// Name of the activities that appear in the solution
repeated string activities = 1;

// Assignment of all variables and activity parameters and timepoints
// that appear in the solution.
map<string, Atom> variable_assignments = 2;
}



// ============== Problem =========================
Expand Down Expand Up @@ -481,7 +525,6 @@ message Metric {
repeated TimedGoalWithWeight timed_goals = 6;
}

// features: ACTION_BASED
message Problem {
string domain_name = 1;
string problem_name = 2;
Expand All @@ -490,6 +533,7 @@ message Problem {
repeated ObjectDeclaration objects = 5;

// List of actions in the domain.
// features: ACTION_BASED
repeated Action actions = 6;

// Initial state, including default values of state variables.
Expand All @@ -508,11 +552,14 @@ message Problem {
// The plan quality metrics
repeated Metric metrics = 11;


// If the problem is hierarchical, defines the tasks and methods as well as the initial task network.
// features: hierarchical
// features: HIERARCHICAL
Hierarchy hierarchy = 12;

// Scheduling-specific extension of the problem.
// features: SCHEDULING
SchedulingExtension scheduling_extension = 17;

// Trajectory constraints of the planning problem.
repeated Expression trajectory_constraints = 13;

Expand All @@ -532,6 +579,7 @@ enum Feature {
// PROBLEM_CLASS
ACTION_BASED = 0;
HIERARCHICAL = 26;
SCHEDULING = 56;
// PROBLEM_TYPE
SIMPLE_NUMERIC_PLANNING = 30;
GENERAL_NUMERIC_PLANNING = 31;
Expand Down Expand Up @@ -622,7 +670,6 @@ message ActionInstance {
// End time of the action. The default 0 value is OK in the case of non-temporal planning
// feature: [DURATIVE_ACTIONS]
Real end_time = 5;

}

message MethodInstance {
Expand All @@ -644,18 +691,22 @@ message PlanHierarchy {

// Instances of all methods used in the plan.
repeated MethodInstance methods = 2;

}

message Plan {
// An ordered sequence of actions that appear in the plan.
// The order of the actions in the list must be compatible with the partial order of the start times.
// In case of non-temporal planning, this allows having all start time at 0 and only rely on the order in this sequence.
// features: ACTION_BASED
repeated ActionInstance actions = 1;

// When the plan is hierarchical, this object provides the decomposition of hte root tasks into the actions of the plan
// feature: HIERARCHY
PlanHierarchy hierarchy = 2;

// Solution representation of a scheduling problem.
// feature: SCHEDULING
Schedule schedule = 3;
}


Expand Down
67 changes: 65 additions & 2 deletions planning/grpc/api/src/unified_planning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,57 @@ pub struct Hierarchy {
#[prost(message, optional, tag = "3")]
pub initial_task_network: ::core::option::Option<TaskNetwork>,
}
/// Activity in a scheduling problem.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Activity {
/// Name of the activity that must uniquely identify it.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Typed and named parameters of the activity.
#[prost(message, repeated, tag = "2")]
pub parameters: ::prost::alloc::vec::Vec<Parameter>,
/// Duration of the activity
#[prost(message, optional, tag = "3")]
pub duration: ::core::option::Option<Duration>,
/// Conjunction of conditions that must hold if the activity is present.
#[prost(message, repeated, tag = "4")]
pub conditions: ::prost::alloc::vec::Vec<Condition>,
/// Conjunction of effects that this activity produces.
#[prost(message, repeated, tag = "5")]
pub effects: ::prost::alloc::vec::Vec<Effect>,
/// Conjunction of static constraints that must hold if the activity is present.
#[prost(message, repeated, tag = "6")]
pub constraints: ::prost::alloc::vec::Vec<Expression>,
}
/// Extension of `Problem` for scheduling
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SchedulingExtension {
/// All potential activities of the scheduling problem.
#[prost(message, repeated, tag = "1")]
pub activities: ::prost::alloc::vec::Vec<Activity>,
/// All variables in the base problem
#[prost(message, repeated, tag = "2")]
pub variables: ::prost::alloc::vec::Vec<Parameter>,
/// All constraints in the base problem.
#[prost(message, repeated, tag = "5")]
pub constraints: ::prost::alloc::vec::Vec<Expression>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Schedule {
/// Name of the activities that appear in the solution
#[prost(string, repeated, tag = "1")]
pub activities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Assignment of all variables and activity parameters and timepoints
/// that appear in the solution.
#[prost(map = "string, message", tag = "2")]
pub variable_assignments: ::std::collections::HashMap<
::prost::alloc::string::String,
Atom,
>,
}
/// A Goal is currently an expression that must hold either:
/// - in the final state,
/// - over a specific temporal interval (under the `timed_goals` features)
Expand Down Expand Up @@ -619,7 +670,6 @@ pub mod metric {
}
}
}
/// features: ACTION_BASED
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Problem {
Expand All @@ -634,6 +684,7 @@ pub struct Problem {
#[prost(message, repeated, tag = "5")]
pub objects: ::prost::alloc::vec::Vec<ObjectDeclaration>,
/// List of actions in the domain.
/// features: ACTION_BASED
#[prost(message, repeated, tag = "6")]
pub actions: ::prost::alloc::vec::Vec<Action>,
/// Initial state, including default values of state variables.
Expand All @@ -653,9 +704,13 @@ pub struct Problem {
#[prost(message, repeated, tag = "11")]
pub metrics: ::prost::alloc::vec::Vec<Metric>,
/// If the problem is hierarchical, defines the tasks and methods as well as the initial task network.
/// features: hierarchical
/// features: HIERARCHICAL
#[prost(message, optional, tag = "12")]
pub hierarchy: ::core::option::Option<Hierarchy>,
/// Scheduling-specific extension of the problem.
/// features: SCHEDULING
#[prost(message, optional, tag = "17")]
pub scheduling_extension: ::core::option::Option<SchedulingExtension>,
/// Trajectory constraints of the planning problem.
#[prost(message, repeated, tag = "13")]
pub trajectory_constraints: ::prost::alloc::vec::Vec<Expression>,
Expand Down Expand Up @@ -729,12 +784,17 @@ pub struct Plan {
/// An ordered sequence of actions that appear in the plan.
/// The order of the actions in the list must be compatible with the partial order of the start times.
/// In case of non-temporal planning, this allows having all start time at 0 and only rely on the order in this sequence.
/// features: ACTION_BASED
#[prost(message, repeated, tag = "1")]
pub actions: ::prost::alloc::vec::Vec<ActionInstance>,
/// When the plan is hierarchical, this object provides the decomposition of hte root tasks into the actions of the plan
/// feature: HIERARCHY
#[prost(message, optional, tag = "2")]
pub hierarchy: ::core::option::Option<PlanHierarchy>,
/// Solution representation of a scheduling problem.
/// feature: SCHEDULING
#[prost(message, optional, tag = "3")]
pub schedule: ::core::option::Option<Schedule>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -1114,6 +1174,7 @@ pub enum Feature {
/// PROBLEM_CLASS
ActionBased = 0,
Hierarchical = 26,
Scheduling = 56,
/// PROBLEM_TYPE
SimpleNumericPlanning = 30,
GeneralNumericPlanning = 31,
Expand Down Expand Up @@ -1192,6 +1253,7 @@ impl Feature {
match self {
Feature::ActionBased => "ACTION_BASED",
Feature::Hierarchical => "HIERARCHICAL",
Feature::Scheduling => "SCHEDULING",
Feature::SimpleNumericPlanning => "SIMPLE_NUMERIC_PLANNING",
Feature::GeneralNumericPlanning => "GENERAL_NUMERIC_PLANNING",
Feature::ContinuousTime => "CONTINUOUS_TIME",
Expand Down Expand Up @@ -1259,6 +1321,7 @@ impl Feature {
match value {
"ACTION_BASED" => Some(Self::ActionBased),
"HIERARCHICAL" => Some(Self::Hierarchical),
"SCHEDULING" => Some(Self::Scheduling),
"SIMPLE_NUMERIC_PLANNING" => Some(Self::SimpleNumericPlanning),
"GENERAL_NUMERIC_PLANNING" => Some(Self::GeneralNumericPlanning),
"CONTINUOUS_TIME" => Some(Self::ContinuousTime),
Expand Down
1 change: 1 addition & 0 deletions planning/grpc/server/src/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub fn serialize_plan(
Ok(up::Plan {
actions,
hierarchy: None,
schedule: None,
})
}

Expand Down

0 comments on commit b903a92

Please sign in to comment.