public void Configure(string algorithmType, int size, string objectiveType) { Algorithm alg = Enum.Parse(typeof(Algorithm), algorithmType.ToUpper()); _optimizer = new NLOptWrapper(alg, size); // Parse out objectiveType. It can be either a string for // MINIMUM_OBJECTIVE or MAXIMUM_OBJECTIVE FunctionType function = Enum.Parse(typeof(FunctionType), objectiveType.ToUpper()); _optimizer.AddFunction(function, _objectiveFunction, null, 0.0); }