|
||||||||||
| 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 Nodes an Links. 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 of default type with specified attributes. |
Link |
addDefaultLink(int idSource,
int idSink,
LinkCategory type,
double activation,
double removalThreshold)
Creates and adds a new Link of default type with specified attributes. |
Link |
addDefaultLink(Link l)
Adds a copy, of default link type, based on the specified Link, to this NodeStructure. |
Link |
addDefaultLink(Node source,
Linkable sink,
LinkCategory category,
double activation,
double removalThreshold)
Creates and adds a new Link of default type with specified attributes. |
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. |
Node |
addDefaultNode(java.lang.String label,
double a,
double rt)
Creates, adds and returns a new Node of default type with specified attributes. |
java.util.Collection<Node> |
addDefaultNodes(java.util.Collection<Node> nodes)
|
Link |
addLink(Link l,
java.lang.String linkType)
Adds copy of specified Link. |
Link |
addLink(java.lang.String type,
int srcId,
ExtendedId snkId,
LinkCategory cat,
double a,
double rt)
Creates and adds a new Link of specified type with specified attributes. |
Link |
addLink(java.lang.String type,
Node src,
Linkable sink,
LinkCategory cat,
double a,
double rt)
Creates and adds a new Link of specified type with specified attributes. |
Node |
addNode(Node n,
java.lang.String type)
Add a Node of a specified type to this NodeStructure. If a Node with the same id already exists in the NodeStructure the existing Node will have its activation updated. |
Node |
addNode(java.lang.String type,
java.lang.String label,
double a,
double rt)
Creates, adds and returns a new Node of specified type with specified attributes. |
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 Linkables of this NodeStructure. |
java.util.Set<Link> |
getAttachedLinks(Linkable l)
Gets all Link objects directly connected to specified Linkable. |
java.util.Set<Link> |
getAttachedLinks(Linkable lnk,
LinkCategory cat)
Gets all Links directly connected to specified Linkable with specified LinkCategory |
java.util.Map<Linkable,Link> |
getConnectedSinks(Node n)
Returns a Map of all sink Linkable objects connected to specified Node. |
java.util.Map<Node,Link> |
getConnectedSources(Linkable lnk)
Returns a Map of all Nodes connected to specified Linkable as a source. |
java.lang.String |
getDefaultLinkType()
Gets default Link type of the NodeStructure. |
java.lang.String |
getDefaultNodeType()
Gets default Node type of the NodeStructure. |
Link |
getLink(ExtendedId id)
Gets Link with specified ExtendedId if present. |
Linkable |
getLinkable(ExtendedId id)
Gets Linkable with specified ExtendedId. |
int |
getLinkableCount()
Gets the number of linkables (nodes and links). |
java.util.Map<Linkable,java.util.Set<Link>> |
getLinkableMap()
Returns a map of all the Linkable objects currently in the NodeStructure and their attached links. |
java.util.Collection<Linkable> |
getLinkables()
Returns all Linkables, all Nodes and Links, currently in this NodeStructure. |
int |
getLinkCount()
Gets the number 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()
Gets the number of nodes. |
java.util.Collection<Node> |
getNodes()
Returns all Nodes. |
NodeStructure |
getSubgraph(java.util.Collection<Node> nodes,
int d)
Returns a copy of a subgraph of this NodeStructure. |
NodeStructure |
getSubgraph(java.util.Collection<Node> nodes,
int d,
double threshold)
Returns a copy of a subgraph of this NodeStructure. |
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 |
|---|
Node addDefaultNode(java.lang.String label,
double a,
double rt)
Node of default type with specified attributes.
label - label of new Nodea - initial activation of new Nodert - initial removal threshold of new Node
Node added to the NodeStructure or nullNode addDefaultNode(Node n)
Node to this NodeStructure. The copy will be of the default
type of this NodeStructure, NOT of the type of the specified node. If Node with the same
id already exists the the old node's activation is updated ONLY IF it is higher than the existing activation.
n - Node to add.
java.util.Collection<Node> addDefaultNodes(java.util.Collection<Node> nodes)
nodes - Node to be added.
addDefaultNode(Node)
Node addNode(java.lang.String type,
java.lang.String label,
double a,
double rt)
Node of specified type with specified attributes.
type - Factory type of new Nodelabel - label of new Nodea - initial activation of new Nodert - initial removal threshold of new Node
Node added to the NodeStructure or null
Node addNode(Node n,
java.lang.String type)
n - Nodetype - name of node's type in ElementFactory
Link addDefaultLink(Node source,
Linkable sink,
LinkCategory category,
double activation,
double removalThreshold)
source - Link's source Nodesink - Link's sink, a Node or a Linkcategory - Link's LinkCategoryactivation - 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 LinkCategoryactivation - 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 LinkCategoryactivation - initial link activationremovalThreshold - amount of activation Link must maintain to remain in this NodeStructure after decaying.
Link addDefaultLink(Link l)
Link, to this NodeStructure. If Link with the same
id already exists then the old Link's activation is updated.
Copied link will have the default link type of this 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(java.lang.String type,
int srcId,
ExtendedId snkId,
LinkCategory cat,
double a,
double rt)
Link of specified type with specified attributes. Source and sink must
already be in this NodeStructure.
type - Factory type of the link to be createdsrcId - id of link's sourcesnkId - ExtendedId of link's sinkcat - Link's LinkCategorya - initial link activationrt - removal threshold, amount of activation Link must maintain to remain in this NodeStructure after decaying.
Link addLink(java.lang.String type,
Node src,
Linkable sink,
LinkCategory cat,
double a,
double rt)
Link of specified type with specified attributes. Source and sink must
already be in this NodeStructure.
type - Factory type of the link to be createdsrc - the link's source Nodesink - the link's sink Linkablecat - the link's LinkCategorya - initial link activationrt - removal threshold, amount of activation Link must maintain to remain in this NodeStructure after decaying.
Link addLink(Link l,
java.lang.String linkType)
l - original LinklinkType - type of copied Link
Link or null if such a link cannot be created.void removeNode(Node n)
Node if present.
n - Node to remove.void removeLink(Link l)
Link if present.
l - Link 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.
NodeStructurevoid decayNodeStructure(long ticks)
Linkables of this NodeStructure.
ticks - the number of ticks to decay for.Node getNode(int id)
id - id of node
Node getNode(ExtendedId eid)
ExtendedId.
eid - ExtendedId of node
java.util.Collection<Node> getNodes()
Nodes.
Nodes in this NodeStructureLink getLink(ExtendedId id)
Link with specified ExtendedId if present.
id - ExtendedId of sought Link
java.util.Collection<Link> getLinks()
UnmodifiableCollection of all Linksjava.util.Set<Link> getLinks(LinkCategory cat)
LinkCategory.
cat - the LinkCategory to search for
LinkCategoryjava.util.Set<Link> getAttachedLinks(Linkable l)
Link objects directly connected to specified Linkable.
l - the Linkable whose attached links will be returned
UnmodifiableSet of all Links connected to specified Linkable
java.util.Set<Link> getAttachedLinks(Linkable lnk,
LinkCategory cat)
Links directly connected to specified Linkable with specified LinkCategory
lnk - a Linkablecat - LinkCategory
Linkable getLinkable(ExtendedId id)
Linkable with specified ExtendedId.
id - ExtendedId
java.util.Collection<Linkable> getLinkables()
NodeStructure.
java.util.Map<Linkable,java.util.Set<Link>> getLinkableMap()
Linkable objects currently in the NodeStructure and their attached links.
UnmodifiableMap of the Linkable objects in this NodeStructure and their attached links.java.util.Map<Linkable,Link> getConnectedSinks(Node n)
Map of all sink Linkable objects connected to specified Node.
The keys of the map are the connected sinks and the values are the Links connecting the sinks to the specified Node.
n - supplied node
java.util.Map<Node,Link> getConnectedSources(Linkable lnk)
Map of all Nodes connected to specified Linkable as a source.
The keys of the map are the connected sources and the values are the Links connecting the sources to the specified Linkable
lnk - the Linkable whose connected sources will be returned
Map of all sources connected to lnk and the links connecting them to lnkint getNodeCount()
int getLinkCount()
int getLinkableCount()
Linkable objects currently in the NodeStructurejava.lang.String getDefaultNodeType()
Node type of the NodeStructure.
Node objects in the NodeStructurejava.lang.String getDefaultLinkType()
Link type of the NodeStructure.
Link objects in the NodeStructure
NodeStructure getSubgraph(java.util.Collection<Node> nodes,
int d)
NodeStructure.
The subgraph will contain all specified nodes with non-zero activation if
they are currently present in the NodeStructure.
Additionally all other nodes having distance, the number of links, less or equal to d from the specified nodes and
that have non-zero activation are part of the subgraph.
If a Node has non-zero activation then the depth-first search will not continue further from that Node.
Finally all links that connect two Linkable elements that are both d or less from the specified nodes are included in the subgraph.
nodes - the nodes which will be the roots from which the subgraph will be formedd - the greatest distance a node can be from a specified nodes to be included in the subgraph
NodeStructure getSubgraph(java.util.Collection<Node> nodes,
int d,
double threshold)
NodeStructure.
The subgraph will contain all specified nodes with activation at or above specified threshold if
they are currently present in the NodeStructure.
Additionally all other nodes having distance, the number of links, less or equal to d from the specified nodes and
that have sufficient activation are part of the subgraph.
If a Node has insufficient activation then the depth-first search will not continue further from that Node.
Finally all links that connect two Linkable elements that are both d or less from the specified nodes are included in the subgraph.
nodes - the nodes which will be the roots from which the subgraph will be formedd - the greatest distance a node can be from a specified nodes to be included in the subgraphthreshold - activation requirement for a node to be part of the subgraph.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||