Main > Reference Manual > Solver algorithm > Implementation details > Resource solver
Standard resource
The sequence below show the interaction between the functions checkOperationCapacity(OperationPlan*), Solve(Load*) and Solve(Resource*).
An operationplan is asked to check for capacity problems (not for a date & quantity)
Loop through all loadplans of the operationplan
Call the load solver
If this is not an ending loadplan or it has a zero quantity, move on to the next loadplan
Call the resource solver
// Look if the operationplan overloads the resource
Set HasOverload to false. (*)
Start recursing backwards in the timeline starting from the ending loadplan
While HasOverload is still false and not yet at the very start
If the resource loading > maximum
Break out of the while loop
// Solve any overloads by reducing the operationplan quantity
If HasOverload and there is a period where the resource isn't overloaded yet
Resize the operationplan to fit in this time window
If the resizing is successful
There is no longer an overload problem
Set HasOverload to false
Else
Restore the original time and quantity of the operationplan
// Solve any overloads by using earlier capacity
If HasOverload
Search going back in time till the resource loading < maximum
If available capacity was found
Move the operation plan to end at that time in the timeline
Go back to the step marked with (*)
Else
Reply quantity will be zero: No available capacity was found
// Look for overloads, and try to solve them using later capacity
If the reply quantity is 0
Find the date after the ask date where the load drops below the maximum (**)
Move the operationplan such that it starts at this date
If the operationplan still overloads the resource
Go back to step (**) and try another, later date
Else
Reply quantity is 0 and the reply next-date is the end date of the moved operationplan
If in the above loop the operation plan is moved to a new date, the complete loop over all loadplans must be repeated.
Infinite resource
The loop is similar to the above, except that the resource solver will always reply an okay.