Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OKBJavaConnector/ECJClient/src/ec/gp/ge/GEIndividual.java @ 10677

Last change on this file since 10677 was 6152, checked in by bfarka, 14 years ago

added ecj and custom statistics to communicate with the okb services #1441

File size: 1.1 KB
Line 
1/*
2  Copyright 20010 by Sean Luke and George Mason University
3  Licensed under the Academic Free License version 3.0
4  See the file "LICENSE" for more information
5*/
6
7
8package ec.gp.ge;
9
10import ec.*;
11import ec.gp.*;
12import ec.vector.*;
13
14/*
15 * GEIndividual.java
16 *
17 * Created: Sat Oct 16 23:21:01 EDT 2010
18 * By: Joseph Zelibor, Eric Kangas, and Sean Luke
19 */
20
21/**
22    GEIndividual is a simple subclass of ByteVectorIndividual which not only prints out (for humans)
23    the Individual as a byte vector but also prints out the Individual's tree representation.
24*/
25
26public class GEIndividual extends ByteVectorIndividual
27    {
28    public static final String TREE_PREAMBLE = "Equivalent Tree: ";
29    public static final String BAD_TREE = "[BAD]";
30       
31    public void printIndividualForHumans(EvolutionState state, int log)
32        {
33        super.printIndividualForHumans(state, log);
34        state.output.println(TREE_PREAMBLE, log);
35        GPIndividual ind = (((GESpecies)species).map(state, this, 0));
36        if (ind == null) state.output.println(BAD_TREE, log);
37        else ind.printTrees(state, log);
38        }
39    }
Note: See TracBrowser for help on using the repository browser.