One case in the boxes score. Position the boxes at random locations.
コード例 #1
0
        public double CalculateScore(IMLMethod phenotype)
        {
            BoxTrialCase    test = new BoxTrialCase(new Random());
            TrialEvaluation eval = new TrialEvaluation(phenotype, test);

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 25; j++)
                {
                    IntPair targetPos = eval.Test.InitTestCase(i);
                    IntPair actualPos = eval.Query(this.resolution);

                    eval.Accumulate(
                        CalcRealDistanceSquared(targetPos, actualPos),
                        Math.Max(0.0, eval.MaxActivation - eval.MinActivation));
                }
            }

            return(eval.CalculateFitness());
        }
コード例 #2
0
ファイル: BoxesScore.cs プロジェクト: legendvijay/aifh
        public double CalculateScore(IMLMethod phenotype)
        {
            BoxTrialCase test = new BoxTrialCase(new Random());
            TrialEvaluation eval = new TrialEvaluation(phenotype, test);

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 25; j++)
                {
                    IntPair targetPos = eval.Test.InitTestCase(i);
                    IntPair actualPos = eval.Query(this.resolution);

                    eval.Accumulate(
                            CalcRealDistanceSquared(targetPos, actualPos),
                            Math.Max(0.0, eval.MaxActivation - eval.MinActivation));
                }
            }

            return eval.CalculateFitness();
        }
コード例 #3
0
 public TrialEvaluation(IMLMethod thePhenotype, BoxTrialCase theTest)
 {
     this.phenotype = thePhenotype;
     this.test      = theTest;
 }
コード例 #4
0
ファイル: TrialEvaluation.cs プロジェクト: legendvijay/aifh
 public TrialEvaluation(IMLMethod thePhenotype, BoxTrialCase theTest)
 {
     this.phenotype = thePhenotype;
     this.test = theTest;
 }