Skip to content

Omit end variables in scheduling constraints #694

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

IgnaceBleukx
Copy link
Collaborator

Proposal to omit the end variables in scheduling constraints such as Cumulative and NoOverlap.

Makes end None by default, and adapts solver behaviour accordingly.
It was not possible to make the "dummy" end variables in the constructor, as then they would be added to user_vars in the solver interface, which is incorrect.
Most solvers don't actually need the end variables in their interface either, except for OR-Tools.

Added a helper-function get_end_vars to create these dummy end variables.

@IgnaceBleukx IgnaceBleukx requested a review from Dimosts June 18, 2025 10:03
demand_at_t += demand * ((start[job] <= t) & (t < end[job]))
else:
demand_at_t += demand[job] * ((start[job] <= t) & (t < end[job]))
demand_at_t += demand[job] * ((start[job] <= t) & (start[job] + duration[job] > t))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the above? It covers the case that the demand is given as a single number

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is fixed in the constructor (already a while, but decompose was not adapted yet)

assert is_any_list(start), "start should be a list"
assert is_any_list(duration), "duration should be a list"
assert is_any_list(end), "end should be a list"

assert demand is not None, "demand should be provided but was None"
assert capacity is not None, "capacity should be provided but was None"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what should be done here, but I am not really a fan of giving them a default value (making them optional) and then not allowing the optional value.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I also agree it is quite annoying... For now this is the best I could come up with, as you cannot make an argument in the middle optional...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants