ec.app.edge
Class Edge

java.lang.Object
  extended by ec.Problem
      extended by ec.gp.GPProblem
          extended by ec.app.edge.Edge
All Implemented Interfaces:
Prototype, Setup, SimpleProblemForm, java.io.Serializable, java.lang.Cloneable

public class Edge
extends GPProblem
implements SimpleProblemForm

Edge implements the Symbolic Edge problem.

Parameters

base.data
classname, inherits or == ec.app.edge.EdgeData
(the class for the prototypical GPData object for the Edge problem)

Parameter bases

base.data species (the GPData object)

Version:
1.0
Author:
Sean Luke
See Also:
Serialized Form

Field Summary
 boolean[] accept
           
static int BAD
           
 int[][] epsilon
           
static int EPSILON
           
 int[] epsilon_l
           
 int[] from
           
 boolean generalize
           
 EdgeData input
           
static int J_CENTER
           
static int J_LEFT
           
static int J_RIGHT
           
static int MIN_ARRAY_SIZE
           
 boolean[][] negA
           
 boolean[][] negT
           
 int numEdges
           
 int numNodes
           
static java.lang.String P_ALLNEG
           
static java.lang.String P_ALLPOS
           
static java.lang.String P_GENERALIZE
           
static java.lang.String P_MAXTEST
           
static java.lang.String P_TESTNEG
           
static java.lang.String P_TESTPOS
           
 boolean[][] posA
           
 boolean[][] posT
           
 int[] reading
           
 int[][] reading0
           
static int READING0
           
 int[] reading0_l
           
 int[][] reading1
           
static int READING1
           
 int[] reading1_l
           
 boolean[] start
           
 boolean[] state1
           
 boolean[] state2
           
 int[] to
           
 
Fields inherited from class ec.gp.GPProblem
data, P_DATA, P_GPPROBLEM, P_STACK, stack
 
Fields inherited from class ec.Problem
P_PROBLEM
 
Constructor Summary
Edge()
           
 
Method Summary
 java.lang.Object clone()
          Creates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.
 void describe(Individual ind, EvolutionState state, int threadnum, int log, int verbosity)
           
 java.lang.String describeShortGeneralized(Individual ind, EvolutionState state, int threadnum)
           
 void evaluate(EvolutionState state, Individual ind, int subpopulation, int threadnum)
          Evaluates the individual in ind, if necessary (perhaps not evaluating them if their evaluated flags are true), and sets their fitness appropriately.
static java.lang.String fill(int num, char c)
           
 void fullTest(EvolutionState state, Individual ind, int threadnum, boolean[][] pos, boolean[][] neg)
          Tests an individual, returning its successful positives in totpos and its successful negatives in totneg.
static java.lang.String justify(java.lang.String s, int len, int justification)
           
 void printBits(EvolutionState state, boolean[][] bits)
           
 java.lang.String printCurrentNFA()
           
 boolean[][] restrictToSize(int size, boolean[][] cases, EvolutionState state, int thread)
           
 void setup(EvolutionState state, Parameter base)
          Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.
 boolean[][] slurp(java.io.File f)
           
 boolean test(boolean[] sample)
           
 
Methods inherited from class ec.gp.GPProblem
defaultBase, describe
 
Methods inherited from class ec.Problem
canEvaluate, closeContacts, evaluate, finishEvaluating, getBase, initializeContacts, prepareToEvaluate, reinitializeContacts, setBase
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ec.simple.SimpleProblemForm
canEvaluate, describe, evaluate
 

Field Detail

P_GENERALIZE

public static final java.lang.String P_GENERALIZE
See Also:
Constant Field Values

P_ALLPOS

public static final java.lang.String P_ALLPOS
See Also:
Constant Field Values

P_ALLNEG

public static final java.lang.String P_ALLNEG
See Also:
Constant Field Values

P_TESTPOS

public static final java.lang.String P_TESTPOS
See Also:
Constant Field Values

P_TESTNEG

public static final java.lang.String P_TESTNEG
See Also:
Constant Field Values

P_MAXTEST

public static final java.lang.String P_MAXTEST
See Also:
Constant Field Values

MIN_ARRAY_SIZE

public static final int MIN_ARRAY_SIZE
See Also:
Constant Field Values

BAD

public static final int BAD
See Also:
Constant Field Values

READING0

public static final int READING0
See Also:
Constant Field Values

READING1

public static final int READING1
See Also:
Constant Field Values

EPSILON

public static final int EPSILON
See Also:
Constant Field Values

input

public EdgeData input

start

public boolean[] start

accept

public boolean[] accept

numNodes

public int numNodes

from

public int[] from

to

public int[] to

reading

public int[] reading

numEdges

public int numEdges

reading1

public int[][] reading1

reading1_l

public int[] reading1_l

reading0

public int[][] reading0

reading0_l

public int[] reading0_l

epsilon

public int[][] epsilon

epsilon_l

public int[] epsilon_l

posT

public boolean[][] posT

negT

public boolean[][] negT

posA

public boolean[][] posA

negA

public boolean[][] negA

state1

public boolean[] state1

state2

public boolean[] state2

generalize

public boolean generalize

J_LEFT

public static final int J_LEFT
See Also:
Constant Field Values

J_RIGHT

public static final int J_RIGHT
See Also:
Constant Field Values

J_CENTER

public static final int J_CENTER
See Also:
Constant Field Values
Constructor Detail

Edge

public Edge()
Method Detail

clone

public java.lang.Object clone()
Description copied from interface: Prototype
Creates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.

Typically this should be a full "deep" clone. However, you may share certain elements with other objects rather than clone hem, depending on the situation:

Implementations.

Specified by:
clone in interface Prototype
Overrides:
clone in class GPProblem

fill

public static java.lang.String fill(int num,
                                    char c)

justify

public static java.lang.String justify(java.lang.String s,
                                       int len,
                                       int justification)

printCurrentNFA

public java.lang.String printCurrentNFA()

restrictToSize

public boolean[][] restrictToSize(int size,
                                  boolean[][] cases,
                                  EvolutionState state,
                                  int thread)

slurp

public boolean[][] slurp(java.io.File f)
                  throws java.io.IOException
Throws:
java.io.IOException

printBits

public void printBits(EvolutionState state,
                      boolean[][] bits)

setup

public void setup(EvolutionState state,
                  Parameter base)
Description copied from interface: Prototype
Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.

For prototypes, setup(...) is typically called once for the prototype instance; cloned instances do not receive the setup(...) call. setup(...) may be called more than once; the only guarantee is that it will get called at least once on an instance or some "parent" object from which it was ultimately cloned.

Specified by:
setup in interface Prototype
Specified by:
setup in interface Setup
Overrides:
setup in class GPProblem

test

public boolean test(boolean[] sample)

fullTest

public void fullTest(EvolutionState state,
                     Individual ind,
                     int threadnum,
                     boolean[][] pos,
                     boolean[][] neg)
Tests an individual, returning its successful positives in totpos and its successful negatives in totneg.


evaluate

public void evaluate(EvolutionState state,
                     Individual ind,
                     int subpopulation,
                     int threadnum)
Description copied from interface: SimpleProblemForm
Evaluates the individual in ind, if necessary (perhaps not evaluating them if their evaluated flags are true), and sets their fitness appropriately.

Specified by:
evaluate in interface SimpleProblemForm
Overrides:
evaluate in class Problem

describe

public void describe(Individual ind,
                     EvolutionState state,
                     int threadnum,
                     int log,
                     int verbosity)
Specified by:
describe in interface SimpleProblemForm
Overrides:
describe in class Problem

describeShortGeneralized

public java.lang.String describeShortGeneralized(Individual ind,
                                                 EvolutionState state,
                                                 int threadnum)