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 = requested quantity, or the demand planning policy allows planning the demand in parts or shorts then
Commit the operation plan creation
Else
Clear 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 operation plan creation
Update the planned quantity for the next iteration in the loop
Exit the loop if the demand can't be planned late