public class ExternalPathMovementReader
extends java.lang.Object
External movement reader for traces that are in path format. Uses two trace files, one for the paths and one for specifying activity times. Nodes will follow the paths in the trace file, and pause between paths. Activity times refer to the periods of time when there is valid trace data about the node.
Reads external traces that are of the form:
id time_1,x_1,y_1 time_2,x_2,y_2 ... \n
The first line should be:>
maxID minTime maxTime minX maxX minY maxY
Activity trace file format is:
id activeStart activeEnd\n
Trace and activity files ending in .zip, .gz or .gzip are assumed to be
compressed and will be automatically uncompressed during reading. The whole
trace is loaded into memory at once.
| Modifier and Type | Class and Description |
|---|---|
class |
ExternalPathMovementReader.ActiveTime
Describes a node's activity time
|
class |
ExternalPathMovementReader.Entry
Represents a point on the path.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<ExternalPathMovementReader.ActiveTime> |
getActive(int ID)
Returns the active time for the given ID.
|
static ExternalPathMovementReader |
getInstance(java.lang.String traceFilePath,
java.lang.String activeFilePath)
Get an instance of the reader for the given file path.
|
double |
getMaxTime()
Returns offset maxTime
|
double |
getMaxX()
Returns offset maxX
|
double |
getMaxY()
Returns offset maxY
|
double |
getMinTime()
Returns offset minTime
|
double |
getMinX()
Returns offset minX
|
double |
getMinY()
Returns offset minY
|
java.util.List<java.util.List<ExternalPathMovementReader.Entry>> |
getPaths(int ID)
Returns the path for the node with the given ID.
|
void |
setNormalize(boolean normalize)
Sets normalizing of read values on/off.
|
public java.util.List<java.util.List<ExternalPathMovementReader.Entry>> getPaths(int ID)
ID - ID of the nodepublic java.util.List<ExternalPathMovementReader.ActiveTime> getActive(int ID)
ID - ID of the nodepublic void setNormalize(boolean normalize)
#readNextMovements() are decremented by minimum values of the
offsets. Default is on (normalize).normalize - If true, normalizing is on (false -> off).public double getMaxTime()
public double getMaxX()
public double getMaxY()
public double getMinTime()
public double getMinX()
public double getMinY()
public static ExternalPathMovementReader getInstance(java.lang.String traceFilePath, java.lang.String activeFilePath)
filePath - path where the file is read from