uwcse.location.objects.sim
Class SimulationDriver

java.lang.Object
  |
  +--com.intel.research.rain.Service
        |
        +--uwcse.location.LocationService
              |
              +--uwcse.location.FusionClientService
                    |
                    +--uwcse.location.objects.SensorDriver
                          |
                          +--uwcse.location.objects.sim.LogReaderDriver
                                |
                                +--uwcse.location.objects.sim.SimulationDriver
All Implemented Interfaces:
MessageHandler

public class SimulationDriver
extends LogReaderDriver

A SimulationDriver simulates a sensor hardware driver by generating Measurments read from an XML log file. The Measurements generated with the same relative timing in which they appear in the given log, only with current timestamps. For example, if the timestamps in the log are 3, 5, and 9 and a simulation is started at time 50 then the simulation will generate these measurements with timestamps set to 50, 52 (50+(5-3)), and 56 (50+(9-3)). Because relaitve time is what matters, log timestamps of 100, 102, and 106 would also be generated at time 50, 52, and 56 in a simulation started at time 50.

Version:
$Revision: 1.2 $
Author:
Jeffrey Hightower
See Also:
Measurement

Nested Class Summary
 
Nested classes inherited from class uwcse.location.LocationService
LocationService.RediscoverServices
 
Field Summary
 
Fields inherited from class uwcse.location.objects.SensorDriver
m_measurementSinkServiceIDSet, SINK_DISCOVERY_QUERY
 
Fields inherited from class uwcse.location.FusionClientService
FUSION_DISCOVERY_QUERY, m_fusionServiceIDSet
 
Fields inherited from class uwcse.location.LocationService
CONFIG_FILENAME, MESSAGE_ELEMENT, MESSAGE_EXTENSION, RPC_ELEMENT, RPC_EXCEPTION_ELEMENT, RPC_EXTENSION, RPC_RESULT_ELEMENT
 
Constructor Summary
SimulationDriver()
           
SimulationDriver(Collection measurementSinkIDs)
           
 
Method Summary
protected  void handleNextLogObject(Object@Measurement meas)
          Process the new measurement in the simulation.
static void main(String[] argv)
           
protected static void printUsageAndExit()
          Show the program argument usage and then exit.
 void runSimulation(String logfile, double timeCompression)
          Start a thread to simulate the given logfile.
 
Methods inherited from class uwcse.location.objects.sim.LogReaderDriver
handleNextLogObject, processLog
 
Methods inherited from class uwcse.location.objects.SensorDriver
sendMeasurement, withdraw
 
Methods inherited from class uwcse.location.FusionClientService
callFusionServiceRpc, getFusionServiceIDSet
 
Methods inherited from class uwcse.location.LocationService
addObject, callLocationRpc, correctedTimeMillis, getObject, getSysclockError, handleTerminalCommand, multicastLocationMsg, multicastLocationMsgs, processLocationMsg, processLocationRpc, runTerminalCommandLoop, sendLocationMsg, sendLocationMsgs, setDescription
 
Methods inherited from class com.intel.research.rain.Service
getDaemon, getDispatcher, getServiceID, process, receive, setDaemon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimulationDriver

public SimulationDriver()
                 throws RainException,
                        LocationException
Throws:
RainException
LocationException

SimulationDriver

public SimulationDriver(Collection measurementSinkIDs)
                 throws RainException,
                        LocationException
Throws:
RainException
LocationException
Method Detail

runSimulation

public void runSimulation(String logfile,
                          double timeCompression)
Start a thread to simulate the given logfile.


handleNextLogObject

protected void handleNextLogObject(Object@Measurement meas)
Process the new measurement in the simulation.

Overrides:
handleNextLogObject in class LogReaderDriver

printUsageAndExit

protected static void printUsageAndExit()
Show the program argument usage and then exit.


main

public static void main(String[] argv)


This documentation is for the Location Stack v0.8. The latest distribution, the documentation, and the list of contributors to the Location Stack can always be found at http://portolano.cs.washington.edu/projects/location/

© Copyright 2004 University of Washington CSE