feynman.framework.simulation
Class Simulation

java.lang.Object
  |
  +--feynman.framework.simulation.Simulation
All Implemented Interfaces:
java.io.Serializable

public class Simulation
extends java.lang.Object
implements java.io.Serializable

Bean that represents a simulation in the framework. Many of the attributes of the simulation bean are defined in the Simulation.properties file by the user of the framework.

The Controller class uses the simulation bean to control the creation of the correct classes for the simulation.

Version:
$Revision: 1.1.1.1 $ $Date: 2002/11/12 02:25:42 $
Author:
Wes Bailey
See Also:
Serialized Form

Method Summary
 boolean doFinalReport()
          Alternative query to produce a final report or not.
 java.lang.String getDataStore()
          Use this method to get the DateStore.
 java.lang.String getDataStoreFile()
          Use this method to get the DateStoreFile.
 boolean getDoFinalReport()
          Use this method to query whether to produce a final report or not.
 java.lang.String getFinalReportClass()
          Use this method to get the class for the final report.
static Simulation getInstance()
          Use this method to get an instance of the Simulation class.
 double getInterval()
          Use this method to get the interval which is usually a timestep.
 int getIterations()
          Use this method to get the iterations the simulation will perform.
 int getNumberMeasurements()
          Use this method to get the number of measurements the simulation is to perform.
 int getNumberPhysicalObjects()
          Use this method to get the number of PhyscialObjects to create.
 boolean getPerformMeasurement()
          Use this method to get the PerformMeasurement value.
 java.lang.String getPhysicalAlgorithmClass()
          Use this method to get the PhysicalAlgorithmClass.
 java.lang.String getPhysicalConfigurationClass()
          Use this method to get the PhysicalConfigurationClass.
 java.lang.String getPhysicalMeasurementClass()
          Use this method to get the PhysicalMeasurementClass.
 java.lang.String getPhysicalObjectClass()
          Use this method to get the PhysicalObjectClass.
 java.lang.String getPhysicalObjectFactoryClass()
          Use this method to get the PhysicalObjectFactoryClass.
 java.lang.String getPhysicalSystemClass()
          Use this method to get the PhysicalSystemClass.
 boolean getRunning()
          Use this method to get the boolean value for if the simulation is running.
 double getStartTime()
          Use this method to get the start time of the simulation.
 double getTime()
          Use this method to get the current value of the time in the simulation.
 boolean isRunning()
          Method to test whether the simulation should still be running or not.
 void setDataStore(java.lang.String dataStore)
          Use this method to specify the DataStore.
 void setDataStoreFile(java.lang.String dataStoreFile)
          Use this method to specify the DataStoreFile.
 void setDoFinalReport(boolean doFinalReport)
          Use this method to indicate a final report should be produced.
 void setFinalReportClass(java.lang.String finalReportClass)
          Use this method to define a class that performs a summary report of the simulation.
 void setInterval(double interval)
          Use this method to specify the timestep interval to be used to calculate the running time.
 void setIterations(int iterations)
          Use this method to specify the number of iterations to perform.
 void setNumberMeasurements(int numberMeasurements)
          Use this method to specify the number of Measurements to make if PerformMeasurement is set to true.
 void setNumberPhysicalObjects(int numberPhysicalObjects)
          Use this method to specify the number of physical objects to be created and used in the simulation.
 void setPerformMeasurement(boolean performMeasurement)
          Use this method to specify to PerformMeasurement on/off.
 void setPhysicalAlgorithmClass(java.lang.String physicalAlgorithmClass)
          Use this method to specify the PhysicalAlgorithmClass.
 void setPhysicalConfigurationClass(java.lang.String physicalConfigurationClass)
          Use this method to specify the PhysicalConfigurationClass.
 void setPhysicalMeasurementClass(java.lang.String physicalMeasurementClass)
          Use this method to specify the PhysicalMeasurementClass.
 void setPhysicalObjectClass(java.lang.String physicalObjectClass)
          Use this method to specify the PhysicalObjectClass.
 void setPhysicalObjectFactoryClass(java.lang.String physicalObjectFactoryClass)
          Use this method to specify the PhysicalObjectFactoryClass.
 void setPhysicalSystemClass(java.lang.String physicalSystemClass)
          Use this method to specify the PhysicalSystemClass.
 void setRunning(boolean running)
          Use this method to specify that the simulation is running and should continue to run.
 void setStartTime(double startTime)
          Use this method to specify the time at the start of the simulation.
 void setTime(double time)
          Use this method to specify the time during any point during the simulation.
 java.lang.String toString()
          Get a string representation of the object.
 void updateTime()
          Use this method to update the time during any point during the simulation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static Simulation getInstance()
Use this method to get an instance of the Simulation class.

setPhysicalSystemClass

public void setPhysicalSystemClass(java.lang.String physicalSystemClass)
Use this method to specify the PhysicalSystemClass.
Parameters:
physicalSystemClass - The name of the PhysicalSystem class

getPhysicalSystemClass

public java.lang.String getPhysicalSystemClass()
Use this method to get the PhysicalSystemClass.

setPhysicalObjectClass

public void setPhysicalObjectClass(java.lang.String physicalObjectClass)
Use this method to specify the PhysicalObjectClass.
Parameters:
physicalSystemClass - The name of the PhysicalObject class

getPhysicalObjectClass

public java.lang.String getPhysicalObjectClass()
Use this method to get the PhysicalObjectClass.

setPhysicalObjectFactoryClass

public void setPhysicalObjectFactoryClass(java.lang.String physicalObjectFactoryClass)
Use this method to specify the PhysicalObjectFactoryClass.
Parameters:
physicalObjectFactoryClass - The name of the PhysicalObjectFactory class

getPhysicalObjectFactoryClass

public java.lang.String getPhysicalObjectFactoryClass()
Use this method to get the PhysicalObjectFactoryClass.

setPhysicalConfigurationClass

public void setPhysicalConfigurationClass(java.lang.String physicalConfigurationClass)
Use this method to specify the PhysicalConfigurationClass.
Parameters:
physicalConfigurationClass - The name of the PhysicalConfiguration class

getPhysicalConfigurationClass

public java.lang.String getPhysicalConfigurationClass()
Use this method to get the PhysicalConfigurationClass.

setPhysicalAlgorithmClass

public void setPhysicalAlgorithmClass(java.lang.String physicalAlgorithmClass)
Use this method to specify the PhysicalAlgorithmClass.
Parameters:
physicalAlgorithmClass - The name of the PhysicalAlgorithm class

getPhysicalAlgorithmClass

public java.lang.String getPhysicalAlgorithmClass()
Use this method to get the PhysicalAlgorithmClass.

setPhysicalMeasurementClass

public void setPhysicalMeasurementClass(java.lang.String physicalMeasurementClass)
Use this method to specify the PhysicalMeasurementClass.
Parameters:
physicalMeasurementClass - The name of the PhysicalMeasurement class

getPhysicalMeasurementClass

public java.lang.String getPhysicalMeasurementClass()
Use this method to get the PhysicalMeasurementClass.

setFinalReportClass

public void setFinalReportClass(java.lang.String finalReportClass)
Use this method to define a class that performs a summary report of the simulation.
Parameters:
physicalSystemReportClass - The class implementing PhysicalSystemReport.

getFinalReportClass

public java.lang.String getFinalReportClass()
Use this method to get the class for the final report.

setDoFinalReport

public void setDoFinalReport(boolean doFinalReport)
Use this method to indicate a final report should be produced.

getDoFinalReport

public boolean getDoFinalReport()
Use this method to query whether to produce a final report or not.

doFinalReport

public boolean doFinalReport()
Alternative query to produce a final report or not.

setDataStore

public void setDataStore(java.lang.String dataStore)
Use this method to specify the DataStore.
Parameters:
dataStore - The name of the DataStore type to use.

getDataStore

public java.lang.String getDataStore()
Use this method to get the DateStore.

setDataStoreFile

public void setDataStoreFile(java.lang.String dataStoreFile)
Use this method to specify the DataStoreFile.
Parameters:
dataStoreFile - The name of the DataStore output file if the FileDataStore class is specified.

getDataStoreFile

public java.lang.String getDataStoreFile()
Use this method to get the DateStoreFile.

setPerformMeasurement

public void setPerformMeasurement(boolean performMeasurement)
Use this method to specify to PerformMeasurement on/off.
Parameters:
performMeasurement - true or false boolean value for on/off.

getPerformMeasurement

public boolean getPerformMeasurement()
Use this method to get the PerformMeasurement value.

setNumberMeasurements

public void setNumberMeasurements(int numberMeasurements)
Use this method to specify the number of Measurements to make if PerformMeasurement is set to true.
Parameters:
numberMeasurements - The number of measurements to take during the simulation.

getNumberMeasurements

public int getNumberMeasurements()
Use this method to get the number of measurements the simulation is to perform.

setNumberPhysicalObjects

public void setNumberPhysicalObjects(int numberPhysicalObjects)
Use this method to specify the number of physical objects to be created and used in the simulation.
Parameters:
numberPhysicalObjects - The number of physical objects to create.

getNumberPhysicalObjects

public int getNumberPhysicalObjects()
Use this method to get the number of PhyscialObjects to create.

setIterations

public void setIterations(int iterations)
Use this method to specify the number of iterations to perform.
Parameters:
iterations - The number of iterations to perform.

getIterations

public int getIterations()
Use this method to get the iterations the simulation will perform.

setInterval

public void setInterval(double interval)
Use this method to specify the timestep interval to be used to calculate the running time.
Parameters:
interval - The interval to be used in the simulation.

getInterval

public double getInterval()
Use this method to get the interval which is usually a timestep.

setStartTime

public void setStartTime(double startTime)
Use this method to specify the time at the start of the simulation. This is a convenience method if a simulation has not been completed and a new one is being run as a continuation of the previous simulation.
Parameters:
startTime - The time at the start of the simulation.

getStartTime

public double getStartTime()
Use this method to get the start time of the simulation.

setTime

public void setTime(double time)
Use this method to specify the time during any point during the simulation. It is usually updated during execution of the calculate of the user defined implementation of the PhysicalAlgorithm class.
Parameters:
time - The current time in the simulation.

getTime

public double getTime()
Use this method to get the current value of the time in the simulation.

updateTime

public void updateTime()
Use this method to update the time during any point during the simulation. It is usually updated during execution of the calculate of the user defined implementation of the PhysicalAlgorithm class. In this method the time is incremented by the interval. Use this method if you want the simulation to update itself. Use setTime(time) method if you want to do it manually or have any special logic for updating the time in your implementation.

setRunning

public void setRunning(boolean running)
Use this method to specify that the simulation is running and should continue to run. If you have a physical condition that when met should stop the execution of the simulation even if the current number of iterations has not met the defined in the properties file, then use this method and the Controller class will halt the execution and write any file data to the DataStore

This method is typically updated in the calculate method implementation of the PhysicalAlgorithm class.

Parameters:
running - Boolean that indicates the simulation is running and should continue to run. Set to true or false to indicate on or off.

getRunning

public boolean getRunning()
Use this method to get the boolean value for if the simulation is running.

isRunning

public boolean isRunning()
Method to test whether the simulation should still be running or not. The Controller class uses this method so you should not have to in your implementation of a simulation.

toString

public java.lang.String toString()
Get a string representation of the object.
Overrides:
toString in class java.lang.Object