Download Subtle Accents

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Inbreeding avoidance wikipedia , lookup

Quantitative comparative linguistics wikipedia , lookup

Maximum parsimony (phylogenetics) wikipedia , lookup

Gene expression programming wikipedia , lookup

Computational phylogenetics wikipedia , lookup

Koinophilia wikipedia , lookup

Transcript
Genetic Programming Lab
For Chess
Hadar Rottenberg
&
Nizan Freedman
The Objective
Creating a chess player
through an evolutionary process.
The Method
Creating a GUI-based lab for running
Genetic programming experiments that
will be scalable and comprehensive.
What Is GP
 A Set of trees (tree = individual)
 A Set of functions (tree nodes)
 A set of terminals (tree leafs)
 Given a problem insert problem as parameter to the
tree, compute tree, root node gives the final result.
 Perform random “evolutionary” operations on trees
 Combine parts of two tree into one(breeding)
 Mutate a branch of a tree (mutate)
 Keep tree for next generation (cross over)
Abbreviations
Individual:
A single chess player, represented by an evaluation tree.
A tree is composed of Terminals and Functions.
And
Function
Terminal
Is my King
threatened?
Is it possible to
reach mate in
two moves?
Abbreviations
Run:
A Genetic experiment with specific Parameters.
 Each run has several Terminals and Functions as its
building blocks.
 The initial Individuals Population is random.
 The individuals compete each other and get rankings.
 After each Generation end (Single competitions or
Tournament) the Population is changed through
Breeding\Mutation\Cross-over.
THE GP GUI
The Application is Swing based.
It allows the user to:
 Create a GP Experiment (run), with specific Parameters
per Run.
 Run an Experiment and save Individuals from it.
 Get Graph-Statistics of Individuals fitness during run.
 Play Visual Chess games of two Individuals or Individual
VS Crafty.
 Manage all Runs and Individuals created.
The GP Engine
Requirements:
 Easy to use
 Generic
 Saving & Loading of experiments
 Evaluating individuals outside an experiment(vs.
crafty)
 Transferring individuals between experiments and
using individuals as building blocks(EPOCH Run).
 Modifying experiments after they started.
Easy to use & Generic
 Complete integration of parameters via the GUI.
 All saving and loading is done via the GUI.
 Automatic detection of new building blocks/problem
classes (Scalability).
 It is left up to the user to cast the evaluated object into
the right class in his building blocks classes/problem.
 Exception:GUI is specific to chess engine.
 Runs both on Linux & windows.
Saving Loading & Crafty
 Experiment parameters are saved to a file.
 Individuals Code is saved to same file in a LISP
notation.
 A JAVACC interpreter was written to convert
individual code into a java tree object.
 Each Run's individuals can be exported via the GUI to
a separate file, the code generated can then be used to
create an individual and used to play against crafty.
 A crafty class was written to be able to play against
crafty both outside a run, and inside a run(evaluate
individuals against crafty)
Transferring Individuals &
Modifying On The Fly
 Using the javacc parser we can dynamically create individuals
from code written to file.
 All building blocks are pre-loaded dynamically to make sure
we have no conflicts when importing individuals from other
Runs.
 A Special class template for individuals to be used as building
blocks, individual code is added to the template file, and
compiled on the fly. The template wraps individuals trees as
building blocks. These template based individuals can then be
also used in other runs as building blocks.
 Run building blocks and most parameters can be changed after
a run is saved and stopped and next time the run is started
changes will take effect, allowing maximum flexibility when
running experiments
Used Technologies
 Swing GUI
 Chess Engine Implementing
 Javacc Parser
 GP Engine with Epoch runs and ADF
 JFreeChart Graphs – for statistics
 Multi-Thread running
 Stream communication (with Crafty)
 File Handling – Reflection and Logging.