Variable Demand in Reservoir Constraints #4586
Unanswered
variola-m
asked this question in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What language and solver does this apply to?
Python
Describe the problem you are trying to solve.
We're trying to simulate the inventory of multiple batch-machines. The in-/out-flow at each time step is variable and depends on each other: if the total production-batch is 100kg and machine A produces 30kg, then machine B needs to produce 70kg. Because we have other machines that consume these batches, we need a reservoir to track the inventories over time and make sure that it doesn't become negative.
This seems only possible with a reservoir constraint if the demands can contain integer variables. If I understood the code correctly, it already contains an implementation of a reservoir expanding algorithm that can handle variable demands, namely
ExpandReservoirUsingCircuit
, which could in theory be enabled with the sat-parameterexpand_reservoir_using_circuit=True
. Setting this toTrue
still runs in an error during model validation inValidateReservoirConstraint
, as you do a hard check that demands are constant.Describe the solution you'd like
Setting
expand_reservoir_using_circuit
insat_parameters.proto
toTrue
should adjust the model validation and not run the part inValidateReservoirConstraint
that checks for constants.Describe alternatives you've considered
A setting exists with which the model validation can be disabled by the user, as the rest of the code should run fine.
Additional context
expand_reservoir_using_circuit
setting inortools.sat.sat_paramters.proto
with comment that explains variable demands are supportedThere already exists a
todo
comment to allow the user to disable the validationortools.sat.cp_model_solver.cc
:Beta Was this translation helpful? Give feedback.
All reactions