examples.gp.tictactoe
Class TicTacToeMain
java.lang.Object
org.jgap.gp.GPProblem
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER
public static transient Logger LOGGER
LOOP
public static CommandGene LOOP
SUBPROGRAM1
public static CommandGene SUBPROGRAM1
SUBPROGRAM2
public static CommandGene SUBPROGRAM2
PUTSTONE1
public static CommandGene PUTSTONE1
TicTacToeMain
public TicTacToeMain(GPConfiguration a_conf)
throws InvalidConfigurationException
- Throws:
InvalidConfigurationException
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 usea_color
- the color to create a program fora_other
- an optional opponent, may be nulla_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