/// <summary>
 /// Returns the <see cref="System.Int32"/> value corresponding to the
 /// <paramref name="value"/>.
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public static int ToInt(this EvaluatorStrategy value)
 {
     try
     {
         return(LazyEvaluatorStrategyValues.Value[value]);
     }
     catch (Exception ex)
     {
         throw new ArgumentException($"{value} not currently supported by Google Operational Research Tools.", nameof(value), ex);
     }
 }
Example #2
0
 /// <summary>
 /// Provides a helpful C-Sharp friendly extension method for <see
 /// cref="Solver.MakePhase(IntVarVector, VariableChooser, int)"/>.
 /// </summary>
 /// <param name="solver"></param>
 /// <param name="variables"></param>
 /// <param name="varChooser"></param>
 /// <param name="evalStrategy"></param>
 /// <returns></returns>
 public static DecisionBuilder MakePhase(this Solver solver, IntVarVector variables,
                                         VariableChooser varChooser, EvaluatorStrategy evalStrategy)
 => solver.MakePhase(variables, varChooser, evalStrategy.ToInt());