|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.graphstream.graph.implementations.AbstractElement
org.graphstream.graph.implementations.AbstractGraph
org.graphstream.graph.implementations.AdjacencyListGraph
org.graphstream.boids.BoidGraph
public class BoidGraph
Represents a boid simulation and their underlying interaction graph.
| Nested Class Summary | |
|---|---|
static class |
BoidGraph.Parameter
|
| Nested classes/interfaces inherited from class org.graphstream.graph.implementations.AbstractElement |
|---|
org.graphstream.graph.implementations.AbstractElement.AttributeChangeEvent |
| Field Summary | |
|---|---|
static boolean |
VERBOSE
|
| Fields inherited from class org.graphstream.graph.implementations.AdjacencyListGraph |
|---|
DEFAULT_EDGE_CAPACITY, DEFAULT_NODE_CAPACITY, GROW_FACTOR |
| Constructor Summary | |
|---|---|
BoidGraph()
New boids simulation represented as an interaction graph. |
|
BoidGraph(String dgsConfig)
New boids simulation represented as an interaction graph. |
|
| Method Summary | ||
|---|---|---|
void |
addBoidGraphListener(BoidGraphListener listener)
Register a listener for boid specific events. |
|
BoidSpecies |
addDefaultSpecies()
Add a species with name "default" if does not yet exists. |
|
|
addNode(String nodeId)
|
|
void |
deleteSpecies(String name)
Remove a species. |
|
org.graphstream.ui.swingViewer.Viewer |
display(boolean autoLayout)
|
|
double |
getArea()
|
|
BoidSpecies |
getDefaultSpecies()
The species whose name is "default". |
|
org.miv.pherd.geom.Point3 |
getHighAnchor()
|
|
org.miv.pherd.geom.Point3 |
getLowAnchor()
|
|
int |
getMaxSteps()
|
|
BoidSpecies |
getOrCreateSpecies(String name)
|
|
BoidSpecies |
getOrCreateSpecies(String name,
String clazz)
|
|
Random |
getRandom()
The random number generator used. |
|
long |
getRandomSeed()
|
|
int |
getSleepTime()
|
|
BoidSpecies |
getSpecies(String name)
The species with the given name. |
|
int |
getSpeciesCount()
The number of boid species actually. |
|
boolean |
isForcesAttributesStored()
|
|
boolean |
isLooping()
|
|
boolean |
isNormalizeMode()
|
|
void |
loadDGSConfiguration(InputStream in)
Load configuration from a dgs file. |
|
void |
loadDGSConfiguration(String dgs)
Load configuration from a dgs file or resource. |
|
void |
loop()
Run the simulation in a loop. |
|
static void |
main(String... args)
|
|
void |
removeBoidGraphListener(BoidGraphListener listener)
Unregister a listener for boid specific events. |
|
void |
set(BoidGraph.Parameter param,
String value)
|
|
void |
set(String paramName,
String value)
|
|
void |
setArea(double area)
|
|
void |
setForcesFactory(BoidForcesFactory bff)
Set the factory used to instantiate the force system to use. |
|
void |
setMaxSteps(int maxSteps)
|
|
void |
setNormalizeMode(boolean on)
|
|
void |
setRandomSeed(long randomSeed)
|
|
void |
setSleepTime(int sleepTime)
|
|
void |
setStoreForcesAttributes(boolean storeForcesAttributes)
|
|
void |
step()
|
|
void |
stepBegins(double step)
|
|
void |
stopLoop()
Stop the main simulation loop. |
|
| Methods inherited from class org.graphstream.graph.implementations.AdjacencyListGraph |
|---|
getEdge, getEdge, getEdgeCount, getEdgeIterator, getNode, getNode, getNodeCount, getNodeIterator |
| Methods inherited from class org.graphstream.graph.implementations.AbstractGraph |
|---|
addAttributeSink, addEdge, addEdge, addEdge, addEdge, addEdge, addEdge, addElementSink, addSink, attributeSinks, clear, clearAttributeSinks, clearElementSinks, clearSinks, display, edgeAdded, edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, edgeFactory, edgeRemoved, elementSinks, getEachEdge, getEachNode, getEdgeSet, getNodeSet, getStep, graphAttributeAdded, graphAttributeChanged, graphAttributeRemoved, graphCleared, isAutoCreationEnabled, isStrict, iterator, nodeAdded, nodeAttributeAdded, nodeAttributeChanged, nodeAttributeRemoved, nodeFactory, nodeRemoved, nullAttributesAreErrors, read, read, removeAttributeSink, removeEdge, removeEdge, removeEdge, removeEdge, removeEdge, removeEdge, removeElementSink, removeNode, removeNode, removeNode, removeSink, setAutoCreate, setEdgeFactory, setNodeFactory, setNullAttributesAreErrors, setStrict, stepBegins, write, write |
| Methods inherited from class org.graphstream.graph.implementations.AbstractElement |
|---|
addAttribute, addAttributes, changeAttribute, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getAttributeKeyIterator, getAttributeKeySet, getEachAttributeKey, getFirstAttributeOf, getFirstAttributeOf, getHash, getId, getIndex, getLabel, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasHash, hasLabel, hasNumber, hasVector, removeAttribute, setAttribute, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.graphstream.graph.Element |
|---|
addAttribute, addAttributes, changeAttribute, clearAttributes, getArray, getAttribute, getAttribute, getAttributeCount, getAttributeKeyIterator, getAttributeKeySet, getFirstAttributeOf, getFirstAttributeOf, getHash, getId, getIndex, getLabel, getNumber, getVector, hasArray, hasAttribute, hasAttribute, hasHash, hasLabel, hasNumber, hasVector, removeAttribute, setAttribute |
| Field Detail |
|---|
public static boolean VERBOSE
| Constructor Detail |
|---|
public BoidGraph()
All parameters are set to defaults.
public BoidGraph(String dgsConfig)
throws IOException
This pre-load a configuration from a DGS file.
dgsConfig - The initial configuration in DGS format.
IOException - If the DGS cannot be read.| Method Detail |
|---|
public void loadDGSConfiguration(String dgs)
throws IOException
ClassLoader.getResourceAsStream(String).
dgs - path to the DGS file or resource containing the configuration.
IOException - if something wrong happens with io.
public void loadDGSConfiguration(InputStream in)
throws IOException
in -
IOException - if something wrong happens with io.public void setForcesFactory(BoidForcesFactory bff)
bff - The force system factory.public double getArea()
public void setArea(double area)
public org.miv.pherd.geom.Point3 getLowAnchor()
public org.miv.pherd.geom.Point3 getHighAnchor()
public long getRandomSeed()
public void setRandomSeed(long randomSeed)
public int getSleepTime()
public void setSleepTime(int sleepTime)
public boolean isNormalizeMode()
public void setNormalizeMode(boolean on)
public boolean isForcesAttributesStored()
public void setStoreForcesAttributes(boolean storeForcesAttributes)
public int getMaxSteps()
public void setMaxSteps(int maxSteps)
public Random getRandom()
public BoidSpecies getOrCreateSpecies(String name)
public BoidSpecies getOrCreateSpecies(String name,
String clazz)
public BoidSpecies getSpecies(String name)
name - The species name.
public int getSpeciesCount()
public BoidSpecies getDefaultSpecies()
public BoidSpecies addDefaultSpecies()
public void deleteSpecies(String name)
name - The species name.
public void set(String paramName,
String value)
throws IllegalArgumentException
IllegalArgumentException
public void set(BoidGraph.Parameter param,
String value)
public void stopLoop()
public void loop()
public void step()
public void stepBegins(double step)
stepBegins in interface org.graphstream.graph.GraphstepBegins in class org.graphstream.graph.implementations.AbstractGraphpublic boolean isLooping()
public org.graphstream.ui.swingViewer.Viewer display(boolean autoLayout)
display in interface org.graphstream.graph.Graphdisplay in class org.graphstream.graph.implementations.AbstractGraphpublic void addBoidGraphListener(BoidGraphListener listener)
listener - The listener to register.public void removeBoidGraphListener(BoidGraphListener listener)
listener - The listener to remove.public <T extends org.graphstream.graph.Node> T addNode(String nodeId)
addNode in interface org.graphstream.graph.GraphaddNode in class org.graphstream.graph.implementations.AbstractGraphpublic static void main(String... args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||