Skip to content

Commit

Permalink
more correct parsing of skill data for resource, in the no skill_leve…
Browse files Browse the repository at this point in the history
…l_version mode
  • Loading branch information
g-poveda committed Oct 21, 2024
1 parent 4f1d346 commit fb52b6e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions discrete_optimization/rcpsp_multiskill/parser_mslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,14 @@ def parse_file(file_path, skill_level_version: bool = True):
successors_dict[index_task] = []
logger.debug(f"successors dict : {successors_dict}")
logger.debug(f"mode_details : {mode_details}")

index_workforce_module = next(
j for j in range(len(f)) if "* Workforce Module *" in f[j]
)
index_workforce_module = next(
j for j in range(len(f)) if "Workforce Module with Skill Levels" in f[j]
)
if not skill_level_version:
index_workforce_module = next(
j for j in range(len(f)) if "* Workforce Module *" in f[j]
)
else:
index_workforce_module = next(
j for j in range(len(f)) if "Workforce Module with Skill Levels" in f[j]
)
lines_workforce = range(
index_workforce_module + 1, index_workforce_module + 1 + number_units
)
Expand Down

0 comments on commit fb52b6e

Please sign in to comment.