Skip to content

Commit

Permalink
refactoring: added new file for natural transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Gobbi committed Dec 2, 2024
1 parent 60756fc commit a008444
Show file tree
Hide file tree
Showing 6 changed files with 557 additions and 514 deletions.
8 changes: 6 additions & 2 deletions unified_planning/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@
SensingAction,
)

from unified_planning.model.transition import (
Transition,
from unified_planning.model.natural_transition import (
NaturalTransition,
Process,
Event,
)

from unified_planning.model.transition import (
Transition,
)
from unified_planning.model.effect import Effect, SimulatedEffect, EffectKind
from unified_planning.model.expression import (
BoolExpression,
Expand Down
8 changes: 4 additions & 4 deletions unified_planning/model/mixins/actions_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,23 +83,23 @@ def durative_actions(self) -> Iterator["up.model.action.DurativeAction"]:
yield a

@property
def processes(self) -> Iterator["up.model.transition.Process"]:
def processes(self) -> Iterator["up.model.natural_transition.Process"]:
"""Returs all the sensing actions of the problem.
IMPORTANT NOTE: this property does some computation, so it should be called as
seldom as possible."""
for a in self._actions:
if isinstance(a, up.model.transition.Process):
if isinstance(a, up.model.natural_transition.Process):
yield a

@property
def events(self) -> Iterator["up.model.transition.Event"]:
def events(self) -> Iterator["up.model.natural_transition.Event"]:
"""Returs all the sensing actions of the problem.
IMPORTANT NOTE: this property does some computation, so it should be called as
seldom as possible."""
for a in self._actions:
if isinstance(a, up.model.transition.Event):
if isinstance(a, up.model.natural_transition.Event):
yield a

@property
Expand Down
Loading

0 comments on commit a008444

Please sign in to comment.