Esempio n. 1
0
 public void Write(FitnessAssignedScores <double> worstPoint, IDictionary <string, string> tags)
 {
     if (log.IsInfoEnabled)
     {
         log.Info(new SysConfigLogInfo(new IObjectiveScores[] { worstPoint.Scores }, tags));
     }
 }
Esempio n. 2
0
 public static void Write(FitnessAssignedScores <double> scores, IDictionary <string, string> tags, ILoggerMh logger)
 {
     if (logger != null)
     {
         logger.Write(scores, tags);
     }
 }
Esempio n. 3
0
        public FitnessAssignedScores <double>[] AssignFitness(IObjectiveScores[] scores)
        {
            FitnessAssignedScores <double>[] result = new FitnessAssignedScores <double> [scores.Length];

            for (int i = 0; i < result.Length; i++)
            {
                result[i] = new FitnessAssignedScores <double>(scores[i], (-(double)scores[i].GetObjective(0).ValueComparable));
            }

            return(result);
        }
        public FitnessAssignedScores <double>[] AssignFitness(IObjectiveScores[] scores)
        {
            FitnessAssignedScores <double>[] result = new FitnessAssignedScores <double> [scores.Length];

            for (int i = 0; i < result.Length; i++)
            {
                double fitness = (double)scores[i].GetObjective(0).ValueComparable
                                 - 5 * Math.Pow(Math.Abs(Math.Log(1 + (double)scores[i].GetObjective(1).ValueComparable)), 2.5);
                result[i] = new FitnessAssignedScores <double>(scores[i], (-fitness));
            }

            return(result);
        }
        public FitnessAssignedScores <double>[] AssignFitness(IObjectiveScores[] scores)
        {
            var paretoRanking = new ParetoRanking <IObjectiveScores>(scores);

            IObjectiveScores[] nonDominated          = paretoRanking.GetParetoRank(1);
            IObjectiveScores[] dominated             = paretoRanking.GetDominatedByParetoRank(1);
            double[]           fitnessesNonDominated = new double[nonDominated.Length];
            double[]           fitnessesDominated    = new double[dominated.Length];
            for (int j = 0; j < nonDominated.Length; j++)
            {
                fitnessesNonDominated[j] = (double)paretoRanking.GetNumDominated(nonDominated[j], dominated) / scores.Length;
            }
            for (int j = 0; j < dominated.Length; j++)
            {
                double fitness = 1.0;
                for (int k = 0; k < nonDominated.Length; k++)
                {
                    if (paretoRanking.IsDominated(dominated[j], nonDominated[k]))
                    {
                        fitness += fitnessesNonDominated[k];
                    }
                }
                fitnessesDominated[j] = fitness;
            }
            List <double> fitnesses = new List <double>( );

            fitnesses.AddRange(fitnessesNonDominated);
            fitnesses.AddRange(fitnessesDominated);
            List <IObjectiveScores> orderedScores = new List <IObjectiveScores>( );

            orderedScores.AddRange(nonDominated);
            orderedScores.AddRange(dominated);
            FitnessAssignedScores <double>[] result = new FitnessAssignedScores <double> [fitnesses.Count];
            for (int i = 0; i < fitnesses.Count; i++)
            {
                result[i] = new FitnessAssignedScores <double>(orderedScores[i], fitnesses[i]);
            }
            return(result);
        }
Esempio n. 6
0
 private double getFitness( FitnessAssignedScores<double>[] fittedScores, MockDualObjective objective )
 {
     foreach( var item in fittedScores )
         if( item.Scores == objective )
             return item.FitnessValue;
     throw new ArgumentException( "Objective not found in the list of points with associated fitnesses" );
 }
Esempio n. 7
0
 public void Write(FitnessAssignedScores<double> worstPoint, IDictionary<string, string> tags)
 {
     if (log.IsInfoEnabled)
         log.Info(new SysConfigLogInfo(new IObjectiveScores[] { worstPoint.Scores }, tags));
 }
Esempio n. 8
0
 public void Write(FitnessAssignedScores <double> worstPoint, IDictionary <string, string> tags)
 {
     queue.Enqueue(new SysConfigLogInfo(new IObjectiveScores[] { worstPoint.Scores }, tags));
 }