simulator_lib
Class SimulatorOutput

java.lang.Object
  extended by simulator_lib.SimulatorOutput

public class SimulatorOutput
extends java.lang.Object

The SimulatorOutput class assists the TraceSimulator driver program in writing data to the output/statistics file.


Field Summary
private  java.io.PrintWriter out
          Stream to the output/statistics file.
 
Constructor Summary
SimulatorOutput(java.lang.String filename)
          Construct a SimulatorOutput object.
 
Method Summary
private  java.lang.String print(SimulatorMalicious.MAL_STRATEGY STRATEGY)
          Return a string representation of a MAL_STRATEGY enumeration element.
 void printHeader(Globals GLOBALS, long gen_seed, TrustAlg TALG, SimulatorMalicious.MAL_STRATEGY STRATEGY)
          Write header to the output/statistics file, mostly global variable data.
 void printStatistics(Globals GLOBALS, Statistics STATS)
          Write final statistics to the output/statics file.
 void shutdown()
          Shutdown (flush and close) the output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private java.io.PrintWriter out
Stream to the output/statistics file.

Constructor Detail

SimulatorOutput

public SimulatorOutput(java.lang.String filename)
Construct a SimulatorOutput object.

Parameters:
filename - Path/filename of the output file to be written
Method Detail

printHeader

public void printHeader(Globals GLOBALS,
                        long gen_seed,
                        TrustAlg TALG,
                        SimulatorMalicious.MAL_STRATEGY STRATEGY)
Write header to the output/statistics file, mostly global variable data.

Parameters:
GLOBALS - The Network parameterization object
gen_seed - Random seed used in trace generation
TALG - The trust algorithm being used for this run
STRATEGY - Malicious strategy being applied during this simulation

printStatistics

public void printStatistics(Globals GLOBALS,
                            Statistics STATS)
Write final statistics to the output/statics file.

Parameters:
GLOBALS - The Network parameterization object
STATS - The statistical variable wrapper object

shutdown

public void shutdown()
Shutdown (flush and close) the output stream.


print

private java.lang.String print(SimulatorMalicious.MAL_STRATEGY STRATEGY)
Return a string representation of a MAL_STRATEGY enumeration element.

Parameters:
STRATEGY - MAL_STRATEGY enumeration element
Returns:
A string representation of a MAL_STRATEGY enumeration element