Skip to content

Commit

Permalink
chore(merge): numric-problem-kind into numeric-planning
Browse files Browse the repository at this point in the history
  • Loading branch information
Shi-Raida committed Oct 16, 2023
2 parents 672f846 + 8d72c7b commit cb0ca2d
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 9 deletions.
9 changes: 9 additions & 0 deletions planning/grpc/api/src/unified_planning.proto
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,8 @@ enum Feature {
// EXPRESSION_DURATION
STATIC_FLUENTS_IN_DURATIONS = 27;
FLUENTS_IN_DURATIONS = 28;
REAL_TYPE_DURATIONS = 62;
INT_TYPE_DURATIONS = 63;
// NUMBERS
CONTINUOUS_NUMBERS = 7;
DISCRETE_NUMBERS = 8;
Expand Down Expand Up @@ -625,6 +627,8 @@ enum Feature {
// FLUENTS_TYPE
NUMERIC_FLUENTS = 19;
OBJECT_FLUENTS = 20;
INT_FLUENTS = 60;
REAL_FLUENTS = 61;
// PARAMETERS
BOOL_FLUENT_PARAMETERS = 50;
BOUNDED_INT_FLUENT_PARAMETERS = 51;
Expand All @@ -642,6 +646,11 @@ enum Feature {
// ACTION_COST_KIND
STATIC_FLUENTS_IN_ACTIONS_COST = 45;
FLUENTS_IN_ACTIONS_COST = 46;
REAL_NUMBERS_IN_ACTIONS_COST = 64;
INT_NUMBERS_IN_ACTIONS_COST = 65;
// OVERSUBSCRIPTION_KIND
REAL_NUMBERS_IN_OVERSUBSCRIPTION = 66;
INT_NUMBERS_IN_OVERSUBSCRIPTION = 67;
// SIMULATED_ENTITIES
SIMULATED_EFFECTS = 25;
// CONSTRAINTS_KIND
Expand Down
27 changes: 27 additions & 0 deletions planning/grpc/api/src/unified_planning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,8 @@ pub enum Feature {
/// EXPRESSION_DURATION
StaticFluentsInDurations = 27,
FluentsInDurations = 28,
RealTypeDurations = 62,
IntTypeDurations = 63,
/// NUMBERS
ContinuousNumbers = 7,
DiscreteNumbers = 8,
Expand Down Expand Up @@ -1220,6 +1222,8 @@ pub enum Feature {
/// FLUENTS_TYPE
NumericFluents = 19,
ObjectFluents = 20,
IntFluents = 60,
RealFluents = 61,
/// PARAMETERS
BoolFluentParameters = 50,
BoundedIntFluentParameters = 51,
Expand All @@ -1237,6 +1241,11 @@ pub enum Feature {
/// ACTION_COST_KIND
StaticFluentsInActionsCost = 45,
FluentsInActionsCost = 46,
RealNumbersInActionsCost = 64,
IntNumbersInActionsCost = 65,
/// OVERSUBSCRIPTION_KIND
RealNumbersInOversubscription = 66,
IntNumbersInOversubscription = 67,
/// SIMULATED_ENTITIES
SimulatedEffects = 25,
/// CONSTRAINTS_KIND
Expand Down Expand Up @@ -1274,6 +1283,8 @@ impl Feature {
Feature::SelfOverlapping => "SELF_OVERLAPPING",
Feature::StaticFluentsInDurations => "STATIC_FLUENTS_IN_DURATIONS",
Feature::FluentsInDurations => "FLUENTS_IN_DURATIONS",
Feature::RealTypeDurations => "REAL_TYPE_DURATIONS",
Feature::IntTypeDurations => "INT_TYPE_DURATIONS",
Feature::ContinuousNumbers => "CONTINUOUS_NUMBERS",
Feature::DiscreteNumbers => "DISCRETE_NUMBERS",
Feature::BoundedTypes => "BOUNDED_TYPES",
Expand Down Expand Up @@ -1302,6 +1313,8 @@ impl Feature {
Feature::HierarchicalTyping => "HIERARCHICAL_TYPING",
Feature::NumericFluents => "NUMERIC_FLUENTS",
Feature::ObjectFluents => "OBJECT_FLUENTS",
Feature::IntFluents => "INT_FLUENTS",
Feature::RealFluents => "REAL_FLUENTS",
Feature::BoolFluentParameters => "BOOL_FLUENT_PARAMETERS",
Feature::BoundedIntFluentParameters => "BOUNDED_INT_FLUENT_PARAMETERS",
Feature::BoolActionParameters => "BOOL_ACTION_PARAMETERS",
Expand All @@ -1316,6 +1329,10 @@ impl Feature {
Feature::TemporalOversubscription => "TEMPORAL_OVERSUBSCRIPTION",
Feature::StaticFluentsInActionsCost => "STATIC_FLUENTS_IN_ACTIONS_COST",
Feature::FluentsInActionsCost => "FLUENTS_IN_ACTIONS_COST",
Feature::RealNumbersInActionsCost => "REAL_NUMBERS_IN_ACTIONS_COST",
Feature::IntNumbersInActionsCost => "INT_NUMBERS_IN_ACTIONS_COST",
Feature::RealNumbersInOversubscription => "REAL_NUMBERS_IN_OVERSUBSCRIPTION",
Feature::IntNumbersInOversubscription => "INT_NUMBERS_IN_OVERSUBSCRIPTION",
Feature::SimulatedEffects => "SIMULATED_EFFECTS",
Feature::TrajectoryConstraints => "TRAJECTORY_CONSTRAINTS",
Feature::StateInvariants => "STATE_INVARIANTS",
Expand Down Expand Up @@ -1347,6 +1364,8 @@ impl Feature {
"SELF_OVERLAPPING" => Some(Self::SelfOverlapping),
"STATIC_FLUENTS_IN_DURATIONS" => Some(Self::StaticFluentsInDurations),
"FLUENTS_IN_DURATIONS" => Some(Self::FluentsInDurations),
"REAL_TYPE_DURATIONS" => Some(Self::RealTypeDurations),
"INT_TYPE_DURATIONS" => Some(Self::IntTypeDurations),
"CONTINUOUS_NUMBERS" => Some(Self::ContinuousNumbers),
"DISCRETE_NUMBERS" => Some(Self::DiscreteNumbers),
"BOUNDED_TYPES" => Some(Self::BoundedTypes),
Expand Down Expand Up @@ -1375,6 +1394,8 @@ impl Feature {
"HIERARCHICAL_TYPING" => Some(Self::HierarchicalTyping),
"NUMERIC_FLUENTS" => Some(Self::NumericFluents),
"OBJECT_FLUENTS" => Some(Self::ObjectFluents),
"INT_FLUENTS" => Some(Self::IntFluents),
"REAL_FLUENTS" => Some(Self::RealFluents),
"BOOL_FLUENT_PARAMETERS" => Some(Self::BoolFluentParameters),
"BOUNDED_INT_FLUENT_PARAMETERS" => Some(Self::BoundedIntFluentParameters),
"BOOL_ACTION_PARAMETERS" => Some(Self::BoolActionParameters),
Expand All @@ -1389,6 +1410,12 @@ impl Feature {
"TEMPORAL_OVERSUBSCRIPTION" => Some(Self::TemporalOversubscription),
"STATIC_FLUENTS_IN_ACTIONS_COST" => Some(Self::StaticFluentsInActionsCost),
"FLUENTS_IN_ACTIONS_COST" => Some(Self::FluentsInActionsCost),
"REAL_NUMBERS_IN_ACTIONS_COST" => Some(Self::RealNumbersInActionsCost),
"INT_NUMBERS_IN_ACTIONS_COST" => Some(Self::IntNumbersInActionsCost),
"REAL_NUMBERS_IN_OVERSUBSCRIPTION" => {
Some(Self::RealNumbersInOversubscription)
}
"INT_NUMBERS_IN_OVERSUBSCRIPTION" => Some(Self::IntNumbersInOversubscription),
"SIMULATED_EFFECTS" => Some(Self::SimulatedEffects),
"TRAJECTORY_CONSTRAINTS" => Some(Self::TrajectoryConstraints),
"STATE_INVARIANTS" => Some(Self::StateInvariants),
Expand Down
2 changes: 1 addition & 1 deletion planning/unified/deps/unified-planning
Submodule unified-planning updated 42 files
+5 −5 .github/workflows/test.yml
+17 −0 docs/examples.rst
+1 −1 docs/notebooks/08-sequential-simulator.ipynb
+441 −0 docs/notebooks/12-plan-parsing-conversion.ipynb
+1 −1 docs/optimality.rst
+33 −3 docs/problem_representation.rst
+1 −1 plot-requirements.txt
+16 −9 setup.py
+13 −5 unified_planning/engines/compilers/bounded_types_remover.py
+13 −5 unified_planning/engines/compilers/conditional_effects_remover.py
+13 −5 unified_planning/engines/compilers/disjunctive_conditions_remover.py
+13 −7 unified_planning/engines/compilers/grounder.py
+1 −1 unified_planning/engines/compilers/ma_disjunctive_conditions_remover.py
+13 −5 unified_planning/engines/compilers/negative_conditions_remover.py
+13 −5 unified_planning/engines/compilers/quantifiers_remover.py
+13 −5 unified_planning/engines/compilers/state_invariants_remover.py
+7 −2 unified_planning/engines/compilers/tarski_grounder.py
+10 −7 unified_planning/engines/compilers/trajectory_constraints_remover.py
+15 −7 unified_planning/engines/compilers/usertype_fluents_remover.py
+12 −7 unified_planning/engines/factory.py
+14 −6 unified_planning/engines/oversubscription_planner.py
+8 −4 unified_planning/engines/plan_validator.py
+5 −3 unified_planning/engines/replanner.py
+8 −4 unified_planning/engines/sequential_simulator.py
+4 −4 unified_planning/grpc/generated/unified_planning_pb2.py
+9 −0 unified_planning/grpc/unified_planning.proto
+3 −5 unified_planning/interop/to_tarski.py
+2 −2 unified_planning/io/ma_pddl_writer.py
+10 −0 unified_planning/io/pddl_reader.py
+2 −2 unified_planning/io/pddl_writer.py
+3 −0 unified_planning/model/expression.py
+26 −11 unified_planning/model/mixins/metrics.py
+10 −8 unified_planning/model/multi_agent/ma_problem.py
+23 −21 unified_planning/model/problem.py
+99 −37 unified_planning/model/problem_kind.py
+112 −0 unified_planning/model/problem_kind_versioning.py
+2 −2 unified_planning/plot/utils.py
+7 −6 unified_planning/shortcuts.py
+0 −13 unified_planning/test/examples/minimals.py
+8 −6 unified_planning/test/pddl/enhsp.py
+5 −11 unified_planning/test/test_problem.py
+1 −1 unified_planning/test/test_protobuf_io.py
34 changes: 26 additions & 8 deletions planning/unified/plugin/up_aries/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,22 @@
"SIMPLE_NUMERIC_PLANNING",
# "GENERAL_NUMERIC_PLANNING",
# TIME
# "CONTINUOUS_TIME",
"CONTINUOUS_TIME",
"DISCRETE_TIME",
"INTERMEDIATE_CONDITIONS_AND_EFFECTS",
"EXTERNAL_CONDITIONS_AND_EFFECTS",
"TIMED_EFFECTS",
"TIMED_EFFECT", # backward compat
"TIMED_GOALS",
"DURATION_INEQUALITIES",
# "SELF_OVERLAPPING"
"SELF_OVERLAPPING",
# EXPRESSION_DURATION
"STATIC_FLUENTS_IN_DURATIONS",
"STATIC_FLUENTS_IN_DURATION", # backward compat
"FLUENTS_IN_DURATIONS",
"FLUENTS_IN_DURATION", # backward compat
"INT_TYPE_DURATIONS",
# "REAL_TYPE_DURATIONS",
# NUMBERS
# "CONTINUOUS_NUMBERS",
"DISCRETE_NUMBERS",
Expand Down Expand Up @@ -95,6 +97,8 @@
# FLUENTS_TYPE
"NUMERIC_FLUENTS",
"OBJECT_FLUENTS",
"INT_FLUENTS",
# "REAL_FLUENTS",
# PARAMETERS
# "BOOL_FLUENT_PARAMETERS",
# "BOUNDED_INT_FLUENT_PARAMETERS",
Expand All @@ -103,15 +107,19 @@
"UNBOUNDED_INT_ACTION_PARAMETERS",
# "REAL_ACTION_PARAMETERS",
# QUALITY_METRICS
# "ACTIONS_COST",
"ACTIONS_COST",
# "FINAL_VALUE",
"MAKESPAN",
"PLAN_LENGTH",
# "OVERSUBSCRIPTION",
# "TEMPORAL_OVERSUBSCRIPTION",
"INT_NUMBERS_IN_OVERSUBSCRIPTION",
# "REAL_NUMBERS_IN_OVERSUBSCRIPTION",
# ACTIONS_COST_KIND
# "STATIC_FLUENTS_IN_ACTIONS_COST",
# "FLUENTS_IN_ACTIONS_COST",
"STATIC_FLUENTS_IN_ACTIONS_COST",
"FLUENTS_IN_ACTIONS_COST",
"INT_NUMBERS_IN_ACTIONS_COST",
# "REAL_NUMBERS_IN_ACTIONS_COST",
# SIMULATED_ENTITIES
# "SIMULATED_EFFECTS",
# CONSTRAINTS_KIND
Expand All @@ -124,7 +132,8 @@
"TASK_ORDER_TOTAL",
"TASK_ORDER_PARTIAL",
# "TASK_ORDER_TEMPORAL",
}
},
version=2
)

_ARIES_VAL_SUPPORTED_KIND = up.model.ProblemKind(
Expand All @@ -146,12 +155,14 @@
"TIMED_EFFECT", # backward compat
"TIMED_GOALS",
"DURATION_INEQUALITIES",
# "SELF_OVERLAPPING"
"SELF_OVERLAPPING",
# EXPRESSION_DURATION
"STATIC_FLUENTS_IN_DURATIONS",
"STATIC_FLUENTS_IN_DURATION", # backward compat
"FLUENTS_IN_DURATIONS",
"FLUENTS_IN_DURATION", # backward compat
"INT_TYPE_DURATIONS",
"REAL_TYPE_DURATIONS",
# NUMBERS
"CONTINUOUS_NUMBERS",
"DISCRETE_NUMBERS",
Expand Down Expand Up @@ -180,6 +191,8 @@
# FLUENTS_TYPE
"NUMERIC_FLUENTS",
"OBJECT_FLUENTS",
"INT_FLUENTS",
"REAL_FLUENTS",
# PARAMETERS
# "BOOL_FLUENT_PARAMETERS",
# "BOUNDED_INT_FLUENT_PARAMETERS",
Expand All @@ -194,9 +207,13 @@
"PLAN_LENGTH",
"OVERSUBSCRIPTION",
"TEMPORAL_OVERSUBSCRIPTION",
"INT_NUMBERS_IN_OVERSUBSCRIPTION",
"REAL_NUMBERS_IN_OVERSUBSCRIPTION",
# ACTIONS_COST_KIND
"STATIC_FLUENTS_IN_ACTIONS_COST",
"FLUENTS_IN_ACTIONS_COST",
"INT_NUMBERS_IN_ACTIONS_COST",
"REAL_NUMBERS_IN_ACTIONS_COST",
# SIMULATED_ENTITIES
# "SIMULATED_EFFECTS",
# CONSTRAINTS_KIND
Expand All @@ -209,7 +226,8 @@
"TASK_ORDER_TOTAL",
"TASK_ORDER_PARTIAL",
"TASK_ORDER_TEMPORAL",
}
},
version=2
)


Expand Down

0 comments on commit cb0ca2d

Please sign in to comment.