Quintiq file version 2.0
|
#parent: #root
|
StaticMethod CheckVariables (
|
SnapshotMacroPlannerOptimizer snapshot,
|
CapacityPlanningSuboptimizer_CapacityPlanningAlgorithm program
|
)
|
{
|
TextBody:
|
[*
|
variableboundthreshold := 1e-4;
|
intvarthreshold := 1e-5;
|
traverse( program, Variables, var )
|
{
|
lowerboundviolation := guard( maxvalue( var.LowerBound() - var.OptimalValue(), 0.0 ), 0.0 );
|
upperboundviolation := guard( maxvalue( var.OptimalValue() - var.UpperBound(), 0.0 ), 0.0 );
|
epsilon := ifexpr( var.VariableType() = 'Continuous', variableboundthreshold, intvarthreshold );
|
if ( lowerboundviolation > epsilon
|
or upperboundviolation > epsilon )
|
{
|
logentry := snapshot.OptimizerDebugCPLEXLogEntry( relnew, OptimizerDebugCPLEXLogEntryMPVariable );
|
logentry.VariableName( var.Name() );
|
logentry.LowerBoundViolation( lowerboundviolation );
|
logentry.LowerBound( var.LowerBound() );
|
logentry.UpperBoundViolation( upperboundviolation );
|
logentry.UpperBound ( var.UpperBound() );
|
logentry.OptimalValue( var.OptimalValue() );
|
logentry.VariableTypeName( typeofexpression( var ).ShortName() );
|
}
|
}
|
*]
|
}
|