Package org.encog.ml.ea.sort

Examples of org.encog.ml.ea.sort.MaximizeAdjustedScoreComp


    // set the score compare method
    if (theScoreFunction.shouldMinimize()) {
      this.selectionComparator = new MinimizeAdjustedScoreComp();
      this.bestComparator = new MinimizeScoreComp();
    } else {
      this.selectionComparator = new MaximizeAdjustedScoreComp();
      this.bestComparator = new MaximizeScoreComp();
    }

    // set the iteration
    for (final Species species : thePopulation.getSpecies()) {
View Full Code Here


   
    BasicGenome genome2 = new IntegerArrayGenome(1);
    genome2.setAdjustedScore(4);
    genome2.setScore(10);

    MaximizeAdjustedScoreComp comp = new MaximizeAdjustedScoreComp();
   
    Assert.assertTrue(comp.compare(genome1, genome2)<0);
  }
View Full Code Here

    Assert.assertTrue(comp.compare(genome1, genome2)<0);
  }
 
  @Test
  public void testIsBetterThan() {
    MaximizeAdjustedScoreComp comp = new MaximizeAdjustedScoreComp();
    Assert.assertFalse(comp.isBetterThan(10, 20));
  }
View Full Code Here

    Assert.assertFalse(comp.isBetterThan(10, 20));
  }
 
  @Test
  public void testShouldMinimize() {
    MaximizeAdjustedScoreComp comp = new MaximizeAdjustedScoreComp();
    Assert.assertFalse(comp.shouldMinimize());
  }
View Full Code Here

    Assert.assertFalse(comp.shouldMinimize());
  }
 
  @Test
  public void testApplyBonus() {
    MaximizeAdjustedScoreComp comp = new MaximizeAdjustedScoreComp();
    Assert.assertEquals(11, comp.applyBonus(10, 0.1), Encog.DEFAULT_DOUBLE_EQUAL);
  }
View Full Code Here

    Assert.assertEquals(11, comp.applyBonus(10, 0.1), Encog.DEFAULT_DOUBLE_EQUAL);
  }
 
  @Test
  public void testApplyPenalty() {
    MaximizeAdjustedScoreComp comp = new MaximizeAdjustedScoreComp();
    Assert.assertEquals(9, comp.applyPenalty(10, 0.1), Encog.DEFAULT_DOUBLE_EQUAL);
  }
View Full Code Here

TOP

Related Classes of org.encog.ml.ea.sort.MaximizeAdjustedScoreComp

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.