Skip to content

Commit

Permalink
Minor doc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Framba-Luca committed Jan 15, 2024
1 parent 1306b46 commit 34e1599
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions unified_planning/plans/time_triggered_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,10 @@ def _get_timepoint_conditions(
start: Fraction,
duration: Fraction,
) -> List[FNode]:
# Returns the List of conditions of the given action in the given timing
# start and duration are the start and duration of the given action
"""
Returns the List of conditions of the given action in the given timing.
start and duration are the start and duration of the given action
"""
timepoint_conditions: List[FNode] = []
for time_interval, cond_list in action.conditions.items():
if _is_time_in_interv(start, duration, timing, time_interval):
Expand All @@ -426,8 +428,10 @@ def _get_timepoint_effects(
start: Fraction,
duration: Fraction,
) -> List[Effect]:
# Returns the List of effects of the given action in the given timing
# start and duration are the start and duration of the given action
"""
Returns the List of effects of the given action in the given timing.
start and duration are the start and duration of the given action
"""
timepoint_effects = []
for effects_timing, el in action.effects.items():
absolute_effect_time = _absolute_time(effects_timing, start, duration)
Expand All @@ -442,8 +446,10 @@ def _get_timepoint_simulated_effects(
start: Fraction,
duration: Fraction,
) -> Optional[SimulatedEffect]:
# Returns the simulated effect of the given action in the given timing
# start and duration are the start and duration of the given action
"""
Returns the simulated effect of the given action in the given timing.
start and duration are the start and duration of the given action
"""
sim_eff: Optional[SimulatedEffect] = None
for se_timing, se in action.simulated_effects.items():
absolute_effect_time = _absolute_time(se_timing, start, duration)
Expand All @@ -463,10 +469,12 @@ def _extract_action_timings(
duration: Fraction,
epsilon: Fraction = Fraction(0),
) -> Set[Fraction]:
# Extracts all the interesting timings of the action. So timings where:
# - a condition start/ends
# - an effect takes place
# - a simulated effects takes place
"""
Extracts all the interesting timings of the action. So timings where:
- a condition start/ends
- an effect takes place
- a simulated effects takes place
"""
timings: Set[Fraction] = set()

absolute_time = lambda timing: _absolute_time(timing, start, duration)
Expand All @@ -486,10 +494,12 @@ def _extract_action_timings(
def _extract_instantenous_actions(
action: DurativeAction, start: Fraction, duration: Fraction, epsilon: Fraction
) -> Iterator[Tuple[Fraction, InstantaneousAction]]:
# Splits a DurativeAction into one the InstantaneousActions that compose the DurativeAction.
# For example, an action that has an effect at start and one at the end, will be split into 2
# InstantaneousActions, the first one representing the start and the last one representing the
# end. This method creates an Action for every timing returned by "_extract_action_timings"
"""
Splits a DurativeAction into the InstantaneousActions that compose the DurativeAction.
For example, an action that has an effect at start and one at the end, will be split into 2
InstantaneousActions, the first one representing the start and the last one representing the
end. This method creates an Action for every timing returned by "_extract_action_timings"
"""
for i, timing in enumerate(
_extract_action_timings(action, start, duration, epsilon)
):
Expand Down

0 comments on commit 34e1599

Please sign in to comment.