Skip to content

Commit ff9ef00

Browse files
committed
chore: Update protobuf bindings
1 parent 1aef9f6 commit ff9ef00

File tree

2 files changed

+55
-12
lines changed

2 files changed

+55
-12
lines changed

planning/grpc/api/src/unified_planning.proto

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,22 @@ message Assignment {
414414
Expression value = 2;
415415
}
416416

417-
// Represents a goal associated with a cost, used to define oversubscription planning.
418-
message GoalWithCost {
417+
// Represents a goal associated with a weight, used to define oversubscription planning.
418+
message GoalWithWeight {
419419
// Goal expression
420420
Expression goal = 1;
421-
// The cost
422-
Real cost = 2;
421+
// The weight
422+
Real weight = 2;
423+
}
424+
425+
// Represents a timed goal associated with a weight, used to define temporal oversubscription planning.
426+
message TimedGoalWithWeight {
427+
// Goal expression
428+
Expression goal = 1;
429+
// The time interval
430+
TimeInterval timing = 2;
431+
// The weight
432+
Real weight = 3;
423433
}
424434

425435
message Metric {
@@ -440,8 +450,11 @@ message Metric {
440450
// Maximize the value of the expression defined in the `expression` field
441451
MAXIMIZE_EXPRESSION_ON_FINAL_STATE = 4;
442452

443-
// Maximize the number of goals reached, weighted by cost
453+
// Maximize the weighted number of goals reached
444454
OVERSUBSCRIPTION = 5;
455+
456+
// Maximize the weighted number of timed goals reached
457+
TEMPORAL_OVERSUBSCRIPTION = 6;
445458
}
446459
MetricKind kind = 1;
447460

@@ -461,7 +474,11 @@ message Metric {
461474

462475
// List of goals used to define the oversubscription planning problem.
463476
// Empty, if the `kind` is not OVERSUBSCRIPTION
464-
repeated GoalWithCost goals = 5;
477+
repeated GoalWithWeight goals = 5;
478+
479+
// List of timed goals used to define the temporal oversubscription planning problem.
480+
// Empty, if the `kind` is not TEMPORAL_OVERSUBSCRIPTION
481+
repeated TimedGoalWithWeight timed_goals = 6;
465482
}
466483

467484
// features: ACTION_BASED
@@ -544,6 +561,7 @@ enum Feature {
544561
MAKESPAN = 23;
545562
PLAN_LENGTH = 24;
546563
OVERSUBSCRIPTION = 29;
564+
TEMPORAL_OVERSUBSCRIPTION = 40;
547565
// SIMULATED_ENTITIES
548566
SIMULATED_EFFECTS = 25;
549567
// HIERARCHICAL

planning/grpc/api/src/unified_planning.rs

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,16 +489,30 @@ pub struct Assignment {
489489
#[prost(message, optional, tag = "2")]
490490
pub value: ::core::option::Option<Expression>,
491491
}
492-
/// Represents a goal associated with a cost, used to define oversubscription planning.
492+
/// Represents a goal associated with a weight, used to define oversubscription planning.
493493
#[allow(clippy::derive_partial_eq_without_eq)]
494494
#[derive(Clone, PartialEq, ::prost::Message)]
495-
pub struct GoalWithCost {
495+
pub struct GoalWithWeight {
496496
/// Goal expression
497497
#[prost(message, optional, tag = "1")]
498498
pub goal: ::core::option::Option<Expression>,
499-
/// The cost
499+
/// The weight
500500
#[prost(message, optional, tag = "2")]
501-
pub cost: ::core::option::Option<Real>,
501+
pub weight: ::core::option::Option<Real>,
502+
}
503+
/// Represents a timed goal associated with a weight, used to define temporal oversubscription planning.
504+
#[allow(clippy::derive_partial_eq_without_eq)]
505+
#[derive(Clone, PartialEq, ::prost::Message)]
506+
pub struct TimedGoalWithWeight {
507+
/// Goal expression
508+
#[prost(message, optional, tag = "1")]
509+
pub goal: ::core::option::Option<Expression>,
510+
/// The time interval
511+
#[prost(message, optional, tag = "2")]
512+
pub timing: ::core::option::Option<TimeInterval>,
513+
/// The weight
514+
#[prost(message, optional, tag = "3")]
515+
pub weight: ::core::option::Option<Real>,
502516
}
503517
#[allow(clippy::derive_partial_eq_without_eq)]
504518
#[derive(Clone, PartialEq, ::prost::Message)]
@@ -525,7 +539,11 @@ pub struct Metric {
525539
/// List of goals used to define the oversubscription planning problem.
526540
/// Empty, if the `kind` is not OVERSUBSCRIPTION
527541
#[prost(message, repeated, tag = "5")]
528-
pub goals: ::prost::alloc::vec::Vec<GoalWithCost>,
542+
pub goals: ::prost::alloc::vec::Vec<GoalWithWeight>,
543+
/// List of timed goals used to define the temporal oversubscription planning problem.
544+
/// Empty, if the `kind` is not TEMPORAL_OVERSUBSCRIPTION
545+
#[prost(message, repeated, tag = "6")]
546+
pub timed_goals: ::prost::alloc::vec::Vec<TimedGoalWithWeight>,
529547
}
530548
/// Nested message and enum types in `Metric`.
531549
pub mod metric {
@@ -553,8 +571,10 @@ pub mod metric {
553571
MinimizeExpressionOnFinalState = 3,
554572
/// Maximize the value of the expression defined in the `expression` field
555573
MaximizeExpressionOnFinalState = 4,
556-
/// Maximize the number of goals reached, weighted by cost
574+
/// Maximize the weighted number of goals reached
557575
Oversubscription = 5,
576+
/// Maximize the weighted number of timed goals reached
577+
TemporalOversubscription = 6,
558578
}
559579
impl MetricKind {
560580
/// String value of the enum field names used in the ProtoBuf definition.
@@ -575,6 +595,7 @@ pub mod metric {
575595
"MAXIMIZE_EXPRESSION_ON_FINAL_STATE"
576596
}
577597
MetricKind::Oversubscription => "OVERSUBSCRIPTION",
598+
MetricKind::TemporalOversubscription => "TEMPORAL_OVERSUBSCRIPTION",
578599
}
579600
}
580601
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -592,6 +613,7 @@ pub mod metric {
592613
Some(Self::MaximizeExpressionOnFinalState)
593614
}
594615
"OVERSUBSCRIPTION" => Some(Self::Oversubscription),
616+
"TEMPORAL_OVERSUBSCRIPTION" => Some(Self::TemporalOversubscription),
595617
_ => None,
596618
}
597619
}
@@ -1116,6 +1138,7 @@ pub enum Feature {
11161138
Makespan = 23,
11171139
PlanLength = 24,
11181140
Oversubscription = 29,
1141+
TemporalOversubscription = 40,
11191142
/// SIMULATED_ENTITIES
11201143
SimulatedEffects = 25,
11211144
/// HIERARCHICAL
@@ -1168,6 +1191,7 @@ impl Feature {
11681191
Feature::Makespan => "MAKESPAN",
11691192
Feature::PlanLength => "PLAN_LENGTH",
11701193
Feature::Oversubscription => "OVERSUBSCRIPTION",
1194+
Feature::TemporalOversubscription => "TEMPORAL_OVERSUBSCRIPTION",
11711195
Feature::SimulatedEffects => "SIMULATED_EFFECTS",
11721196
Feature::MethodPreconditions => "METHOD_PRECONDITIONS",
11731197
Feature::TaskNetworkConstraints => "TASK_NETWORK_CONSTRAINTS",
@@ -1215,6 +1239,7 @@ impl Feature {
12151239
"MAKESPAN" => Some(Self::Makespan),
12161240
"PLAN_LENGTH" => Some(Self::PlanLength),
12171241
"OVERSUBSCRIPTION" => Some(Self::Oversubscription),
1242+
"TEMPORAL_OVERSUBSCRIPTION" => Some(Self::TemporalOversubscription),
12181243
"SIMULATED_EFFECTS" => Some(Self::SimulatedEffects),
12191244
"METHOD_PRECONDITIONS" => Some(Self::MethodPreconditions),
12201245
"TASK_NETWORK_CONSTRAINTS" => Some(Self::TaskNetworkConstraints),

0 commit comments

Comments
 (0)