<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Frepple / Resource solver </title> <link rel='stylesheet' href='../styles.css' type='text/css' /> <!--PageHeaderFmt--> </head> <body> <div id="container"> <div id="menubar"> <div id="logo" align="center"> <br/><img src='../frepple.bmp' alt="frepple" /><br/> <a href='http://www.frepple.com/'> <strong>a Free<br/>Production Planning<br/>Library</strong> </a></div> <div id="menu"> <br/> <h3><a href='../Main/HomePage.html'>Main</a></h3> <h3><a href='../UI/Main.html'>User Manual</a></h3> <h3><a href='../Tutorial/Main.html'>Tutorial</a></h3> <h3><a href='Main.html'>Reference Manual</a></h3> <h3><a href='../Main/FAQ.html'>FAQ</a></h3> <h3><a href='../reference/index.html'>C++ API</a></h3> <br/><div> </div> </div> </div> <div id="content"> <br/> <!--PageText--> <div id='wikitext'> <p><a class='wikilink' href='../Main/HomePage.html'>Main</a> > <span class='wikitrail'><a class='wikilink' href='Main.html'>Reference Manual</a> > <a class='wikilink' href='Solver.html'>Solver algorithm</a> > <a class='wikilink' href='Solverimpl.html'>Implementation details</a> > <a class='selflink' href='Solverimplresource.html'>Resource solver</a></span> </p> <div class='vspace'></div><h2>Standard resource</h2> <p>The sequence below show the interaction between the functions checkOperationCapacity(OperationPlan*), Solve(Load*) and Solve(Resource*). </p> <p class='vspace'>An operationplan is asked to check for capacity problems (not for a date & quantity) <br />Loop through all loadplans of the operationplan </p><div class='indent'>Call the load solver <div class='indent'>If this is not an ending loadplan or it has a zero quantity, move on to the next loadplan </div><div class='indent'>Call the resource solver <div class='indent'>// Look if the operationplan overloads the resource </div><div class='indent'>Set HasOverload to false. (*) </div><div class='indent'>Start recursing backwards in the timeline starting from the ending loadplan </div><div class='indent'>While HasOverload is still false and not yet at the very start <div class='indent'>If the resource loading > maximum <div class='indent'>Break out of the while loop </div></div></div><div class='indent'>// Solve any overloads by reducing the operationplan quantity </div><div class='indent'>If HasOverload and there is a period where the resource isn't overloaded yet <div class='indent'>Resize the operationplan to fit in this time window </div><div class='indent'>If the resizing is successful <div class='indent'>There is no longer an overload problem </div><div class='indent'>Set HasOverload to false </div></div><div class='indent'>Else <div class='indent'>Restore the original time and quantity of the operationplan </div></div></div><div class='indent'>// Solve any overloads by using earlier capacity </div><div class='indent'>If HasOverload <div class='indent'>Search going back in time till the resource loading < maximum </div><div class='indent'>If available capacity was found <div class='indent'>Move the operation plan to end at that time in the timeline </div><div class='indent'>Go back to the step marked with (*) </div></div><div class='indent'>Else <div class='indent'>Reply quantity will be zero: No available capacity was found </div></div></div><div class='indent'>// Look for overloads, and try to solve them using later capacity </div><div class='indent'>If the reply quantity is 0 <div class='indent'>Find the date after the ask date where the load drops below the maximum (**) </div><div class='indent'>Move the operationplan such that it starts at this date </div><div class='indent'>If the operationplan still overloads the resource <div class='indent'>Go back to step (**) and try another, later date </div></div><div class='indent'>Else <div class='indent'>Reply quantity is 0 and the reply next-date is the end date of the moved operationplan </div></div></div></div></div><p>If in the above loop the operation plan is moved to a new date, the complete loop over all loadplans must be repeated. </p> <div class='vspace'></div><h2>Infinite resource</h2> <p>The loop is similar to the above, except that the resource solver will always reply an okay. </p> </div> <!--PageFooterFmt--> <!--HTMLFooter--> </div></div> </body> </html>