|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.micropsi.nodenet.Gate
The links between NetEntitys originate from Gates. Gates have parameters that
affect the way activation is propagated, similar to neurons in connectionist
networks. The output of a gate is calculated by one of the functions defined
in the class GateOutputFunctions. These functions may make use of the
parameters activation, maximum, minimum and the "unbound" parameter
theta, the latter with different semantics for each output function.
Whatever the output function may calculated, it's value is then multiplied by
the gate parameter "ampfactor", the result again checked to be between
minimum and maximum.
Additionaly, gates calculate the decay of the attached link's weights
whenever these links are used.
Every gate has a type that MUST be unique within one entity.
| Constructor Summary | |
protected |
Gate(int type,
NetEntity center,
int decayType)
Constructor for the gate, setting it's type, center-entity and the decay type of the links. |
| Method Summary | |
protected void |
addLink(Link link)
Adds a link to the gate. |
protected void |
calculateDecays(long netstep)
Calculates the decay for all attached links. |
protected boolean |
confirmActivation()
Confirms the current activation as authoritative during the next cycle |
protected void |
deleteLink(Link link)
Deletes a link from the gate. |
protected void |
destroy()
Frees as many references as possible to avoid too much gc activity |
protected double |
getActivation()
Returns the gate's "raw" activation, without having it multiplied or checked it against anything. |
double |
getAmpfactor()
Returns the ampfactor. |
double |
getConfirmedActivation()
Returns the confirmed activation of this gate. |
OutputFunctionParameter[] |
getCurrentOutputFunctionParameters()
Returns the current parameters of the output function. |
int |
getDecayCalculatorType()
Returns the decayCalculatorType. |
double |
getGateFactor()
Returns the gateFactor. |
protected long |
getLastDecayCalculation()
|
Link |
getLinkAt(int n)
Returns the nth link attached to this gate |
java.util.Iterator |
getLinks()
Returns an iterator with instances of Link. |
Link |
getLinkTo(java.lang.String entityID,
int slot)
Returns a specific link |
double |
getMaximum()
Returns the maximum output of the gate. |
double |
getMinimum()
Returns the minimum output of the (active) gate |
NetEntity |
getNetEntity()
Returns the gate's "center" entity, the entity that the gate belongs to. |
int |
getNumberOfLinks()
Returns the number of links |
OutputFunctionIF |
getOutputFunction()
Retuns the type of the output function used in this gate |
double |
getOutputFunctionParameter(java.lang.String parameterName)
Returns the current value of a given output function parameter |
int |
getType()
Returns the type |
boolean |
hasLinks()
Returns true if there are links at this gate |
boolean |
isActive()
Checks if the gate is "active", that is: if the gate's activation ist ! |
protected void |
setActivation(double activation)
Sets the activation. |
protected void |
setAmpfactor(double ampfactor)
Sets the ampfactor. |
protected void |
setConfirmedActivation(double activation)
Sets the confirmed activation. |
protected void |
setDecayCalculatorType(int decayCalculatorType)
Sets the decayCalculatorType. |
protected void |
setGateFactor(double factor)
Sets the gate factor. |
protected void |
setLastDecayCalculation(long lastDecayCalculation)
Sets the lastDecayCalculation. |
protected void |
setMaximum(double maximum)
Sets the maximum. |
protected void |
setMinimum(double minimum)
Method setMinimum. |
protected void |
setOutputFunction(OutputFunctionIF function)
Sets the output function. |
protected void |
setOutputFunctionParameter(java.lang.String parameterName,
double value)
Sets one of tge output function's constant parameters. |
protected void |
setOutputFunctionParameters(OutputFunctionParameter[] ofParams)
Sets all output function parameters at once. |
java.lang.String |
toString()
|
protected void |
unlinkCompletely()
Unlinks the entity completely - for cleaning up or to prepare the entity for deletion. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected Gate(int type,
NetEntity center,
int decayType)
type - the gate's typecenter - the NetEntity that the gate belongs todecayType - the type of decay to be applied| Method Detail |
public NetEntity getNetEntity()
protected void addLink(Link link)
link - the link to be added to the gate.protected void deleteLink(Link link)
link - the link to be deleted
protected void unlinkCompletely()
throws NetIntegrityException
NetIntegrityException - if there are bad links at this gate.public java.util.Iterator getLinks()
public Link getLinkAt(int n)
n - the index of the link
public Link getLinkTo(java.lang.String entityID,
int slot)
throws NetIntegrityException
entityID - the ID of the linked entityslot - the slot where the link ends
NetIntegrityException - if the requested link is badprotected void setGateFactor(double factor)
factor - the gateFactor.public double getGateFactor()
protected double getActivation()
public double getConfirmedActivation()
protected boolean confirmActivation()
public boolean isActive()
protected void calculateDecays(long netstep)
throws NetIntegrityException
netstep -
NetIntegrityExceptionpublic int getType()
public double getAmpfactor()
public int getDecayCalculatorType()
public OutputFunctionIF getOutputFunction()
public double getMaximum()
public double getMinimum()
protected void setActivation(double activation)
activation - The activation to setprotected void setConfirmedActivation(double activation)
activation - The activation to setprotected void setAmpfactor(double ampfactor)
ampfactor - The ampfactor to setprotected void setDecayCalculatorType(int decayCalculatorType)
decayCalculatorType - The decayCalculatorType to setprotected void setOutputFunction(OutputFunctionIF function)
function - The function to be used.protected void setMaximum(double maximum)
maximum - The maximum to setpublic OutputFunctionParameter[] getCurrentOutputFunctionParameters()
public double getOutputFunctionParameter(java.lang.String parameterName)
parameterName - the name of the parameter
java.lang.IllegalArgumentException - if the output function of this gate does not support the given parameter
protected void setOutputFunctionParameter(java.lang.String parameterName,
double value)
parameterName - the name of the parametervalue - the new value
java.lang.IllegalArgumentException - if the output function does not have this parameterprotected void setOutputFunctionParameters(OutputFunctionParameter[] ofParams)
ofParams - the parameters.protected void setMinimum(double minimum)
minimum - public int getNumberOfLinks()
public boolean hasLinks()
protected long getLastDecayCalculation()
protected void setLastDecayCalculation(long lastDecayCalculation)
lastDecayCalculation - The lastDecayCalculation to setpublic java.lang.String toString()
Object.toString()protected void destroy()
|
(c) by Micropsi Project: http://www.cognitive-agents.org | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||