Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugs in rcpsp multiskill calendars utils and cpsat solver #299

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion discrete_optimization/rcpsp_multiskill/rcpsp_multiskill.py
Original file line number Diff line number Diff line change
Expand Up @@ -3067,7 +3067,9 @@ def create_fake_tasks_multiskills(

def compute_skills_calendar(problem: MS_RCPSPModel):
skills = problem.skills_set
dict_calendar_skills = {s: np.zeros(problem.horizon + 1) for s in skills}
some_employee = next(emp for emp in problem.employees)
len_calendar = len(problem.employees[some_employee].calendar_employee)
dict_calendar_skills = {s: np.zeros(len_calendar) for s in skills}
for emp in problem.employees:
emp_object = problem.employees[emp]
for s in emp_object.get_non_zero_skills():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,9 @@ def constraint_redundant_cumulative_skills(self):
)

def constraint_redundant_cumulative_worker(self):
merged_calendar = np.zeros(self.problem.horizon + 1)
some_employee = next(emp for emp in self.problem.employees)
len_calendar = len(self.problem.employees[some_employee].calendar_employee)
merged_calendar = np.zeros(len_calendar)
for emp in self.problem.employees:
merged_calendar += np.array(self.problem.employees[emp].calendar_employee)
discr_calendar = discretize_calendar_(merged_calendar)
Expand Down
Loading