1 package examples.gp.tictactoe; 2 3 import org.jgap.gp.*; 4 import org.jgap.gp.impl.*; 5 import junit.framework.*; 6 7 public class TicTacToeTest 8 extends GPTestCase { 9 10 private final static String CVS_REVISION = "$Revision: 1.1 $"; 11 12 public static Test suite() { 13 TestSuite suite = new TestSuite(TicTacToeTest.class); 14 return suite; 15 } 16 17 public void setUp() { 18 super.setUp(); 19 } 20 21 27 public void testConstruct_0() 28 throws Exception { 29 GPConfiguration config = new GPConfiguration(); 31 config.setGPFitnessEvaluator(new DeltaGPFitnessEvaluator()); 32 config.setMaxInitDepth(8); 33 config.setPopulationSize(40); 34 config.setStrictProgramCreation(false); 35 config.setProgramCreationMaxTries(5); 36 config.setMaxCrossoverDepth(12); 37 TicTacToeMain game1 = new TicTacToeMain(config); 39 GPGenotype player1 = game1.create(config,1,null,2); 40 GPConfiguration config2 = new GPConfiguration(); 42 config2.setGPFitnessEvaluator(new DeltaGPFitnessEvaluator()); 43 config2.setMaxInitDepth(8); 44 config2.setPopulationSize(40); 45 config2.setStrictProgramCreation(false); 46 config2.setProgramCreationMaxTries(5); 47 config2.setMaxCrossoverDepth(12); 48 TicTacToeMain game2 = new TicTacToeMain(config2); 49 GPGenotype player2 = game2.create(config2,2,null,1); 50 } 52 } 53 65 | Popular Tags |