public class BoidGraph
extends org.graphstream.graph.implementations.AdjacencyListGraph
| Modifier and Type | Class and Description |
|---|---|
static class |
BoidGraph.Parameter |
| Modifier and Type | Field and Description |
|---|---|
static boolean |
VERBOSE |
| Constructor and Description |
|---|
BoidGraph()
New boids simulation represented as an interaction graph.
|
BoidGraph(String dgsConfig)
New boids simulation represented as an interaction graph.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBoidGraphListener(BoidGraphListener listener)
Register a listener for boid specific events.
|
BoidSpecies |
addDefaultSpecies()
Add a species with name "default" if does not yet exists.
|
void |
deleteSpecies(String name)
Remove a species.
|
org.graphstream.ui.view.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 |
stopLoop()
Stop the main simulation loop.
|
getEdge, getEdge, getEdgeCount, getEdgeIterator, getNode, getNode, getNodeCount, getNodeIteratoraddAttributeSink, addEdge, addEdge, addEdge, addEdge, addEdge, addEdge, addElementSink, addNode, addSink, attributeSinks, clear, clearAttributeSinks, clearElementSinks, clearSinks, display, edgeAdded, edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, edgeFactory, edgeRemoved, elementSinks, getEachEdge, getEachNode, getEdgeSet, getNodeSet, getReplayController, 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, stepBegins, write, writeaddAttribute, 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, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAttribute, 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, setAttributepublic 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.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
IllegalArgumentExceptionpublic void set(BoidGraph.Parameter param, String value)
public void stopLoop()
public void loop()
public void step()
public boolean isLooping()
public org.graphstream.ui.view.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 static void main(String... args)
Copyright © 2015. All rights reserved.