ec.app.edge
Class Edge
- java.lang.Object
-
- ec.Problem
-
- ec.gp.GPProblem
-
- 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) - See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description boolean[]acceptstatic intBADint[][]epsilonstatic intEPSILONint[]epsilon_lint[]frombooleangeneralizestatic intJ_CENTERstatic intJ_LEFTstatic intJ_RIGHTstatic intMIN_ARRAY_SIZEboolean[][]negAboolean[][]negTintnumEdgesintnumNodesstatic java.lang.StringP_ALLNEGstatic java.lang.StringP_ALLPOSstatic java.lang.StringP_GENERALIZEstatic java.lang.StringP_MAXTESTstatic java.lang.StringP_TESTNEGstatic java.lang.StringP_TESTPOSboolean[][]posAboolean[][]posTint[]readingint[][]reading0static intREADING0int[]reading0_lint[][]reading1static intREADING1int[]reading1_lboolean[]startboolean[]state1boolean[]state2int[]to
-
Constructor Summary
Constructors Constructor and Description Edge()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddescribe(EvolutionState state, Individual ind, int subpopulation, int threadnum, int log)Part of SimpleProblemForm.java.lang.StringdescribeShortGeneralized(Individual ind, EvolutionState state, int subpopulation, int threadnum)voidevaluate(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.Stringfill(int num, char c)voidfullTest(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.Stringjustify(java.lang.String s, int len, int justification)voidprintBits(EvolutionState state, boolean[][] bits)java.lang.StringprintCurrentNFA()boolean[][]restrictToSize(int size, boolean[][] cases, EvolutionState state, int thread)voidsetup(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.InputStream f)booleantest(boolean[] sample)-
Methods inherited from class ec.gp.GPProblem
clone, defaultBase
-
Methods inherited from class ec.Problem
canEvaluate, closeContacts, describe, finishEvaluating, initializeContacts, prepareToEvaluate, reinitializeContacts
-
-
-
-
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
-
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
-
-
Method Detail
-
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.InputStream 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:PrototypeSets 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.
-
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:SimpleProblemFormEvaluates the individual in ind, if necessary (perhaps not evaluating them if their evaluated flags are true), and sets their fitness appropriately.- Specified by:
evaluatein interfaceSimpleProblemForm
-
describe
public void describe(EvolutionState state, Individual ind, int subpopulation, int threadnum, int log)
Description copied from class:ProblemPart of SimpleProblemForm. Included here so you don't have to write the default version, which usually does nothing.- Specified by:
describein interfaceSimpleProblemForm- Overrides:
describein classProblem
-
describeShortGeneralized
public java.lang.String describeShortGeneralized(Individual ind, EvolutionState state, int subpopulation, int threadnum)
-
-
DMelt 3.0 © DataMelt by jWork.ORG