org.encog.neural.neat.training.opp
public abstract class NEATMutation extends Object implements EvolutionaryOperator
| Constructor and Description |
|---|
NEATMutation() |
| Modifier and Type | Method and Description |
|---|---|
NEATNeuronGene |
chooseRandomNeuron(NEATGenome target,
boolean choosingFrom)
Choose a random neuron.
|
void |
createLink(NEATGenome target,
long neuron1ID,
long neuron2ID,
double weight)
Create a link between two neuron id's.
|
int |
getElementPos(NEATGenome target,
long neuronID)
Get the specified neuron's index.
|
EvolutionaryAlgorithm |
getOwner() |
void |
init(EvolutionaryAlgorithm theOwner)
Called to setup the evolutionary operator.
|
boolean |
isDuplicateLink(NEATGenome target,
long fromNeuronID,
long toNeuronID)
Determine if this is a duplicate link.
|
boolean |
isNeuronNeeded(NEATGenome target,
long neuronID)
Determines if a neuron is still needed.
|
NEATGenome |
obtainGenome(Genome[] parents,
int parentIndex,
Genome[] offspring,
int offspringIndex)
Obtain the NEATGenome that we will mutate.
|
int |
offspringProduced() |
int |
parentsNeeded() |
void |
removeNeuron(NEATGenome target,
long neuronID)
Remove the specified neuron.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitperformOperationpublic NEATNeuronGene chooseRandomNeuron(NEATGenome target, boolean choosingFrom)
target - The target genome. Should the input and bias neurons be
included.choosingFrom - True if we are chosing from all neurons, false if we exclude
the input and bias.public void createLink(NEATGenome target, long neuron1ID, long neuron2ID, double weight)
target - The target genome.neuron1ID - The id of the source neuron.neuron2ID - The id of the target neuron.weight - The weight of this new link.public int getElementPos(NEATGenome target, long neuronID)
neuronID - The neuron id to check for.public EvolutionaryAlgorithm getOwner()
public void init(EvolutionaryAlgorithm theOwner)
init in interface EvolutionaryOperatortheOwner - The evolutionary algorithm used with this operator.public boolean isDuplicateLink(NEATGenome target, long fromNeuronID, long toNeuronID)
fromNeuronID - The from neuron id.toNeuronID - The to neuron id.public boolean isNeuronNeeded(NEATGenome target, long neuronID)
target - The target genome.neuronID - The neuron id to check for.public NEATGenome obtainGenome(Genome[] parents, int parentIndex, Genome[] offspring, int offspringIndex)
parents - The parents.parentIndex - The parent index.offspring - The offspring.offspringIndex - The offspring index.public int offspringProduced()
offspringProduced in interface EvolutionaryOperatorpublic int parentsNeeded()
parentsNeeded in interface EvolutionaryOperatorpublic void removeNeuron(NEATGenome target, long neuronID)
target - The target genome.neuronID - The neuron to remove.Copyright © 2014. All Rights Reserved.