Skip to content

Commit

Permalink
Merge pull request #566 from aiplan4eu/changes-for-v1.1.0
Browse files Browse the repository at this point in the history
Minor changes and fixes for the new release
  • Loading branch information
mikand committed Feb 8, 2024
2 parents 2dd252b + f18c7a7 commit 86a4f06
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 29 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:
type: string

env:
up_tamer_commit: "1b543623ad2ebd9795529abe812352db8f4ec014"
up_pyperplan_commit: "6cec570b88d62ca5c4b8029a60c704414fe7f6a9"
up_tamer_commit: "631dfd43a56e7c2dda44fe273ec6f5492e99cfe1"
up_pyperplan_commit: "a24854213caf5038e1540e31613d24b93825fbb3"
up_fast_downward_commit: "c60b6ab82cb8c3046cfd4782afe4d4c6071c4109"
up_enhsp_commit: "1ec1086b7dbb67ce4a0bc03f5b71b551ee2168dc"
up_enhsp_commit: "78cc3331beb1fcc36380a8f698f49b4312dc411a"
up_fmap_commit: "f29e66c8483abcb8f17ff1c46a0745ee9b1e95fa"

jobs:
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
- name: Download and install ENHSP
run: |
git clone https://gitlab.com/enricos83/ENHSP-Public.git
cd ENHSP-Public; git checkout enhsp20-0.13.0; ./compile; cd ..
cd ENHSP-Public; git checkout enhsp20-0.14.0; ./compile; cd ..
mkdir .planners; mv ENHSP-Public/enhsp-dist .planners/enhsp-20; rm -rf ENHSP-Public
- name: Run tests
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
- name: Download and install ENHSP
run: |
git clone https://gitlab.com/enricos83/ENHSP-Public.git
cd ENHSP-Public; git checkout enhsp20-0.13.0; ./compile; cd ..
cd ENHSP-Public; git checkout enhsp20-0.14.0; ./compile; cd ..
mkdir .planners; mv ENHSP-Public/enhsp-dist .planners/enhsp-20; rm -rf ENHSP-Public
- name: Test code-snippets
Expand Down Expand Up @@ -276,7 +276,7 @@ jobs:
- name: Download and install ENHSP
run: |
git clone https://gitlab.com/enricos83/ENHSP-Public.git
cd ENHSP-Public; git checkout enhsp20-0.13.0; bash ./compile; cd ..
cd ENHSP-Public; git checkout enhsp20-0.14.0; bash ./compile; cd ..
bash -c "mkdir .planners; mv ENHSP-Public/enhsp-dist .planners/enhsp-20; rm -rf ENHSP-Public"
- name: Run tests
Expand Down Expand Up @@ -337,7 +337,7 @@ jobs:
- name: Download and install ENHSP
run: |
git clone https://gitlab.com/enricos83/ENHSP-Public.git
cd ENHSP-Public; git checkout enhsp20-0.13.0; bash ./compile; cd ..
cd ENHSP-Public; git checkout enhsp20-0.14.0; bash ./compile; cd ..
bash -c "mkdir .planners; mv ENHSP-Public/enhsp-dist .planners/enhsp-20; rm -rf ENHSP-Public"
- name: Run tests
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ The documentation is available [here](https://unified-planning.readthedocs.io/en

More complex examples are available as notebooks [here](https://unified-planning.readthedocs.io/en/latest/examples.html).

## Staying Updated

To stay informed about project updates, announcements, and general discussions, we encourage you to join our public mailing list: (https://groups.google.com/g/unified-planning).

You can subscribe to this list to receive notifications and engage in community discussions.

## Acknowledgments

Expand Down
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@
"dev": ["tarski[arithmetic]", "pytest", "pytest-cov", "mypy"],
"grpc": ["grpcio", "grpcio-tools", "grpc-stubs"],
"tarski": ["tarski[arithmetic]"],
"pyperplan": ["up-pyperplan==1.0.0.6.dev1"],
"tamer": ["up-tamer==1.0.0.8.dev1"],
"enhsp": ["up-enhsp==0.0.23"],
"pyperplan": ["up-pyperplan~=1.1.0"],
"tamer": ["up-tamer~=1.1.0"],
"enhsp": ["up-enhsp~=0.0.24"],
"fast-downward": ["up-fast-downward==0.4.1"],
"lpg": ["up-lpg==0.0.10"],
"fmap": ["up-fmap==0.0.13"],
"aries": ["up-aries>=0.3.3"],
"symk": ["up-symk>=1.0.1"],
"symk": ["up-symk>=1.3.0"],
"engines": [
"tarski[arithmetic]",
"up-pyperplan==1.0.0.6.dev1",
"up-tamer==1.0.0.8.dev1",
"up-enhsp==0.0.23",
"up-pyperplan~=1.1.0",
"up-tamer~=1.1.0",
"up-enhsp~=0.0.24",
"up-fast-downward==0.4.1",
"up-lpg==0.0.10",
"up-fmap==0.0.13",
"up-aries>=0.3.2",
"up-symk>=1.0.1",
"up-aries>=0.3.3",
"up-symk>=1.3.0",
],
"plot": [
"plotly",
Expand Down
2 changes: 1 addition & 1 deletion unified_planning/engines/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"aries-val",
]

DEFAULT_META_ENGINES_PREFERENCE_LIST = ["oversubscription"]
DEFAULT_META_ENGINES_PREFERENCE_LIST = ["oversubscription", "replanner"]


def format_table(header: List[str], rows: List[List[str]]) -> str:
Expand Down
8 changes: 7 additions & 1 deletion unified_planning/engines/sequential_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
UPProblemDefinitionError,
)
from unified_planning.model import (
Action,
Fluent,
FNode,
ExpressionManager,
Expand Down Expand Up @@ -108,6 +109,9 @@ def __init__(
self._actions = set(self._problem.actions)
self._se = StateEvaluator(self._problem)
self._initial_state: Optional[UPState] = None
self._grounded_actions: Optional[
List[Tuple[Action, Tuple[FNode, ...], Optional[Action]]]
] = None

# Add state invariants without quantifiers to get all the grounded
# fluent instances that might modify the state invariants
Expand Down Expand Up @@ -406,7 +410,9 @@ def _get_applicable_actions(
:param state: the `state` where the formulas are evaluated.
:return: an `Iterator` of applicable actions + parameters.
"""
for original_action, params, _ in self._grounder.get_grounded_actions():
if self._grounded_actions is None:
self._grounded_actions = list(self._grounder.get_grounded_actions())
for original_action, params, _ in self._grounded_actions:
if self._is_applicable(state, original_action, params):
yield (original_action, params)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def setUp(self):
self.problems = get_example_problems()

@skipIfNoOneshotPlannerForProblemKind(
classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
full_classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
)
@skipIfNoPlanValidatorForProblemKind(
full_classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
Expand Down
13 changes: 7 additions & 6 deletions unified_planning/test/test_grounder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from unified_planning.shortcuts import *
from unified_planning.model.problem_kind import (
classical_kind,
full_classical_kind,
simple_numeric_kind,
general_numeric_kind,
bounded_types_kind,
Expand Down Expand Up @@ -83,10 +84,10 @@ def test_robot(self):
self.assertTrue(pv.validate(problem, plan))

@skipIfNoOneshotPlannerForProblemKind(
classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
full_classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
)
@skipIfNoPlanValidatorForProblemKind(
classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
full_classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
)
def test_robot_locations_connected(self):
problem = self.problems["robot_locations_connected"].problem
Expand All @@ -110,10 +111,10 @@ def test_robot_locations_connected(self):
self.assertTrue(pv.validate(problem, plan))

@skipIfNoOneshotPlannerForProblemKind(
classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
full_classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
)
@skipIfNoPlanValidatorForProblemKind(
classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
full_classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
)
def test_robot_locations_connected_from_factory(self):
problem = self.problems["robot_locations_connected"].problem
Expand Down Expand Up @@ -142,10 +143,10 @@ def test_robot_locations_connected_from_factory(self):
self.assertTrue(pv.validate(problem, plan))

@skipIfNoOneshotPlannerForProblemKind(
classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
full_classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
)
@skipIfNoPlanValidatorForProblemKind(
classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
full_classical_kind.union(simple_numeric_kind).union(bounded_types_kind)
)
def test_robot_locations_connected_from_factory_with_problem_kind(self):
problem = self.problems["robot_locations_connected"].problem
Expand Down
3 changes: 0 additions & 3 deletions up_test_cases/builtin/multiagent/logistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@ def get_test_cases():
airplane = Agent("airplane", problem)
object = UserType("object")
location = UserType("location", object)
vehicle = UserType("vehicle", object)
package = UserType("package", object)
city = UserType("city", object)
airport = UserType("airport", location)

pos = Fluent("pos", location=location)
at = Fluent("at", BoolType(), object=object, location=location)
In = Fluent("in", BoolType(), package=package, vehicle=vehicle)
on = Fluent("on", BoolType(), object=object)
in_city = Fluent("in_city", BoolType(), location=location, city=city)

Expand All @@ -33,7 +31,6 @@ def get_test_cases():
airplane.add_public_fluent(pos, default_initial_value=False)
airplane.add_public_fluent(on, default_initial_value=False)
problem.ma_environment.add_fluent(at, default_initial_value=False)
problem.ma_environment.add_fluent(In, default_initial_value=False)

load_truck = InstantaneousAction("load_truck", loc=location, obj=package)
obj = load_truck.parameter("obj")
Expand Down
7 changes: 6 additions & 1 deletion up_test_cases/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ def check_result(
else:
if planner.satisfies(OptimalityGuarantee.SOLVED_OPTIMALLY):
output += verify(
result.status is PlanGenerationResultStatus.SOLVED_OPTIMALLY,
result.status
in (
PlanGenerationResultStatus.SOLVED_OPTIMALLY,
PlanGenerationResultStatus.INTERMEDIATE,
PlanGenerationResultStatus.TIMEOUT,
),
f"Planner guarantees optimality but returned {result.status.name}",
)
else:
Expand Down

0 comments on commit 86a4f06

Please sign in to comment.