Skip to content

Commit

Permalink
[FIX] field's name for duration, values float to fraction
Browse files Browse the repository at this point in the history
  • Loading branch information
Anissa committed Nov 23, 2023
1 parent e8b81e7 commit 83a1b37
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions unified_planning/plans/ttp_to_stn.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def is_time_in_interv(
interval: "up.model.timing.TimeInterval",
) -> bool:
"""
Return if the is in the interval.
Return if the timepoint is in the interval given.
"""
time_pt = _absolute_time(timing, start=start, duration=duration)
upper_time = _absolute_time(interval._upper, start=start, duration=duration)
Expand Down Expand Up @@ -202,11 +202,11 @@ def partial_order_plan_to_stn(self) -> nx.DiGraph:
self.ai_act_map[act_end.name],
)
graph.add_edge(ai_start, ai_end)
duration = (
interval = (
self.act_to_time_map[act_end.name]
- self.act_to_time_map[act_start.name]
)
graph[ai_start][ai_end]["interval"] = [duration, duration]
graph[ai_start][ai_end]["interval"] = [interval, interval]

# Add start and end nodes

Expand All @@ -219,7 +219,7 @@ def partial_order_plan_to_stn(self) -> nx.DiGraph:
graph.add_edge(
start,
list(self.partial_order_plan.get_adjacency_list.keys())[0],
interval=[0.0, 0.0],
interval=[Fraction(0, 1), Fraction(0, 1)],
)
# Add edge between end and last node
graph.add_edge(
Expand All @@ -231,7 +231,7 @@ def partial_order_plan_to_stn(self) -> nx.DiGraph:
if item.action._name != "START" and item.action._name != "END"
][0],
end,
interval=[0.0, 0.0],
interval=[Fraction(0, 1), Fraction(0, 1)],
)

self.stn = graph
Expand Down

0 comments on commit 83a1b37

Please sign in to comment.