public class Boid
extends org.graphstream.graph.implementations.AdjacencyListNode
A boid is both a particle in the forces system used to compute the position and motion of the object, and a GraphStream node. This allows to consider a graph made of all the boids.
The boid is in fact split in two parts, the Boid class itself that
represents the boid in the forces system. The boid particle in turn contains
a BoidForces object that represents all the forces exercising on the
boid. Globally, the Boid class acts on the graph and updates its
position, creating links toward other boids/nodes that it sees, whereas the
BoidForces are used to compute the boid position.
| Constructor and Description |
|---|
Boid(org.graphstream.graph.implementations.AbstractGraph graph,
BoidSpecies species,
String id)
New boid as a node in the given graph.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkNeighborhood(Boid... boids) |
static String |
getEdgeId(Boid b1,
Boid b2)
Compute the edge identifier between two boids knowing their individual
identifiers.
|
BoidForces |
getForces() |
org.miv.pherd.geom.Point3 |
getPosition()
Actual position of the boid in space.
|
BoidSpecies |
getSpecies()
Set of parameters used by this boid group.
|
void |
setForces(BoidForces forces) |
void |
setPosition(double x,
double y,
double z)
Force the position of the boid in space.
|
getDegree, getEdge, getEdgeBetween, getEdgeFrom, getEdgeIterator, getEdgeToward, getEnteringEdge, getEnteringEdgeIterator, getInDegree, getLeavingEdge, getLeavingEdgeIterator, getOutDegreegetBreadthFirstIterator, getBreadthFirstIterator, getDepthFirstIterator, getDepthFirstIterator, getEachEdge, getEachEnteringEdge, getEachLeavingEdge, getEdgeBetween, getEdgeBetween, getEdgeFrom, getEdgeFrom, getEdgeSet, getEdgeToward, getEdgeToward, getEnteringEdgeSet, getGraph, getLeavingEdgeSet, getNeighborNodeIterator, hasEdgeBetween, hasEdgeBetween, hasEdgeBetween, hasEdgeFrom, hasEdgeFrom, hasEdgeFrom, hasEdgeToward, hasEdgeToward, hasEdgeToward, isEnteringEdge, isIncidentEdge, isLeavingEdge, iteratoraddAttribute, 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 Boid(org.graphstream.graph.implementations.AbstractGraph graph,
BoidSpecies species,
String id)
graph - The graph this boids pertains to.id - The boid identifier in the graph and in the force system.public void setPosition(double x,
double y,
double z)
public org.miv.pherd.geom.Point3 getPosition()
public BoidSpecies getSpecies()
public void setForces(BoidForces forces)
public BoidForces getForces()
public void checkNeighborhood(Boid... boids)
Copyright © 2015. All rights reserved.