Skip to content

Commit

Permalink
fixed extraction of expanded tasks
Browse files Browse the repository at this point in the history
The function has generated wrong execution order if processes have the same ID
  • Loading branch information
ak-cube committed Nov 22, 2024
1 parent 27a457a commit 5755abc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": ["C:\\Scripts\\rushti\\tasks_opt_case2.txt","4","opt"]
}
]
}
Binary file added __pycache__/utils.cpython-310.pyc
Binary file not shown.
8 changes: 6 additions & 2 deletions rushti.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,16 @@ def extract_tasks_from_file_type_opt(
tasks[task.id].append(task)

# expand tasks
expanded_tasks = dict()
if expand:
for task_id in tasks:
for task in tasks[task_id]:
for expanded_task in expand_task(tm1_services, task):
tasks[task.id].append(expanded_task)
tasks[task.id].remove(task)
if task.id not in expanded_tasks:
expanded_tasks[task.id] = [expanded_task]
else:
expanded_tasks[task.id].append(expanded_task)
tasks = expanded_tasks

# Populate the successors attribute
for task_id in tasks:
Expand Down

0 comments on commit 5755abc

Please sign in to comment.