Class AbstractSimulation

All Implemented Interfaces:
hec.clientapp.client.WkspCallBack, hec.clientapp.event.ManagerChangedListener, ManagerProxyListContainer, Simulation, AsciiSerializable, FieldAccessor, LockableObject, MessagePrinter, TsRecordContainer, Serializable, Cloneable, Comparable, EventListener, Observer, mil.army.usace.hec.rmi.csinterface.CallBackInterface, rma.lang.Modifiable
Direct Known Subclasses:
SimulationPeriod

public abstract class AbstractSimulation extends ManagerProxyListManager implements AsciiSerializable, Simulation
See Also:
  • Field Details

    • _startTimeString

      protected String _startTimeString
    • _endTimeString

      protected String _endTimeString
    • _startDate

      protected String _startDate
    • _endDate

      protected String _endDate
    • _lookbackDate

      protected String _lookbackDate
    • _lookbackTime

      protected String _lookbackTime
    • _timeStep

      protected int _timeStep
    • _timeIncrement

      protected int _timeIncrement
    • _altComputeTimes

      protected Vector<String> _altComputeTimes
    • _altFailedComputeTimes

      protected Vector<String> _altFailedComputeTimes
    • _altCanceledComputeTimes

      protected Vector<String> _altCanceledComputeTimes
    • _computeAll

      protected transient boolean _computeAll
    • _progressDisplay

      protected transient mil.army.usace.hec.rmi.client.RMIProgressDisplay _progressDisplay
  • Constructor Details

    • AbstractSimulation

      public AbstractSimulation()
    • AbstractSimulation

      public AbstractSimulation(String name)
  • Method Details

    • getOutputDSSFileName

      public abstract String getOutputDSSFileName()
    • getOutputDSSFilePath

      public abstract String getOutputDSSFilePath()
      return the full path to the output DSS file
      Returns:
    • getStartDateString

      public String getStartDateString()
      Description copied from interface: Simulation
      Gets the StartDateString attribute of the Simulation object
      Specified by:
      getStartDateString in interface Simulation
      Returns:
      The StartDateString value
    • setStartDate

      public void setStartDate(String date)
      Description copied from interface: Simulation
      Sets the StartDate attribute of the Simulation object
      Specified by:
      setStartDate in interface Simulation
      Parameters:
      date - The new StartDate value
    • getEndDateString

      public String getEndDateString()
      Description copied from interface: Simulation
      Gets the EndDateString attribute of the Simulation object
      Specified by:
      getEndDateString in interface Simulation
      Returns:
      The EndDateString value
    • setEndDate

      public void setEndDate(String date)
      Description copied from interface: Simulation
      Sets the EndDate attribute of the Simulation object
      Specified by:
      setEndDate in interface Simulation
      Parameters:
      date - The new EndDate value
    • setAlternativesModified

      protected void setAlternativesModified()
    • getLookbackDateString

      public String getLookbackDateString()
      Description copied from interface: Simulation
      Gets the LookbackDateString attribute of the Simulation object
      Specified by:
      getLookbackDateString in interface Simulation
      Returns:
      The LookbackDateString value
    • setLookbackDate

      public void setLookbackDate(String date)
      Description copied from interface: Simulation
      Sets the LookbackDate attribute of the Simulation object
      Specified by:
      setLookbackDate in interface Simulation
      Parameters:
      date - The new LookbackDate value
    • setTimestep

      public void setTimestep(int ts)
      This sets the time step in hours
    • getTimeIncrementType

      public int getTimeIncrementType()
    • isModified

      public boolean isModified()
      Description copied from class: NamedType
      Check if the object has been modified.
      Specified by:
      isModified in interface ManagerProxyListContainer
      Specified by:
      isModified in interface rma.lang.Modifiable
      Overrides:
      isModified in class NamedType
      Returns:
      true if the object has been modified
    • loadWorkspace

      public abstract void loadWorkspace(String remoteRegistry, String baseDir)
    • getAlternatives

      public abstract String[] getAlternatives()
    • isLoaded

      public boolean isLoaded()
    • setTimeStep

      public void setTimeStep(int timeStep, int increment)
      Sets the time step and increment type it is. The increment is defined as HOURS, MINUTES, DAYS, as defined by HecTime
      See Also:
    • getTimestep

      public int getTimestep()
    • getTimeStepString

      public String getTimeStepString()
      get the TimeStep String. i.e. 1HOUR, 1DAY, 30MINUTE
      Returns:
      the TimeStep String
    • getRunTimeWindow

      public RunTimeWindow getRunTimeWindow()
    • getTimeWindowString

      public String getTimeWindowString()
      Description copied from interface: Simulation
      Gets the TimeWindowString attribute of the Simulation object
      Specified by:
      getTimeWindowString in interface Simulation
      Returns:
      The TimeWindowString value
    • getTimeWindow

      public boolean getTimeWindow(HecTime start, HecTime end)
      Description copied from interface: Simulation
      Gets the TimeWindow attribute of the Simulation object
      Specified by:
      getTimeWindow in interface Simulation
      Parameters:
      start - Description of Parameter
      end - Description of Parameter
      Returns:
      The TimeWindow value
    • setComputeDisplay

      public void setComputeDisplay(mil.army.usace.hec.rmi.client.RMIProgressDisplay dlg)
    • setComputeAll

      public void setComputeAll(boolean b)
    • getComputeAll

      public boolean getComputeAll()
    • setAltFailedComputeTime

      protected void setAltFailedComputeTime(String altname, String model, long cTime)
      set the alternative's failed compute time
    • setAltCanceledComputeTime

      protected void setAltCanceledComputeTime(String altname, String model, long cTime)
      set the alternative's canceled compute time
    • setAltComputeTime

      protected void setAltComputeTime(String altname, String model, long cTime)
      set the alternative compute time
    • getAltCanceledComputeIndex

      protected int getAltCanceledComputeIndex(String altname, String model)
      given the alternative name and model get its last canceled compute time
    • getAltFailedComputeIndex

      protected int getAltFailedComputeIndex(String altname, String model)
      given the alternative name and model get its last failed compute time
    • getAltComputeIndex

      protected int getAltComputeIndex(String altname, String model)
      given the alternative name and model get its last successful computed time
    • getAltFailedComputeTime

      public long getAltFailedComputeTime(String altname, String model)
      get the alternative's last failed compute time. return 0 if the alternative doesn't have a last compute failed time.
    • getAltCanceledComputeTime

      public long getAltCanceledComputeTime(String altname, String model)
      get the alternative's last canceled compute time. return 0 if the alternative doesn't have a last compute failed time.
    • getAltComputeTime

      public long getAltComputeTime(String altname, String model)
      get the alternative's last compute time. return 0 if the alternative doesn't have a last compute time.
    • writeFile

      public boolean writeFile(Identifier id)
      Saves the Run data to the specified ASCII file. If no path name is given, the method uses the current pathname of the Run.

      The file is written using type=param formatting. See the readData method for definition of types and parameters.

      Overrides:
      writeFile in class Manager
      Parameters:
      id - absolute pathname of the ASCII file to be written. A null pathname indicates that the current path of the Run should be used.
    • readFile

      public boolean readFile(Identifier id)
      Overrides:
      readFile in class Manager
    • computeModel

      protected int computeModel(ComputeInfo ci, String wkspName)
      compute a standard model, currently mfp, rss, fia.
    • getUserDisplayUrl

      protected String getUserDisplayUrl()
    • getSimulationRuns

      public Vector getSimulationRuns()
    • removeTrial

      public boolean removeTrial(AltItem altItem, TrialReference trialRef2Remove)
      Specified by:
      removeTrial in interface Simulation
    • setTaskNumber

      public void setTaskNumber(int i)
    • getSimulationPath

      public abstract String getSimulationPath()
    • getFieldObject

      public Object getFieldObject(Field fld)
      Description copied from interface: FieldAccessor
      This method allows access to java.lang.reflect.Field objects within the implementing class.
      Specified by:
      getFieldObject in interface FieldAccessor
      Overrides:
      getFieldObject in class Manager
      Parameters:
      fld - The field to get.
      Returns:
      The data object that is stored in the given field
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Description copied from interface: FieldAccessor
      This allows access to fields withing the implementing object to set there data.
      Specified by:
      setFieldObject in interface FieldAccessor
      Overrides:
      setFieldObject in class Manager
      Parameters:
      fld - The java field object representing the member field to be set
      fobj - The data to set in that field
      Returns:
      returns true if successful