generator2
Class PositionReporter

java.lang.Object
  |
  +--generator2.Reporter
        |
        +--generator2.PositionReporter

public class PositionReporter
extends Reporter

Class for reporting the positions of moving objects into a file.


Field Summary
protected  java.io.DataOutputStream dOut
          The data output stream.
protected  java.io.PrintWriter pOut
          The print writer.
 
Fields inherited from class generator2.Reporter
DEL_OBJECT, MOVE_OBJECT, NEW_OBJECT, numOfEdges, numOfPoints, objects, properties, random, SYMBOLLAYER, visualize, VIZ
 
Constructor Summary
PositionReporter(java.util.Properties properties, DrawableObjects objects)
          Constructor of the default reporter.
 
Method Summary
 void close()
          Closes the reporter.
protected static void print(java.io.DataOutputStream out, byte action, long id, int repNum, int objClass, int time, double x, double y, double speed, double doneDist, int nextNodeX, int nextNodeY)
          Prints the given point to the DataOutputStream.
protected static void print(java.io.PrintWriter out, java.lang.String action, long id, int repNum, int objClass, int time, double x, double y, double speed, double doneDist, int nextNodeX, int nextNodeY)
          Prints the given point to the print writer.
 void reportDisappearingObject(double time, long id, int repNum, int objClass, int x, int y, double doneDist, int reportProbability)
          Reports the characteristic properties of a dispappering object at a time stamp
 int reportMovingObject(int time, long id, int repNum, int objClass, double x, double y, double speed, double doneDist, int nextNodeX, int nextNodeY, int reportProbability)
          Reports the characteristic properties of a moving object at a time stamp according to its report probability.
 int reportNewMovingObject(int time, long id, int objClass, int x, int y, double speed, int nextNodeX, int nextNodeY, int reportProbability)
          Reports an new moving object if its report probability > 0.
 
Methods inherited from class generator2.Reporter
getNumberOfReportedEdges, getNumberOfReportedPoints, removeReportedObjects, reportDisappearingExternalObject, reportDouble, reportEdge, reportInt, reportMovingExternalObject, reportNewExternalObject, visualizeExternalObject, visualizeMovingObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dOut

protected java.io.DataOutputStream dOut
The data output stream.


pOut

protected java.io.PrintWriter pOut
The print writer.

Constructor Detail

PositionReporter

public PositionReporter(java.util.Properties properties,
                        DrawableObjects objects)
Constructor of the default reporter.

Parameters:
properties - properties of the generator
objects - container of drawable objects
Method Detail

close

public void close()
Closes the reporter.

Overrides:
close in class Reporter

print

protected static void print(java.io.PrintWriter out,
                            java.lang.String action,
                            long id,
                            int repNum,
                            int objClass,
                            int time,
                            double x,
                            double y,
                            double speed,
                            double doneDist,
                            int nextNodeX,
                            int nextNodeY)
Prints the given point to the print writer.

Parameters:
out - the print writer
action - the action of the object
id - object id
repNum - report number
objClass - object class
time - time stamp
x - current x-coordinate
y - current y-coordinate
speed - current speed
doneDist - the distance since the last reporting
nextNodeX - x-coordinate of the next node
nextNodeY - y-coordinate of the next node

print

protected static void print(java.io.DataOutputStream out,
                            byte action,
                            long id,
                            int repNum,
                            int objClass,
                            int time,
                            double x,
                            double y,
                            double speed,
                            double doneDist,
                            int nextNodeX,
                            int nextNodeY)
Prints the given point to the DataOutputStream.

Parameters:
out - the DataOutputStream
action - the action of the object
id - object id
repNum - report number
objClass - object class
time - time stamp
x - current x-coordinate
y - current y-coordinate
speed - current speed
doneDist - the distance since the last reporting
nextNodeX - x-coordinate of the next node
nextNodeY - y-coordinate of the next node

reportDisappearingObject

public void reportDisappearingObject(double time,
                                     long id,
                                     int repNum,
                                     int objClass,
                                     int x,
                                     int y,
                                     double doneDist,
                                     int reportProbability)
Reports the characteristic properties of a dispappering object at a time stamp

Overrides:
reportDisappearingObject in class Reporter
Parameters:
time - the arrival time (with fraction)
id - object id
repNum - report number
objClass - object class
x - x-coordinate
y - y-coordinate
doneDist - the distance since the last reporting
reportProbability - value between (0..1000)

reportMovingObject

public int reportMovingObject(int time,
                              long id,
                              int repNum,
                              int objClass,
                              double x,
                              double y,
                              double speed,
                              double doneDist,
                              int nextNodeX,
                              int nextNodeY,
                              int reportProbability)
Reports the characteristic properties of a moving object at a time stamp according to its report probability.

Overrides:
reportMovingObject in class Reporter
Parameters:
time - time stamp
id - object id
repNum - report number
objClass - object class
x - x-coordinate
y - y-coordinate
speed - current speed
doneDist - the distance since the last reporting
nextNodeX - x-coordinate of the next node
nextNodeY - y-coordinate of the next node
reportProbability - value between (0..1000)
Returns:
new report number

reportNewMovingObject

public int reportNewMovingObject(int time,
                                 long id,
                                 int objClass,
                                 int x,
                                 int y,
                                 double speed,
                                 int nextNodeX,
                                 int nextNodeY,
                                 int reportProbability)
Reports an new moving object if its report probability > 0.

Overrides:
reportNewMovingObject in class Reporter
Parameters:
time - time stamp
id - object id
objClass - object class
x - x-coordinate of start
y - y-coordinate of start
speed - current speed
nextNodeX - x-coordinate of the next node
nextNodeY - y-coordinate of the next node
reportProbability - value between (0..1000)