[jrgp | -- Documentation ] |
'gool' is a graphical tool to manage GP-projects. A project corresponds to a directory containing a class whose methods define your function set, and/or other explicitly defined GPFunction subclasses with the same purpose. Other helper classes (evaluators, ...) can be present too.
When you open a new project, 'gool' automatically creates a directory named 'gool_repository' - under the designated project directory - where it will save all the necessary data files, the created populations and backup the used classes. You should NOT modify the contents of this directory.
A project will be represented as a tree (under the gap root node) in the user interface, and you will be able to manipulate it trough copy&paste operations, setting leaf values and through action listed in their associated popups.
root node (gap): projects with their name will appear under it and are opened through the 'open project...' option of its popup menu. (The new folder button in the open dialog can be used to create a new directory, if necessary.) The popup contains also the'exit' option for quitting gool.
project (root) nodes: they root the project trees. Their popup menu contains a 'close prj' option.
package name: the (java) package name for automatically generated classes (e.g. the function set members created with 'to gp-function' class method option). See Why should I set a package name? .
context dir: see Reload.
project directory: here you can find all the class files contained in the project directory. You can extract methods from a class by selecting them and then choosing the menu option 'to gp-function', which will create (in-place) the corresponding GPFunction subclasses that can be used as function set members. (See How to write a function set for details). There is a 'refresh' option in the its popup.
function pool: to be able to use your GPFunctions you have to put them in the function pool. You can do this by a simple copy&paste. (This way they will backed up in the project 'gool_repository').
params factory: this subtree represents the content of a GPParams class. You can fill here all the parameters necessary for the specification of a GP-problem, and then create a population through the popup. You can setup the members of the problem function set copying them via copy&paste from the function pool. Through the entries of 'arguments' and 'root compatible types' subtrees one can set the types of the taken arguments and the computed value of programs, both node have an option to add arguments or root types respectively (see more details about types).
evaluator: this node holds the Java class used to evaluate the individuals of a population. Each time you start a GP-run, an instance of this class is created and set in the corresponding GPPopulation. The specified class should implement the Evaluator interface, one way to achieve this is to subclass DefaultEvaluator (check the shipped examples for the concrete details).
pop class: the GPPopulation subclass used to create a new population. You may want to set this node if you need to define special methods to breed new individuals or to evaluate the population.
random generator: you can define a class that implements the RandomGenerator interface, if you want to control random numbers generation. Obviously all three have a 'set...' option.
populations: each population node contains its own parameters node, a list of all the individuals and the best individuals found so far. The changes in the parameters are applied when you try to evaluate the population or by explicitly choosing 'force changes' option in the parameters popup menu. The population popup menu offer a bunch of run option flavors. Many other nodes and subtree have their own popup menu with useful options.
Note: On the invoking command line for gool one can
specify a project directory to be directly opened (gool
proj-dir). Changing the file tools/gool_cfg.py
under
the installation dir one can set up some gool options.
'gool' is so conceived that you don't have to restart it when you externally modify the classes used by your populations : you can reload them. If you modify the evaluator or the random generator, you can reload them simply by setting the corresponding nodes again. If you modify the classes of the function set and you copy them in the function pool, 'gool' asks if you want to substitute the old class with the new one. If you decide to, your programs will now use the new version.
If the explicit classes of your project (function set members, evaluator ...) use - behind the scene - other classes, 'gool' should be able to locate them: either through the classpath or you can specify their path in the 'context dir' node.
Then in the latter case, if you modify these classes, you can load and reload them, choosing the popup option 'reload ctxt' . This is not possible if they are located along the classpath.
Q: How can I add ADFs
to an existing population?
A: Load the population and copy its parameters in the params factory by
choosing the 'copy into the params factory' option. Add the new ADFs, set the
arguments, the type and the links. Then select the new ADFs and copy them in
the 'parameters' node of your population. The corresponding reference nodes
will appear, and these changes are going to be applied as usual (choose 'force
changes' or run the population).
Q:
How can I merge existing populations?
A: You have to prepare in the 'params factory' the parameters that are going
to be used in the new population. Of course they have to be compatible with
the parameters of all the populations you want to merge (usually all of your
populations share the same parameters; in this case you only need to load one
of them and select the option 'copy into the params factory' in the parameters
node popup menu). Then select the populations and choose 'merge' from the
popup menu of one of them.
Q: Why
should I set a package name?
A: If you want to use your populations outside 'gool', for example in a jython
script or in a Java program, Java has to be able to find your classes in the
classpath. Of course you could load the classes explicitly through a
classloader, but you can let Java do all work by properly setting the package
name of the created classes. All the methods extracted from a class will have
the package name you specify in the node.
Q:
What is the 'import pop...' option in a project node good for?
A: You could have a population created by other means (e.g. a jython script or
a Java program) or simply a population exported using the 'export...' option,
which is compatible with your project and that you want to use in 'gool'. The
'import pop...' option is the right way to achieve this.