|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjenes.stage.AbstractStage<T>
jenes.stage.Sequence<T>
T
- The class chromosomes flowing across the stage.public class Sequence<T extends Chromosome>
A sequence is like a "pipe" of other stages.
Stages are executed sequentially in the order they are added to the sequence.
Each stage receives an input population (produced as output by the previous stage)
and produces an output population.
Field Summary |
---|
Fields inherited from class jenes.stage.AbstractStage |
---|
biggerIsBetter, ga |
Constructor Summary | |
---|---|
Sequence()
Constructs a new sequence stage. |
Method Summary | |
---|---|
void |
appendStage(AbstractStage<T> stage)
Adds the specified stage at the end of this sequence |
void |
dispose()
Disposes all of its internal stages |
int |
getSize()
Returns the number of stages |
AbstractStage<T> |
getStageAt(int pos)
Returns the stage at the specified position |
void |
init(GeneticAlgorithm<T> ga)
Initializes all of its internal stages |
void |
insertStageAt(AbstractStage<T> stage,
int pos)
Adds the specified stage to the specified position |
void |
process(Population<T> in,
Population<T> out)
Invokes the process method on all of its internal stages |
void |
removeAll()
Removes all the stages from this sequence |
AbstractStage<T> |
removeAt(int pos)
Removes the stage at the specified position |
void |
setBiggerIsBetter(boolean flag,
boolean globally)
Sets if the best individuals have the higher fitness or not. |
Methods inherited from class jenes.stage.AbstractStage |
---|
isBiggerBetter, setBiggerIsBetter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Sequence()
Method Detail |
---|
public void appendStage(AbstractStage<T> stage)
stage
- the stage to addpublic void insertStageAt(AbstractStage<T> stage, int pos)
stage
- the stage to addpos
- the position where to insert the new stagepublic void removeAll()
public int getSize()
public AbstractStage<T> getStageAt(int pos)
pos
- index of the stage to return
public AbstractStage<T> removeAt(int pos)
pos
- the position of the stage to remove
public void init(GeneticAlgorithm<T> ga)
init
in class AbstractStage<T extends Chromosome>
ga
- the Genetic Algorithm in wchic this stage runpublic void dispose()
dispose
in class AbstractStage<T extends Chromosome>
public final void process(Population<T> in, Population<T> out) throws StageException
process
in class AbstractStage<T extends Chromosome>
in
- the input populationout
- the output population
StageException
public void setBiggerIsBetter(boolean flag, boolean globally)
AbstractStage
setBiggerIsBetter
in class AbstractStage<T extends Chromosome>
flag
- true, if the best individual has the higher fitnessglobally
- true, to propagate this setting down, otherwise false.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |