public class BaseCluster extends Object
Modifier and Type | Field and Description |
---|---|
protected static double |
EARTH_RADIUS |
double[] |
mCenter |
protected long |
mDuration |
protected HashMap<String,Long> |
mHistogram |
protected String |
mSemanticId |
static String |
TAG |
protected static int |
VECTOR_LENGTH |
Constructor and Description |
---|
BaseCluster(Location location) |
BaseCluster(String semanticId,
double longitude,
double latitude,
long duration) |
Modifier and Type | Method and Description |
---|---|
void |
absorbCluster(BaseCluster cluster) |
protected void |
averageCenter(double[] newCenter,
long newDuration) |
float |
distanceToCenter(Location location) |
float |
distanceToCluster(BaseCluster cluster) |
void |
forgetPastHistory() |
void |
generateSemanticId(long index) |
protected double |
getCenterLatitude() |
protected double |
getCenterLongitude() |
long |
getDuration() |
HashMap<String,Long> |
getHistogram() |
protected double[] |
getLocationVector(double longitude,
double latitude) |
protected double[] |
getLocationVector(Location location) |
String |
getSemanticId() |
boolean |
hasSemanticId() |
protected void |
normalizeCenter() |
boolean |
passThreshold(long durationThreshold) |
void |
setCluster(BaseCluster cluster) |
void |
setHistogram(Map<String,Long> histogram) |
public static String TAG
public double[] mCenter
protected static final int VECTOR_LENGTH
protected long mDuration
protected String mSemanticId
protected static final double EARTH_RADIUS
public BaseCluster(Location location)
public BaseCluster(String semanticId, double longitude, double latitude, long duration)
public String getSemanticId()
public void generateSemanticId(long index)
public long getDuration()
public boolean hasSemanticId()
protected double[] getLocationVector(Location location)
protected double[] getLocationVector(double longitude, double latitude)
protected double getCenterLongitude()
protected double getCenterLatitude()
public float distanceToCenter(Location location)
public float distanceToCluster(BaseCluster cluster)
public void absorbCluster(BaseCluster cluster)
public void setCluster(BaseCluster cluster)
public boolean passThreshold(long durationThreshold)
public void forgetPastHistory()
protected void normalizeCenter()
protected void averageCenter(double[] newCenter, long newDuration)