コード例 #1
0
        public int CompareToByObjective(IndividualBase another, Objective objective)
        {
            double individualAttributeValue        = GetFitnessForObjective(objective);
            double anotherIndividualAttributeValue = another.GetFitnessForObjective(objective);

            if (anotherIndividualAttributeValue > individualAttributeValue)
            {
                return(-1);
            }
            else if (anotherIndividualAttributeValue == individualAttributeValue)
            {
                return(0);
            }
            else
            {
                return(1);
            }
        }
コード例 #2
0
        public bool Dominates(IndividualBase another)
        {
            bool dominatesInAnObjective = false;

            foreach (Objective objective in Problem.MultiObjectiveGoal)
            {
                double individualAttributeValue        = GetFitnessForObjective(objective);
                double anotherIndividualAttributeValue = another.GetFitnessForObjective(objective);
                if (individualAttributeValue > anotherIndividualAttributeValue)
                {
                    dominatesInAnObjective = true;
                }
                else if (individualAttributeValue < anotherIndividualAttributeValue)
                {
                    return(false);
                }
            }
            if (dominatesInAnObjective)
            {
                return(true);
            }
            return(false);
        }
コード例 #3
0
        public int CompareToByObjective(IndividualBase another, Objective objective)
        {
            double individualAttributeValue = GetFitnessForObjective(objective);
            double anotherIndividualAttributeValue = another.GetFitnessForObjective(objective);

            if (anotherIndividualAttributeValue > individualAttributeValue)
                return -1;
            else if (anotherIndividualAttributeValue == individualAttributeValue)
                return 0;
            else
                return 1;
        }
コード例 #4
0
        public bool IsDominatedBy(IndividualBase another)
        {
            bool dominatedInAnObjective = false;

            foreach (Objective objective in Problem.MultiObjectiveGoal) {
                double individualAttributeValue = GetFitnessForObjective(objective);
                double anotherIndividualAttributeValue = another.GetFitnessForObjective(objective);
                if (individualAttributeValue > anotherIndividualAttributeValue)
                    return false;
                else if (individualAttributeValue < anotherIndividualAttributeValue) {
                    dominatedInAnObjective = true;
                }
            }
            if (dominatedInAnObjective)
                return true;
            return false;
        }