Skip to content

Commit

Permalink
Add comments to structurator (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timotshak committed Feb 7, 2024
1 parent 5775ac9 commit 40e176e
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 45 deletions.
6 changes: 3 additions & 3 deletions sampo/scheduler/genetic/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def decode(work_index):
# declare current checkpoint index
ckpt_idx = 0
start_time = assigned_parent_time - 1
pred_start_time = start_time - 1
prev_start_time = start_time - 1

def work_scheduled(args) -> bool:
idx, (work_idx, node, worker_team, contractor, exec_time, work_spec) = args
Expand Down Expand Up @@ -209,13 +209,13 @@ def work_scheduled(args) -> bool:
while len(enumerated_works_remaining) > 0:
if ckpt_idx < len(work_timeline):
start_time = work_timeline[ckpt_idx]
if pred_start_time == start_time:
if prev_start_time == start_time:
ckpt_idx += 1
continue
if start_time.is_inf():
# break because schedule already contains Time.inf(), that is incorrect schedule
break
pred_start_time = start_time
prev_start_time = start_time
else:
start_time += 1

Expand Down
1 change: 0 additions & 1 deletion sampo/structurator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from sampo.structurator.base import graph_restructuring, STAGE_SEP
from sampo.structurator.graph_insertion import graph_in_graph_insertion
from sampo.structurator.light_modifications import work_graph_ids_simplification
from sampo.structurator.base import graph_restructuring
Loading

0 comments on commit 40e176e

Please sign in to comment.