| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod GetConstraintScaleType ( | 
|   String constrname | 
| ) const as Number | 
| { | 
|   TextBody: | 
|   [* | 
|     scalingtype := Optimization::ScalingTypeNameNone(); | 
|      | 
|     constraintscalingtype := ScaleTypeMP::FindScaleType( constrname, ScaleTypeMP::GetStringConstraintType() ); | 
|        | 
|     if( not isnull( constraintscalingtype ) ) | 
|     { | 
|       scalingtype := constraintscalingtype.ScaleType(); | 
|     } | 
|     else if ( constrname.StartsWith( typeof( MPGoalConstraint ).ShortName() ) )  | 
|     { | 
|       // what level? This case is actually unused | 
|       found := false;  | 
|       for ( level := 0; level <= 10 and not found; level++ )  | 
|       { | 
|         str := typeof( MPGoalConstraint ).ShortName();   | 
|         if ( constrname.StartsWith( str + [String] level) )  | 
|         {                                                                                                         | 
|           scalingtype := Optimization::ScalingTypeNameGoal( level );  | 
|           found := true;  | 
|         } | 
|       } | 
|       debuginfo( constrname, ' found = ', scalingtype );                                                          | 
|     } | 
|      | 
|     else | 
|     { | 
|       scalingtype := Optimization::ScalingTypeNameNone(); | 
|       info( ">>> Algorithm.GetConstraintScaleType: Scaling factor type for constraint [" + constrname + "] is not yet defined" ); | 
|     }   | 
|      | 
|     return scalingtype; | 
|   *] | 
|   InterfaceProperties { Accessibility: 'Module' } | 
| } |