JGAP

examples.gp.tictactoe
Class TicTacToeMain

java.lang.Object
  extended by org.jgap.gp.GPProblem
      extended by examples.gp.tictactoe.TicTacToeMain

public class TicTacToeMain
extends GPProblem

Example demonstrating Genetic Programming (GP) capabilities of JGAP.

Here, a strategy for playing Noughts and Crosses (Tic Tac Toe) is evolved.

THIS PROGRAM IS STILL UNDER DEVELOPMENT AND IS NOT FINISHED YET! ANY COMMENTS AND EXTENSIONS ARE VERY WELCOME!

Since:
3.2
0 - Aktuelle Promotion 728x090

Nested Class Summary
static class TicTacToeMain.GameFitnessFunction
           
 
Constructor Summary
TicTacToeMain(GPConfiguration a_conf)
           
 
Method Summary
 GPGenotype create()
           
 GPGenotype create(GPConfiguration a_conf, int a_color, GPGenotype a_other, int a_otherColor)
          Sets up the functions to use and other parameters.
 Board getBoard()
           
static void main(java.lang.String[] args)
          Starts the example.
 
Methods inherited from class org.jgap.gp.GPProblem
createTree, getGPConfiguration, setGPConfiguration, showTree, showTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TicTacToeMain

public TicTacToeMain(GPConfiguration a_conf)
              throws InvalidConfigurationException
Throws:
InvalidConfigurationException
Method Detail

getBoard

public Board getBoard()

create

public GPGenotype create(GPConfiguration a_conf,
                         int a_color,
                         GPGenotype a_other,
                         int a_otherColor)
                  throws InvalidConfigurationException
Sets up the functions to use and other parameters. Then creates the initial genotype.

Parameters:
a_conf - the configuration to use
a_color - the color to create a program for
a_other - an optional opponent, may be null
a_otherColor - color of the opponent
Returns:
the genotype created
Throws:
InvalidConfigurationException
Since:
3.2

create

public GPGenotype create()
                  throws InvalidConfigurationException
Specified by:
create in class GPProblem
Returns:
newly created GPGenotype
Throws:
InvalidConfigurationException

main

public static void main(java.lang.String[] args)
Starts the example.

Parameters:
args - ignored
Throws:
java.lang.Exception
Since:
3.2

JGAP