|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.memphis.ccrg.lida.framework.shared.ElementFactory
public class ElementFactory
Standard factory for the basic elements of the framework. Support for
Node
, Link
, FrameworkTask
, and NodeStructure
Method Summary | |
---|---|
void |
addDecayStrategy(java.lang.String name,
StrategyDef decayDef)
Adds a DecayStrategy indexed by specified name. |
void |
addExciteStrategy(java.lang.String name,
StrategyDef exciteDef)
Adds an excite strategy indexed by specified name. |
void |
addFrameworkTaskType(FrameworkTaskDef taskDef)
Adds the FrameworkTask type. |
void |
addLinkType(LinkableDef linkDef)
Adds a Link type to this factory |
void |
addLinkType(java.lang.String typeName,
java.lang.String className)
Adds a link type indexed by specified typeName |
void |
addNodeType(LinkableDef nodeDef)
Adds a Node type to this factory |
void |
addNodeType(java.lang.String typeName,
java.lang.String className)
Adds a Node type indexed by specified typeName |
void |
addStrategy(java.lang.String name,
StrategyDef strategyDef)
Adds a strategy to this factory indexed by specified name. |
boolean |
containsLinkType(java.lang.String linkTypeName)
Returns whether this factory contains specified Link type. |
boolean |
containsNodeType(java.lang.String nodeTypeName)
Returns whether this factory contains specified Node type. |
boolean |
containsStrategy(java.lang.String strategyTypeName)
Returns whether this factory contains specified Strategy type. |
boolean |
containsTaskType(java.lang.String typeName)
Returns whether this factory contains specified FrameworkTask type. |
DecayStrategy |
getDecayStrategy(java.lang.String strategyTypeName)
Gets decay strategy. |
DecayStrategy |
getDefaultDecayStrategy()
Returns the default DecayStrategy |
java.lang.String |
getDefaultDecayType()
Gets default decay type. |
ExciteStrategy |
getDefaultExciteStrategy()
Returns the default ExciteStrategy |
java.lang.String |
getDefaultExciteType()
Gets default excite type. |
java.lang.String |
getDefaultLinkType()
Gets default link type. |
java.lang.String |
getDefaultNodeType()
Gets default node type. |
ExciteStrategy |
getExciteStrategy(java.lang.String strategyTypeName)
Gets excite strategy. |
FrameworkTask |
getFrameworkTask(java.lang.String taskType,
java.util.Map<java.lang.String,? extends java.lang.Object> params)
Returns a new FrameworkTask having specified attributes. |
FrameworkTask |
getFrameworkTask(java.lang.String taskType,
java.util.Map<java.lang.String,? extends java.lang.Object> params,
java.util.Map<ModuleName,FrameworkModule> modules)
Returns a new FrameworkTask having specified attributes. |
FrameworkTask |
getFrameworkTask(java.lang.String taskType,
java.lang.String decayStrategy,
java.lang.String exciteStrategy,
int ticksPerRun,
double activation,
double removalThreshold,
java.util.Map<java.lang.String,? extends java.lang.Object> params,
java.util.Map<ModuleName,FrameworkModule> modules)
Returns a new FrameworkTask with specified attributes. |
static ElementFactory |
getInstance()
Returns the sole instance of this factory. |
Link |
getLink(Node source,
Linkable sink,
LinkCategory category)
Creates and returns a new Link with specified source, sink, and category. |
Link |
getLink(Node source,
Linkable sink,
LinkCategory category,
double activation,
double removalThreshold)
Creates and returns a new Link with specified source, sink, category, and activation. |
Link |
getLink(java.lang.String linkType,
Node source,
Linkable sink,
LinkCategory category)
Creates and returns a new Link with specified type, source, sink, and category. |
Link |
getLink(java.lang.String linkType,
Node source,
Linkable sink,
LinkCategory category,
java.lang.String decayStrategy,
java.lang.String exciteStrategy,
double activation,
double removalThreshold)
Creates and returns a new Link of specified type with specified source, sink, LinkCategory, DecayStrategy, ExciteStrategy, and category. |
Link |
getLink(java.lang.String requiredType,
java.lang.String desiredType,
Node source,
Linkable sink,
LinkCategory category)
Checks if desiredType is-a requiredType. |
Node |
getNode()
Creates a default node with the default strategies and default activation. |
Node |
getNode(Node oNode)
Creates a copy of the supplied node with the default strategies. |
Node |
getNode(Node oNode,
java.lang.String nodeType)
Creates a copy of specified Node . |
Node |
getNode(Node oNode,
java.lang.String decayStrategy,
java.lang.String exciteStrategy)
Creates a copy of oNode with the specified decay and excite strategies. |
Node |
getNode(java.lang.String nodeType)
Creates new node of specified type. |
Node |
getNode(java.lang.String requiredType,
Node oNode,
java.lang.String desiredType)
Creates a copy of specified node of desired type. |
Node |
getNode(java.lang.String nodeType,
java.lang.String nodeLabel)
Creates new node of specified type with specified label. |
Node |
getNode(java.lang.String nodeType,
java.lang.String decayStrategy,
java.lang.String exciteStrategy,
java.lang.String nodeLabel,
double activation,
double removalThreshold)
Creates a new node of specified type, strategies, label, and initial activation. |
NodeStructure |
getNodeStructure()
Returns a new default NodeStructure. |
NodeStructure |
getNodeStructure(java.lang.String nodeType,
java.lang.String linkType)
Returns a new NodeStructure with specified Node and Link types. |
Strategy |
getStrategy(java.lang.String typeName)
Get a strategy by type. |
void |
setDefaultDecayType(java.lang.String decayTypeName)
Sets default decay type. |
void |
setDefaultExciteType(java.lang.String exciteTypeName)
Sets default excite type. |
void |
setDefaultLinkType(java.lang.String linkTypeName)
Set the default Link type used by this factory. |
void |
setDefaultNodeType(java.lang.String nodeTypeName)
Set the default Node type used by this factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ElementFactory getInstance()
public void addDecayStrategy(java.lang.String name, StrategyDef decayDef)
DecayStrategy
indexed by specified name.
name
- the name used to refer to the strategydecayDef
- the decay strategy's StrategyDef
public void addExciteStrategy(java.lang.String name, StrategyDef exciteDef)
name
- the name used to reference the strategyexciteDef
- the excite strategy StrategyDef
public void addStrategy(java.lang.String name, StrategyDef strategyDef)
name
- the namestrategyDef
- the StrategyDef
public void addLinkType(LinkableDef linkDef)
linkDef
- the link defpublic void addLinkType(java.lang.String typeName, java.lang.String className)
typeName
- the link typeclassName
- the class namepublic void addNodeType(LinkableDef nodeDef)
Node
type to this factory
nodeDef
- the node defpublic void addNodeType(java.lang.String typeName, java.lang.String className)
typeName
- the simple node nameclassName
- the canonical node namepublic void addFrameworkTaskType(FrameworkTaskDef taskDef)
FrameworkTask
type.
taskDef
- FrameworkTaskDef
public java.lang.String getDefaultLinkType()
public java.lang.String getDefaultNodeType()
public boolean containsStrategy(java.lang.String strategyTypeName)
Strategy
type.
strategyTypeName
- name of strategy type
public boolean containsNodeType(java.lang.String nodeTypeName)
Node
type.
nodeTypeName
- name of node type
public boolean containsLinkType(java.lang.String linkTypeName)
Link
type.
linkTypeName
- name of Link type
public boolean containsTaskType(java.lang.String typeName)
FrameworkTask
type.
typeName
- String
public DecayStrategy getDecayStrategy(java.lang.String strategyTypeName)
strategyTypeName
- name of DecayStrategy type
public ExciteStrategy getExciteStrategy(java.lang.String strategyTypeName)
strategyTypeName
- name of excite strategy type
public Strategy getStrategy(java.lang.String typeName)
typeName
- Name of sought strategy.
public Link getLink(Node source, Linkable sink, LinkCategory category, double activation, double removalThreshold)
source
- Node that is link's sourcesink
- Linkable that is link's sinkcategory
- LinkCategoryactivation
- initial activationremovalThreshold
- threshold to remain in NodeStructure
public Link getLink(Node source, Linkable sink, LinkCategory category)
source
- Node that is link's sourcesink
- Linkable that is link's sinkcategory
- LinkCategory
public Link getLink(java.lang.String requiredType, java.lang.String desiredType, Node source, Linkable sink, LinkCategory category)
requiredType
- Required Link type for NodeStructure
desiredType
- Desired Link type for returned Link. Must be a subtype of required type.source
- Link's sourcesink
- Link's sinkcategory
- Link's LinkCategory
Link
with specified attributes.public Link getLink(java.lang.String linkType, Node source, Linkable sink, LinkCategory category)
linkType
- the link typesource
- Node that is link's sourcesink
- Linkable that is link's sinkcategory
- LinkCategory
public Link getLink(java.lang.String linkType, Node source, Linkable sink, LinkCategory category, java.lang.String decayStrategy, java.lang.String exciteStrategy, double activation, double removalThreshold)
linkType
- Link typesource
- Link's sourcesink
- Link's sinkcategory
- Link's categorydecayStrategy
- Link's DecayStrategyexciteStrategy
- Link's ExciteStrategyactivation
- initial activationremovalThreshold
- threshold of activation required to remain active
public Node getNode()
Activatible
public Node getNode(Node oNode)
oNode
- supplied node
public Node getNode(Node oNode, java.lang.String nodeType)
Node
. The second argument specifies the type of
the new node. The Activatible
strategies of the
new node are based on those specified by the Node
type's LinkableDef
(specified by factoriesData.xml) If the Node
type
does not specify default Activatible
strategies then the default strategies are used.
All other values of the specified Node
are copied to the new Node
, e.g. activation.
oNode
- supplied nodenodeType
- type of returned node
public Node getNode(java.lang.String requiredType, Node oNode, java.lang.String desiredType)
requiredType
- Default node type of NodeStructure
oNode
- Node
to be copied.desiredType
- type of copied node
public Node getNode(Node oNode, java.lang.String decayStrategy, java.lang.String exciteStrategy)
oNode
- supplied nodedecayStrategy
- new node's decay strategyexciteStrategy
- new node's excite strategy
public Node getNode(java.lang.String nodeType)
nodeType
- type of desired node
public Node getNode(java.lang.String nodeType, java.lang.String nodeLabel)
nodeType
- type of new nodenodeLabel
- label of new node
public Node getNode(java.lang.String nodeType, java.lang.String decayStrategy, java.lang.String exciteStrategy, java.lang.String nodeLabel, double activation, double removalThreshold)
nodeType
- type of new nodedecayStrategy
- decay strategy of new nodeexciteStrategy
- excite strategy of new nodenodeLabel
- label of new nodeactivation
- activation of new noderemovalThreshold
- threshold node needs to remain in containing NodeStructure
s
public void setDefaultLinkType(java.lang.String linkTypeName)
linkTypeName
- type of links created by this factorypublic void setDefaultNodeType(java.lang.String nodeTypeName)
nodeTypeName
- type of nodes created by this factorypublic java.lang.String getDefaultDecayType()
public DecayStrategy getDefaultDecayStrategy()
DecayStrategy
DecayStrategy
public void setDefaultDecayType(java.lang.String decayTypeName)
decayTypeName
- DecayType to be usedpublic java.lang.String getDefaultExciteType()
public ExciteStrategy getDefaultExciteStrategy()
ExciteStrategy
public void setDefaultExciteType(java.lang.String exciteTypeName)
exciteTypeName
- the defaultExciteType to setpublic FrameworkTask getFrameworkTask(java.lang.String taskType, java.util.Map<java.lang.String,? extends java.lang.Object> params)
FrameworkTask
having specified attributes. FrameworkTask
will have strategies specified for the taskType
taskType
- type of FrameworkTaskparams
- optional parameters to be set in object's init method
FrameworkTask
public FrameworkTask getFrameworkTask(java.lang.String taskType, java.util.Map<java.lang.String,? extends java.lang.Object> params, java.util.Map<ModuleName,FrameworkModule> modules)
FrameworkTask
having specified attributes. FrameworkTask
will have strategies specified for the taskType
taskType
- type of FrameworkTaskparams
- optional parameters to be set in object's init methodmodules
- map of modules for association.
FrameworkTask
public FrameworkTask getFrameworkTask(java.lang.String taskType, java.lang.String decayStrategy, java.lang.String exciteStrategy, int ticksPerRun, double activation, double removalThreshold, java.util.Map<java.lang.String,? extends java.lang.Object> params, java.util.Map<ModuleName,FrameworkModule> modules)
FrameworkTask
with specified attributes.
taskType
- label for taskdecayStrategy
- DecayStrategy used by taskexciteStrategy
- ExciteStrategy used by taskticksPerRun
- execution frequencyactivation
- initial activationremovalThreshold
- activation needed to remain activeparams
- optional parameters to be set in object's init methodmodules
- map of modules for association.
FrameworkTask
public NodeStructure getNodeStructure()
Node
type and default
Link
type.public NodeStructure getNodeStructure(java.lang.String nodeType, java.lang.String linkType)
Node
and Link
types.
nodeType
- type of node in returned NodeStructure
linkType
- type of Link in returned NodeStructure
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |