public abstract class Vertex<BGS extends simudyne.core.graph.BaseGlobalState>
extends java.lang.Object
| Constructor and Description |
|---|
Vertex() |
| Modifier and Type | Method and Description |
|---|---|
<L extends Link> |
addLink(long vertexID,
java.lang.Class<L> clazz)
addLink(long, Class, Consumer) without a data injector so no initial function is
run for links. |
<L extends Link> |
addLink(long vertexID,
java.lang.Class<L> clazz,
java.util.function.Consumer<L> dataInjector)
Create a new link from this vertex to the target vertexID, with the given associated data.
|
<L extends Link> |
addLink(simudyne.core.graph.PreSpawnedAgent<?> preSpawnedAgent,
java.lang.Class<L> clazz)
addLink(PreSpawnedAgent, Class, Consumer) without a data injector so no initial
function is run for links. |
<L extends Link> |
addLink(simudyne.core.graph.PreSpawnedAgent<?> preSpawnedAgent,
java.lang.Class<L> clazz,
java.util.function.Consumer<L> dataInjector)
Create a new link from this vertex to the target vertexID, with the given associated data.
|
<L extends Link> |
addLinks(java.util.Collection<java.lang.Long> vertexIDs,
java.lang.Class<L> clazz)
addLinks(Collection, Class) without a data injector so no initial function is
run for links. |
<L extends Link> |
addLinks(java.util.Collection<java.lang.Long> vertexIDs,
java.lang.Class<L> clazz,
java.util.function.Consumer<L> dataInjector)
Create a new link from this vertex to a group of target vertexIDs, with the given associated
data.
|
void |
dispose() |
protected Environment<BGS> |
getEnvironment() |
long |
getID() |
java.util.List<? extends Link> |
getLinks()
Get all of the vertex's links.
|
<L extends Link> |
getLinks(java.lang.Class<L> clazz)
Get the vertex's links of the given type.
|
FilteredLinks<? extends Link> |
getLinksTo(long targetID)
Get the vertex's links to the given target ID.
|
<L extends Link> |
getLinksTo(long targetID,
java.lang.Class<L> clazz)
Get the vertex's links of specified class to the given target ID.
|
SeededRandom |
getPrng() |
boolean |
hasLinks() |
boolean |
hasLinks(java.lang.Class<? extends Link> clazz) |
boolean |
hasLinksTo(long targetID) |
boolean |
hasLinksTo(long targetID,
java.lang.Class<? extends Link> clazz) |
void |
removeLinks()
Removes all the vertex's links.
|
void |
removeLinks(java.lang.Class<? extends Link> clazz)
Removes all vertex's links of a given type.
|
void |
removeLinksTo(long targetID)
Removes the vertex's links to a certain target ID.
|
void |
removeLinksTo(long targetID,
java.lang.Class<? extends Link> clazz)
Removes the vertex's links to a certain targetID of a given type.
|
protected void |
setEnvironment(Environment<BGS> env) |
abstract void |
step(Environment<BGS> environment) |
public abstract void step(Environment<BGS> environment)
public long getID()
public SeededRandom getPrng()
public java.util.List<? extends Link> getLinks()
Note that without a specific link class, data for the link will not be accessible.
public <L extends Link> FilteredLinks<L> getLinks(java.lang.Class<L> clazz)
clazz - The link data class.Links of the given class.public FilteredLinks<? extends Link> getLinksTo(long targetID)
targetID - The target vertex ID.Links to the given targetpublic <L extends Link> FilteredLinks<L> getLinksTo(long targetID, java.lang.Class<L> clazz)
targetID - The target vertex ID.clazz - The link data classLinks to the given targetpublic boolean hasLinks()
Links to other vertices.public boolean hasLinks(java.lang.Class<? extends Link> clazz)
clazz - The link data classLinks of specified class to other vertices.public boolean hasLinksTo(long targetID)
targetID - The target vertex ID.Links to vertex with given targetID.public boolean hasLinksTo(long targetID,
java.lang.Class<? extends Link> clazz)
targetID - The target vertex ID.clazz - The link data classLinks of specified class to vertex with given targetID.public void removeLinks()
public void removeLinks(java.lang.Class<? extends Link> clazz)
clazz - The link data class.public void removeLinksTo(long targetID)
targetID - ID of the vertex you want to remove the link to.public void removeLinksTo(long targetID,
java.lang.Class<? extends Link> clazz)
targetID - ID of the vertex you want to remove the link to.clazz - The link data class.public <L extends Link> L addLink(long vertexID, java.lang.Class<L> clazz)
addLink(long, Class, Consumer) without a data injector so no initial function is
run for links.public <L extends Link> L addLink(long vertexID, java.lang.Class<L> clazz, java.util.function.Consumer<L> dataInjector)
vertexID - ID of the vertex to link to.dataInjector - Function run when each link is created which can be used to set its values.public <L extends Link> L addLink(simudyne.core.graph.PreSpawnedAgent<?> preSpawnedAgent, java.lang.Class<L> clazz)
addLink(PreSpawnedAgent, Class, Consumer) without a data injector so no initial
function is run for links.public <L extends Link> L addLink(simudyne.core.graph.PreSpawnedAgent<?> preSpawnedAgent, java.lang.Class<L> clazz, java.util.function.Consumer<L> dataInjector)
preSpawnedAgent - spawned agent to link to.dataInjector - Function run when each link is created which can be used to set its values.public <L extends Link> java.util.List<L> addLinks(java.util.Collection<java.lang.Long> vertexIDs, java.lang.Class<L> clazz)
addLinks(Collection, Class) without a data injector so no initial function is
run for links.public <L extends Link> java.util.List<L> addLinks(java.util.Collection<java.lang.Long> vertexIDs, java.lang.Class<L> clazz, java.util.function.Consumer<L> dataInjector)
vertexIDs - Collection of IDs of the vertex to link to.dataInjector - Function run when each link is created which can be used to set its values.protected void setEnvironment(Environment<BGS> env)
public void dispose()
protected Environment<BGS> getEnvironment()