Main > Reference Manual > Solver algorithm > Implementation details > Demand solver
Ignore the demand if quantity is 0
Erase previous delivery operation plans, except the ones that are locked
Loop until the full demand quantity is planned.
Call operation->ask(missing quantity,due date), where operation is the demand's or the items delivery operation
If planned quantity = 0 then
Call operation->ask(minimum delivery quantity,due date)
If the planned quantity is non-zero this time then
Iteratively try to plan increasing quantities to find the maximum feasible quantity
If planned quantity = requested quantity, or the demand planning policy allows planning the demand in parts or shorts then
Commit the operation plan creation
Else
Rollback the list of scheduled operation plans
If planned quantity > 0 then
// This last step is required to make sure all supplying paths are planned for the quantity of the most constraining path
Call operation->ask(planned quantity, due date)
Commit the list of scheduled operation plans
Update the planned quantity for the next iteration in the loop
Exit the loop if the demand can't be planned late