Skip to content

Commit

Permalink
chore: removed leftover code
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Gobbi committed Jan 24, 2025
1 parent 9bc7687 commit a5f7f61
Showing 1 changed file with 2 additions and 45 deletions.
47 changes: 2 additions & 45 deletions unified_planning/model/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,52 +369,9 @@ def is_conditional(self) -> bool:
def clear_continuous_effects(self):
self._continuous_effects = {}

def _add_continuous_effect(
self,
fluent: Union["up.model.fnode.FNode", "up.model.fluent.Fluent"],
value: "up.model.expression.Expression",
negative: bool,
):

(
fluent_exp,
value_exp,
condition_exp,
) = self._environment.expression_manager.auto_promote(
fluent,
value,
True,
)
if not fluent_exp.is_fluent_exp() and not fluent_exp.is_dot():
raise UPUsageError(
"fluent field of add_increase_effect must be a Fluent or a FluentExp or a Dot."
)
if not fluent_exp.type.is_compatible(value_exp.type):
raise UPTypeError(
f"Process effect has an incompatible value type. Fluent type: {fluent_exp.type} // Value type: {value_exp.type}"
)
if not fluent_exp.type.is_int_type() and not fluent_exp.type.is_real_type():
raise UPTypeError("Derivative can be created only on numeric types!")
e_kind = up.model.effect.EffectKind.CONTINUOUS_INCREASE

if negative:
e_kind = up.model.effect.EffectKind.CONTINUOUS_DECREASE
self._add_effect_instance(
StartTiming(),
up.model.effect.Effect(
fluent_exp,
value_exp,
condition_exp,
kind=e_kind,
forall=tuple(),
),
)

def has_continuous_effects(self):
for t, el in self._continuous_effects.items():
for e in el:
if e.is_continuous_increase() or e.is_continuous_decrease():
return True
if len(self._continuous_effects) > 0:
return True
return False

def add_increase_continuous_effect(
Expand Down

0 comments on commit a5f7f61

Please sign in to comment.