org.optimizationservices.oscommon.localinterface
Class OSSimulation

java.lang.Object
  extended by org.optimizationservices.oscommon.localinterface.OSSimulation

public class OSSimulation
extends java.lang.Object

The OSSimulation class is a local interface for storing Optimization Services simulation. Its design follows the Optimization Services simulation Language (OSsL). All the data structures in this class are standards specified in OSsL.

Since:
OS 1.0
Version:
1.0, 03/14/2005
Author:
Robert Fourer, Jun Ma, Kipp Martin

Field Summary
 SimulationInput input
          input holds the simulation input.
 SimulationOutput output
          output holds the simulation output.
 
Constructor Summary
OSSimulation()
          Default constructor.
 
Method Summary
 SimulationElement[] getSimulationInputElements()
          get simulation input elements.
 SimulationElement[] getSimulationOutputElements()
          get simulation output elements.
static void main(java.lang.String[] args)
          main for test purposes.
 OSSimulation readOSsL(java.lang.String ossl, boolean isFile, boolean validate)
          read an OSsL instance and return and OSSimulation object.
 boolean setSimulationInputElements(SimulationElement[] simulationInputElements)
          set simulation input elements.
 boolean setSimulationOutputElements(SimulationElement[] simulationOutputElements)
          set simulation output elements.
 java.lang.String writeOSsL()
          write the OSSimulation to an ossl xml string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

input

public SimulationInput input
input holds the simulation input.


output

public SimulationOutput output
output holds the simulation output.

Constructor Detail

OSSimulation

public OSSimulation()
Default constructor.

Method Detail

readOSsL

public OSSimulation readOSsL(java.lang.String ossl,
                             boolean isFile,
                             boolean validate)
                      throws java.lang.Exception
read an OSsL instance and return and OSSimulation object.

Parameters:
ossl - holds the optimization simulation in a string which format follows the Optimization Services simulation Language (OSsL) schema.
isFile - holds whether the ossl string is a file name or a string that literally holds the ossl contents.
validate - holds whether the reader should be validating against the schema or not.
Returns:
the OSSimulation object constructed from the OSsL String.
Throws:
java.lang.Exception - if there are errors in reading the string or setting the OSSimulation.

writeOSsL

public java.lang.String writeOSsL()
                           throws java.lang.Exception
write the OSSimulation to an ossl xml string.

Returns:
the ossl xml string.
Throws:
java.lang.Exception - if there are errors in writing the ossl string.

getSimulationInputElements

public SimulationElement[] getSimulationInputElements()
get simulation input elements.

Returns:
an array of simulation input elements, null if none. Each member of array is a simulation element.
See Also:
SimulationElement

setSimulationInputElements

public boolean setSimulationInputElements(SimulationElement[] simulationInputElements)
set simulation input elements.

Parameters:
simulationInputElements - holds an array of simulation input elements. Each member of array is a simulation element.
Returns:
whether the simulation input elements are set successfully or not.
See Also:
SimulationElement

getSimulationOutputElements

public SimulationElement[] getSimulationOutputElements()
get simulation output elements.

Returns:
an array of simulation output elements, null if none. Each member of array is a simulation element.
See Also:
SimulationElement

setSimulationOutputElements

public boolean setSimulationOutputElements(SimulationElement[] simulationOutputElements)
set simulation output elements.

Parameters:
simulationOutputElements - holds an array of simulation output elements. Each member of array is a simulation element.
Returns:
whether the simulation output elements are set successfully or not.
See Also:
SimulationElement

main

public static void main(java.lang.String[] args)
main for test purposes.

Parameters:
argv - command line arguments.