Quintiq file version 2.0
|
#parent: #root
|
MethodOverride Initialize (
|
const LibOpt_Task task,
|
MathematicalProgram program_basetype
|
)
|
{
|
TextBody:
|
[*
|
debuginfo( 'Synchronous start = ', DateTime::ActualTime() );
|
scope := task.Scope();
|
runcontext := this.GetRunContextConst();
|
pispipssmartplan := scope.GetSmartPlanPISPIPsInOptimizerRunConst();
|
|
userperiodtasks := runcontext.GetUserPeriodTaskOperationsConst();
|
userproductintrips :=runcontext.GetUserProductInTrips();
|
pispipsinrun := scope.GetPISPIPInOptimizerRunConst();
|
leafpispipsinrun := selectset( pispipsinrun, Elements.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispip, true, true );
|
pispsinrun := scope.GetProductInStockingPointInOptimizerRunConst();
|
pitinrun := scope.GetProductInTripInOptimizerRunConst();
|
|
// use Algorithm_MP to create the math program
|
program := program_basetype.astype( CapacityPlanningSuboptimizer_CapacityPlanningAlgorithm );
|
|
this.CapacityPlanningAlgorithmInitInstance( program, runcontext, scope );
|
|
this.CapacityPlanningAlgorithmInitVariables( program, runcontext, userperiodtasks, userproductintrips, pispipssmartplan, scope, pispipsinrun, leafpispipsinrun, pispsinrun, pitinrun );
|
|
this.SetStartSolutionForPTLotSizes( program, runcontext, scope );
|
|
this.SetStartSolutionForCampaignSequencing( program, runcontext, scope );
|
|
this.CapacityPlanningAlgorithmInitGoals( program, runcontext, scope );// workaround we should add the goal after cloning because otherwise the goal term constant become = nr of threads.
|
|
this.CapacityPlanningAlgorithmInitConstraints_ParallelTypeA( program, pispipssmartplan, userperiodtasks, task, pispipsinrun, leafpispipsinrun, pispsinrun, pitinrun );
|
|
this.CapacityPlanningAlgorithmInitConstraints_ParallelTypeB( program, pispipssmartplan, task, pispipsinrun, leafpispipsinrun, pispsinrun, pitinrun );
|
|
this.CapacityPlanningAlgorithmInitConstraints_ParallelTypeC( program, pispipssmartplan, task, pispipsinrun, leafpispipsinrun, pispsinrun, pitinrun );
|
|
// note we run this.FilterCPLEXNoiseInitialization( program, runcontext ) in above parallel threads (filters RHS of constraints)
|
// meaning this filtering is excluded from any constraints added below.
|
|
this.InitConstraintsSequentialAtEnd( program, runcontext, scope, leafpispipsinrun );
|
|
//Generate names for debugging purposes
|
//this method should already generate names only if needed (sav file saved, MPAnalysis on,...) so no need to add an if statement
|
program.GenerateNames()
|
isdisplay := not runcontext.IsInventoryOptimizationRun();
|
if( isdisplay )
|
{
|
progress( 'Invoking CPLEX', DateTime::ActualTime() );
|
info( 'Invoking CPLEX', DateTime::ActualTime() );
|
}
|
*]
|
}
|