haorenhui
2023-10-30 6d6cc10d9e8e242661da7fd655dec155a09d676c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Quintiq file version 2.0
#parent: #root
Method FreezeVariableLowerBound (
  MPVariable var,
  Real lowerbound,
  Boolean isfreezewithslack
) const
{
  Description: 'Set lower bound of the variable, with scaling factor influence'
  TextBody:
  [*
    // soh yee Mar-24-2014 (created)
    
    lowerbound := this.ScaleVariable( var, lowerbound );   // scale the lower bound
    
    // (12110) Haikal Pribadi
    // Freeze small values (1e-6) to zero, but give a warning for us to eventually debug when we can reproduce
    cplexaccuracy := this.SmallestFeasibilityTolerance();
    if( abs( lowerbound ) <= cplexaccuracy )
    {
      if( 0.0 < abs( lowerbound ) )
      {
        info( "WARNING: Variable '", var.Name(), "' has encountered a lower bound value <= ",cplexaccuracy,", rounding to 0.0" );
      }
      lowerbound := 0.0;
    }
    
    if( isfreezewithslack )
    {
      lowerbound := lowerbound - 1e-4;
    }
    
    var.LowerBound( lowerbound );
  *]
  InterfaceProperties { Accessibility: 'Module' }
}