org.graphstream.boids
Class DemographicManager

java.lang.Object
  extended by org.graphstream.boids.DemographicManager
All Implemented Interfaces:
BoidGraphListener
Direct Known Subclasses:
DemographicManager.SpeciesDemographicManager

public class DemographicManager
extends Object
implements BoidGraphListener

Handles the appearance and disappearance of boids.

Author:
Guilhelm Savin, Antoine Dutot

Nested Class Summary
static class DemographicManager.SpeciesDemographicManager
          A demographic manager that handles boids species.
 
Constructor Summary
DemographicManager(BoidGraph ctx)
           
DemographicManager(BoidGraph ctx, Probability reproduceProbability, Probability deathProbability)
           
 
Method Summary
 void boidAdded(Boid boid)
          One boid was added.
 void boidDeleted(Boid boid)
          One boid was removed.
 void release()
          Release this manager, and remove as a listener for the graph.
 void setDeathProbability(Probability dp)
          Set the probability function for boid death.
 void setReproduceCondition(Probability rc)
          Set the probability function for boid reproduction.
 void step(double time)
          Call this method after each step of boid computation, to add or remove boids according to reproduction rules.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DemographicManager

public DemographicManager(BoidGraph ctx)

DemographicManager

public DemographicManager(BoidGraph ctx,
                          Probability reproduceProbability,
                          Probability deathProbability)
Method Detail

setReproduceCondition

public void setReproduceCondition(Probability rc)
Set the probability function for boid reproduction.

Parameters:
rc - The new probability.

setDeathProbability

public void setDeathProbability(Probability dp)
Set the probability function for boid death.

Parameters:
dp - The new probability.

boidAdded

public void boidAdded(Boid boid)
Description copied from interface: BoidGraphListener
One boid was added.

Specified by:
boidAdded in interface BoidGraphListener
Parameters:
boid - The added boid.

boidDeleted

public void boidDeleted(Boid boid)
Description copied from interface: BoidGraphListener
One boid was removed.

Specified by:
boidDeleted in interface BoidGraphListener
Parameters:
boid - The removed boid.

step

public void step(double time)
Call this method after each step of boid computation, to add or remove boids according to reproduction rules.

Specified by:
step in interface BoidGraphListener
Parameters:
time - The current iteration time.

release

public void release()
Release this manager, and remove as a listener for the graph.



Copyright © 2013. All Rights Reserved.