generator2
Class NodeReporter

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

public class NodeReporter
extends Reporter

Class for reporting the passed nodes into a file. Requires SDK 1.2 or higher.


Nested Class Summary
protected  class NodeReporter.ReportObject
          Internal class for representing report objects.
 
Field Summary
protected  java.io.DataOutputStream dOut
          The data output stream.
protected  java.io.PrintWriter pOut
          The print writer.
protected  java.util.Vector repObjs
          Vector for storing report objects.
 
Fields inherited from class generator2.Reporter
DEL_OBJECT, MOVE_OBJECT, NEW_OBJECT, numOfEdges, numOfPoints, objects, properties, random, SYMBOLLAYER, visualize, VIZ
 
Constructor Summary
NodeReporter(java.util.Properties properties, DrawableObjects objects)
          Constructor of the reporter.
 
Method Summary
 void close()
          Closes the reporter.
 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
 void reportEdge(double time, long objId, int edgeRepNum, int objClass, long edgeId, int edgeClass, int x1, int y1, double speed, int x2, int y2, int reportProbability)
          Does nothing.
 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.
protected  void reportObjects()
          Reports the objects from the "repObjs" vector.
 
Methods inherited from class generator2.Reporter
getNumberOfReportedEdges, getNumberOfReportedPoints, removeReportedObjects, reportDisappearingExternalObject, reportDouble, 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.


repObjs

protected java.util.Vector repObjs
Vector for storing report objects.

Constructor Detail

NodeReporter

public NodeReporter(java.util.Properties properties,
                    DrawableObjects objects)
Constructor of the 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

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)

reportEdge

public void reportEdge(double time,
                       long objId,
                       int edgeRepNum,
                       int objClass,
                       long edgeId,
                       int edgeClass,
                       int x1,
                       int y1,
                       double speed,
                       int x2,
                       int y2,
                       int reportProbability)
Does nothing. Can be modified for reporting the coordinates of a traversed edge if the report probability > 0.

Overrides:
reportEdge in class Reporter
Parameters:
time - time stamp (with fraction) when the edge is entried
objId - the id of the moving object id
edgeRepNum - the edge report number
objClass - object class
edgeId - the edge id
edgeClass - the edge class
x1 - the first x-coordinate
y1 - the first y-coordinate
speed - current speed
x2 - the second x-coordinate
y2 - the second y-coordinate
reportProbability - (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)

reportObjects

protected void reportObjects()
Reports the objects from the "repObjs" vector.