|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NodeStructure
A NodeStructure holds a collection of Node
s an Link
s. It is used
as a main conceptual representation among LIDA modules.
NodeStructureImpl
Method Summary | |
---|---|
Link |
addDefaultLink(int idSource,
ExtendedId idSink,
LinkCategory type,
double activation,
double removalThreshold)
Creates and adds a new Link with specified attributes. |
Link |
addDefaultLink(int idSource,
int idSink,
LinkCategory type,
double activation,
double removalThreshold)
Creates and adds a new Link with specified attributes. |
Link |
addDefaultLink(Link l)
Copies specified Link and then adds the copy to this NodeStructure. |
Link |
addDefaultLink(Node source,
Linkable sink,
LinkCategory category,
double activation,
double removalThreshold)
|
java.util.Collection<Link> |
addDefaultLinks(java.util.Collection<Link> links)
Copies specified Links and then adds the copies to this NodeStructure. |
Node |
addDefaultNode(Node n)
Adds a COPY of specified Node to this NodeStructure. |
java.util.Collection<Node> |
addDefaultNodes(java.util.Collection<Node> nodes)
|
Link |
addLink(Link l,
java.lang.String linkType)
Adds copy of specified Link. |
Node |
addNode(Node n,
java.lang.String factoryType)
Add a Node of a specified factory type to this NodeStructure |
void |
clearLinks()
Removes all links from this NodeStructure |
void |
clearNodeStructure()
Removes all nodes and links from this nodestructure |
boolean |
containsLink(ExtendedId id)
Returns whether this NodeStructure contains Link with specified ExtendedId . |
boolean |
containsLink(Link l)
Returns whether this NodeStructure contains specified Link. |
boolean |
containsLinkable(ExtendedId id)
Returns whether this NodeStructure contains Linkable with specified ExtendedId . |
boolean |
containsLinkable(Linkable l)
Returns whether this NodeStructure contains specified Linkable . |
boolean |
containsNode(ExtendedId id)
Returns whether this NodeStructure contains Node with specified ExtendedId. |
boolean |
containsNode(int id)
Returns whether this NodeStructure contains Node with specified id. |
boolean |
containsNode(Node n)
Returns whether this NodeStructure contains specified Node. |
NodeStructure |
copy()
Returns a deep copy of this NodeStructure |
void |
decayNodeStructure(long ticks)
Decays the Linkable s of this NodeStructure . |
java.util.Set<Link> |
getAttachedLinks(Linkable l)
Gets all Link s directly connected to specified Linkable. |
java.util.Set<Link> |
getAttachedLinks(Linkable linkable,
LinkCategory cat)
Gets all Link s directly connected to specified Linkable with specified LinkCategory |
java.util.Map<Linkable,Link> |
getConnectedSinks(Node n)
Finds and returns a Map of all sink Linkable s connected to specified Node . |
java.util.Map<Node,Link> |
getConnectedSources(Linkable linkable)
Finds and returns a Map of all source Nodes connected to specified Linkable . |
java.lang.String |
getDefaultLinkType()
Gets defaultLinkType |
java.lang.String |
getDefaultNodeType()
Gets defaultNodeType |
Link |
getLink(ExtendedId ids)
Gets Link with specified ExtendedId if present. |
Linkable |
getLinkable(ExtendedId eid)
Gets Linkable with specified ExtendedId |
int |
getLinkableCount()
Returns count of Linkable s |
java.util.Map<Linkable,java.util.Set<Link>> |
getLinkableMap()
Returns linkableMap |
java.util.Collection<Linkable> |
getLinkables()
Returns all Linkables, all Nodes and Links, in this NodeStructure |
int |
getLinkCount()
returns a count of links |
java.util.Collection<Link> |
getLinks()
Returns the Links of this NodeStructure |
java.util.Set<Link> |
getLinks(LinkCategory cat)
Returns all Links of this NodeStructure with specified LinkCategory |
Node |
getNode(ExtendedId eid)
Returns a copy of the node in this nodestructure with specified ExtendedId |
Node |
getNode(int id)
Returns a copy of the node in this nodestructure with specified id |
int |
getNodeCount()
Returns a count of nodes |
java.util.Collection<Node> |
getNodes()
Returns all Node s |
void |
mergeWith(NodeStructure ns)
Merges specified NodeStructure into this one. |
void |
removeLink(Link l)
Removes specified Link if present. |
void |
removeLinkable(ExtendedId id)
Removes Linkable with specified ExtendedId if present. |
void |
removeLinkable(Linkable l)
Removes specified Linkable if present. |
void |
removeNode(Node n)
Removes specified Node if present. |
Method Detail |
---|
Link addDefaultLink(Link l)
NodeStructure
when
it is added.
l
- Link to copy and add.
java.util.Collection<Link> addDefaultLinks(java.util.Collection<Link> links)
NodeStructure
when
they are added.
Note if Links in supplied Collection link to each other then this method does NOT guarantee
that all Links will be added properly. Links should be added one at a time in this case after
the dependent links are already present.
links
- Links to copy and add.
Link addLink(Link l, java.lang.String linkType)
l
- original Link
linkType
- type of copied Link
Link
or null if such a link cannot be created.Link addDefaultLink(Node source, Linkable sink, LinkCategory category, double activation, double removalThreshold)
source
- Link's source Node
sink
- Link's sink, a Node
or a Link
category
- Link's LinkCategory
activation
- initial link activationremovalThreshold
- amount of activation Link must maintain to remain in this NodeStructure after decaying.
Link addDefaultLink(int idSource, ExtendedId idSink, LinkCategory type, double activation, double removalThreshold)
idSource
- id of link's sourceidSink
- ExtendedId
of link's sinktype
- Link's LinkCategory
activation
- initial link activationremovalThreshold
- amount of activation Link must maintain to remain in this NodeStructure after decaying.
Link addDefaultLink(int idSource, int idSink, LinkCategory type, double activation, double removalThreshold)
idSource
- id of link's sourceidSink
- id of link's sinktype
- Link's LinkCategory
activation
- initial link activationremovalThreshold
- amount of activation Link must maintain to remain in this NodeStructure after decaying.
Node addDefaultNode(Node n)
n
- Node to add.
java.util.Collection<Node> addDefaultNodes(java.util.Collection<Node> nodes)
nodes
- Node to be added.
addDefaultNode(Node)
Node addNode(Node n, java.lang.String factoryType)
n
- NodefactoryType
- name of node's type in the factory
void removeLink(Link l)
Link
if present.
l
- Link to remove.void removeNode(Node n)
Node
if present.
n
- Node to remove.void removeLinkable(Linkable l)
Linkable
if present.
l
- Linkable to remove.void removeLinkable(ExtendedId id)
Linkable
with specified ExtendedId
if present.
id
- ExtendedId of Linkable to remove.void clearLinks()
NodeStructure
void clearNodeStructure()
boolean containsNode(Node n)
n
- Node checked for.
boolean containsNode(int id)
id
- id of Node checked for.
boolean containsNode(ExtendedId id)
id
- ExtendedId of Node checked for.
boolean containsLink(Link l)
l
- Link checked for.
boolean containsLink(ExtendedId id)
ExtendedId
.
id
- Link checked for.
Link
with the same ExtendedId
.boolean containsLinkable(Linkable l)
Linkable
.
l
- Linkable
checked for.
Linkable
with the same ExtendedId
.boolean containsLinkable(ExtendedId id)
Linkable
with specified ExtendedId
.
id
- Linkable
checked for.
Linkable
with the same ExtendedId
.void mergeWith(NodeStructure ns)
ns
- NodeStructureNodeStructure copy()
NodeStructure
NodeStructure
void decayNodeStructure(long ticks)
Linkable
s of this NodeStructure
.
ticks
- the number of ticks to decay for.Link getLink(ExtendedId ids)
ids
- ExtendedId
of sought Link.
java.util.Collection<Link> getLinks()
java.util.Set<Link> getLinks(LinkCategory cat)
LinkCategory
cat
- LinkCategory to search for.
LinkCategory
java.util.Set<Link> getAttachedLinks(Linkable l)
Link
s directly connected to specified Linkable.
l
- Linkable to find Links to and from.
java.util.Set<Link> getAttachedLinks(Linkable linkable, LinkCategory cat)
Link
s directly connected to specified Linkable with specified LinkCategory
linkable
- a Linkablecat
- LinkCategory
Node getNode(int id)
id
- id of node
Node getNode(ExtendedId eid)
eid
- ExtendedId of node
java.util.Collection<Node> getNodes()
Node
s
Node
s in this NodeStructure.Linkable getLinkable(ExtendedId eid)
Linkable
with specified ExtendedId
eid
- ExtendedId
java.util.Collection<Linkable> getLinkables()
NodeStructure
java.util.Map<Linkable,java.util.Set<Link>> getLinkableMap()
int getNodeCount()
int getLinkCount()
int getLinkableCount()
Linkable
s
Linkable
sjava.lang.String getDefaultNodeType()
java.lang.String getDefaultLinkType()
java.util.Map<Linkable,Link> getConnectedSinks(Node n)
Map
of all sink Linkable
s connected to specified Node
.
Keys are the connected sinks
Values are the Link
s connecting the sinks to the specified Node
n
- supplied node
java.util.Map<Node,Link> getConnectedSources(Linkable linkable)
Map
of all source Nodes connected to specified Linkable
.
Keys are the connected sources
Values are the Link
s connecting the sources to the specified Linkable
linkable
- specified linkable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |