jAER project on SourceForge

net.sf.jaer.eventprocessing.tracking
Class ClusterTracker.Cluster

java.lang.Object
  extended by net.sf.jaer.eventprocessing.tracking.ClusterTracker.Cluster
Enclosing class:
ClusterTracker

public class ClusterTracker.Cluster
extends java.lang.Object

Represents a single tracked object


Field Summary
protected  java.awt.Color color
           
protected  float eventRate
           
protected  int firstTimestamp
           
protected  int lastTimestamp
           
 java.awt.geom.Point2D.Float location
           
protected  int MAX_PATH_LENGTH
           
protected  int numEvents
           
protected  java.util.ArrayList<java.awt.geom.Point2D.Float> path
           
 float tauMsVelocity
           
 java.awt.geom.Point2D.Float velocity
           
 
Constructor Summary
ClusterTracker.Cluster()
           
ClusterTracker.Cluster(BasicEvent ev)
           
ClusterTracker.Cluster(ClusterTracker.Cluster one, ClusterTracker.Cluster two)
          Constructs a cluster by merging two clusters
 
Method Summary
 void addEvent(BasicEvent event)
           
 float distanceMetric(float dx, float dy)
           
 float distanceTo(BasicEvent event)
           
protected  float distanceTo(ClusterTracker.Cluster c)
           
 int getClusterNumber()
           
 java.awt.Color getColor()
           
 int getLastEventTimestamp()
           
 int getLifetime()
           
 java.awt.geom.Point2D.Float getLocation()
           
 java.util.ArrayList<java.awt.geom.Point2D.Float> getPath()
           
 float getRadius()
           
 java.awt.geom.Point2D.Float getVelocity()
           
 boolean isVisible()
           
 void scale(BasicEvent event)
          sets the cluster radius according to distance of event from cluster center
 void setClusterNumber(int clusterNumber)
           
 void setColor(java.awt.Color color)
           
 void setLocation(java.awt.geom.Point2D.Float l)
           
 void setRadius(float r)
           
 java.lang.String toString()
           
 void updatePath()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

location

public java.awt.geom.Point2D.Float location

velocity

public java.awt.geom.Point2D.Float velocity

tauMsVelocity

public float tauMsVelocity

MAX_PATH_LENGTH

protected final int MAX_PATH_LENGTH
See Also:
Constant Field Values

path

protected java.util.ArrayList<java.awt.geom.Point2D.Float> path

color

protected java.awt.Color color

numEvents

protected int numEvents

lastTimestamp

protected int lastTimestamp

firstTimestamp

protected int firstTimestamp

eventRate

protected float eventRate
Constructor Detail

ClusterTracker.Cluster

public ClusterTracker.Cluster()

ClusterTracker.Cluster

public ClusterTracker.Cluster(BasicEvent ev)

ClusterTracker.Cluster

public ClusterTracker.Cluster(ClusterTracker.Cluster one,
                              ClusterTracker.Cluster two)
Constructs a cluster by merging two clusters

Method Detail

getLastEventTimestamp

public int getLastEventTimestamp()

addEvent

public void addEvent(BasicEvent event)

scale

public final void scale(BasicEvent event)
sets the cluster radius according to distance of event from cluster center

Parameters:
event - the event to scale with

distanceTo

public float distanceTo(BasicEvent event)
Returns:
distance of this cluster to the event in manhatten (cheap) metric (sum of abs values of x and y distance

distanceMetric

public float distanceMetric(float dx,
                            float dy)

distanceTo

protected final float distanceTo(ClusterTracker.Cluster c)
Returns:
distance of this cluster to the other cluster

getRadius

public final float getRadius()

setRadius

public void setRadius(float r)

getLocation

public final java.awt.geom.Point2D.Float getLocation()

setLocation

public void setLocation(java.awt.geom.Point2D.Float l)

isVisible

public final boolean isVisible()
Returns:
true if cluster has enough support

getLifetime

public final int getLifetime()
Returns:
lifetime of cluster in timestamp ticks

updatePath

public final void updatePath()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getPath

public java.util.ArrayList<java.awt.geom.Point2D.Float> getPath()

getColor

public java.awt.Color getColor()

setColor

public void setColor(java.awt.Color color)

getVelocity

public java.awt.geom.Point2D.Float getVelocity()
Returns:
averaged velocity of cluster in pixels per second. The velocity is instantaneously computed from the movement of the cluster caused by the last event, then this velocity is mixed with the the old velocity by the mixing factor. Thus the mixing factor is appplied twice: once for moving the cluster and again for changing the velocity.

getClusterNumber

public int getClusterNumber()

setClusterNumber

public void setClusterNumber(int clusterNumber)

jAER project on SourceForge