private double GetVariableValue(Variable variable) { double result; if (SolutionType.GetType() == typeof(BinaryRealSolutionType)) { result = ((BinaryReal)variable).Value; } else { result = ((Real)variable).Value; } return(result); }
private double[] GetVariableValues(Solution solution) { double[] x = new double[3]; if (SolutionType.GetType() == typeof(BinaryRealSolutionType)) { x[0] = ((BinaryReal)solution.Variable[0]).Value; x[1] = ((BinaryReal)solution.Variable[1]).Value; x[2] = ((BinaryReal)solution.Variable[2]).Value; } else { x[0] = ((Real)solution.Variable[0]).Value; x[1] = ((Real)solution.Variable[1]).Value; x[2] = ((Real)solution.Variable[2]).Value; } return(x); }