BetterFeasible() public static method

Return whether feasibility (constraint satisfaction) of new candidate solution is same as or better than feasibility of old candidate solution.
public static BetterFeasible ( bool oldFeasible, bool newFeasible ) : bool
oldFeasible bool Feasibility of old candidate solution.
newFeasible bool Feasibility of new candidate solution.
return bool
Example #1
0
        /// <summary>
        /// Compute and return fitness for the given parameters.
        /// The fitness evaluation is aborted preemptively if
        /// feasibility of the new candidate solution is same or better
        /// as that of the old candidate solution, and if the
        /// fitness becomes higher (i.e. worse) than fitnessLimit and
        /// if it is not possible for the fitness to improve.
        /// </summary>
        /// <param name="parameters">Candidate solution.</param>
        /// <param name="fitnessLimit">Preemptive Fitness Limit.</param>
        /// <param name="newFeasible">Feasibility of old candidate solution.</param>
        /// <param name="oldFeasible">Feasibility of new candidate solution.</param>
        public virtual double Fitness(double[] parameters, double fitnessLimit, bool oldFeasible, bool newFeasible)
        {
            double fitness;

            if (Tools.BetterFeasible(oldFeasible, newFeasible))
            {
                fitness = Fitness(parameters, fitnessLimit);
            }
            else
            {
                fitness = Fitness(parameters);
            }

            return(fitness);
        }
Example #2
0
 /// <summary>
 /// Compute and return fitness for the given parameters.
 /// The fitness evaluation is aborted preemptively if
 /// feasibility of the new candidate solution is same or better
 /// as that of the old candidate solution, and if the
 /// fitness becomes higher (i.e. worse) than fitnessLimit and
 /// if it is not possible for the fitness to improve.
 /// </summary>
 /// <param name="parameters">Candidate solution.</param>
 /// <param name="fitnessLimit">Preemptive Fitness Limit.</param>
 /// <param name="newFeasible">Feasibility of old candidate solution.</param>
 /// <param name="oldFeasible">Feasibility of new candidate solution.</param>
 public virtual double Fitness(double[] parameters, double fitnessLimit, bool oldFeasible, bool newFeasible)
 {
     return(Tools.BetterFeasible(oldFeasible, newFeasible)
         ? Fitness(parameters, fitnessLimit) : Fitness(parameters));
 }