public class NEATInnovation extends java.lang.Object implements Prototype
Modifier and Type | Field and Description |
---|---|
int |
inNodeId
Two nodes specify where the link innovation took place : this is the
input node.
|
int |
innovationNum1
The number assigned to the innovation.
|
int |
innovationNum2
If this is a new node innovation,then there are 2 innovations (links)
added for the new node.
|
int |
innovationType
Either NEWNODE (0) or NEWLINK (1).
|
int |
newNodeId
If a new node was created, this is its node id.
|
double |
newWeight
If a link is added, this is its weight.
|
int |
oldInnovationNum
If a new node was created, this is the innovation number of the gene's
link it is being stuck inside.
|
int |
outNodeId
Two nodes specify where the link innovation took place : this is the
output node.
|
static java.lang.String |
P_INNOVATION |
boolean |
recurFlag
Is the link innovation a recurrent link.
|
Constructor and Description |
---|
NEATInnovation() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a new individual cloned from a prototype,
and suitable to begin use in its own evolutionary
context.
|
Parameter |
defaultBase()
Returns the default base for this prototype.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
void |
reset(int inNode,
int outNode,
boolean recur)
When we have a new innovation, we clone an existing NEATInnovation
instance, and change its information with this reset
method.
|
void |
reset(int inNode,
int outNode,
int oldInnov)
When we have a new innovation, we clone an existing NEATInnovation
instance, and change its information with this reset
method.
|
void |
reset(int inNode,
int outNode,
int innovNum,
double weight,
boolean recur)
When we have a new innovation, we clone an existing NEATInnovation
instance, and change its information with this reset
method.
|
void |
reset(int inNode,
int outNode,
int innovNum1,
int innovNum2,
int newId,
int oldInnov)
When we have a new innovation, we clone an existing NEATInnovation
instance, and change its information with this reset
method.
|
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.
|
public static final java.lang.String P_INNOVATION
public int innovationType
public int inNodeId
public int outNodeId
public int innovationNum1
public int innovationNum2
public double newWeight
public int newNodeId
public int oldInnovationNum
public boolean recurFlag
public void setup(EvolutionState state, Parameter base)
Prototype
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.
public Parameter defaultBase()
Prototype
defaultBase
in interface Prototype
public void reset(int inNode, int outNode, int innovNum1, int innovNum2, int newId, int oldInnov)
public void reset(int inNode, int outNode, int oldInnov)
public void reset(int inNode, int outNode, int innovNum, double weight, boolean recur)
public void reset(int inNode, int outNode, boolean recur)
public java.lang.Object clone()
Prototype
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.
public Object clone()
{
try
{
return super.clone();
}
catch ((CloneNotSupportedException e)
{ throw new InternalError(); } // never happens
}
public Object clone()
{
try
{
MyObject myobj = (MyObject) (super.clone());
// put your deep-cloning code here...
}
catch ((CloneNotSupportedException e)
{ throw new InternalError(); } // never happens
return myobj;
}
public Object clone()
{
MyObject myobj = (MyObject) (super.clone());
// put your deep-cloning code here...
return myobj;
}
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object