/// <summary> /// Changes the LP models aim to the specified <see cref="OptimizationAim"/>. /// </summary> /// <param name="model">The LP model whose optimization aim will be changed.</param> /// <returns>The LP model having the selected optimization aim.</returns> internal static LPModel ChangeOptimizationAimTo(this LPModel model, OptimizationAim aim) { if (model.Objective.Aim != aim) { model.Objective.Aim = aim; model.Objective.Function.Multiply(-1); // multiplying both sides of the function adds a minus sign (-) prefix to to funtion name - we don't want to leave this model.Objective.Function.LeftSide.Single().SignedCoefficient *= -1; } return(model); }
public Objective(OptimizationAim aim, Equation function) { Aim = aim; Function = function; }