Class SimulationRun

All Implemented Interfaces:
hec.event.ModifiableListener, AsciiSerializable, FieldAccessor, LockableObject, hec.map.MapObjectInterface, MessagePrinter, ModelConstants, TsRecordContainer, Serializable, Cloneable, Comparable, EventListener, Observer, mil.army.usace.hec.rmi.csinterface.CallBackInterface, rma.lang.Modifiable
Direct Known Subclasses:
RssSimRun, SimulationTrialRun

public abstract class SimulationRun extends Manager implements AsciiSerializable, hec.map.MapObjectInterface, hec.event.ModifiableListener, ModelConstants
See Also:
  • Field Details

    • NO_SELECTION

      public static final String NO_SELECTION
      See Also:
    • FILE_EXT

      public static final String FILE_EXT
      See Also:
    • _baseRunName

      protected transient String _baseRunName
    • _altList

      protected Vector<AltItem> _altList
      this is the list of program (model) alternatives that this ForecastRun has. The order in the list is the order that the program alts are executed, so don't mess with the order.
    • _trialList

      protected Vector _trialList
    • _trials

      protected transient Vector _trials
    • _modelForecastAltMgrs

      protected transient Hashtable _modelForecastAltMgrs
  • Constructor Details

    • SimulationRun

      public SimulationRun()
      Constructor for the SimulationRun object
  • Method Details

    • init

      public void init()
      Specified by:
      init in class Manager
    • toString

      public String toString()
      Overrides:
      toString in class Manager
    • getAlternativeNameLength

      public int getAlternativeNameLength()
    • getModelNameLength

      public int getModelNameLength()
    • getModelAltWorkspaceName

      public abstract String getModelAltWorkspaceName()
      Gets the ModelAltWorkspaceName attribute of the SimulationRun object. This represents the model directory that will be used to store the simulation run.
      Returns:
      The ModelAltWorkspaceName value
    • getModelAltClassName

      public String getModelAltClassName()
      Gets the name of the class used to group model alternatives. Must be overridden by base classes to remove the default model alt class name. The default class name is hec.watershed.model.ModelAlt.
    • getRasModelForecastAlt

      public ModelForecastAlt getRasModelForecastAlt()
    • getRasModelReference

      protected ModelReference getRasModelReference()
    • getTrialRunClassName

      public abstract String getTrialRunClassName()
      Gets the TrialRunClassName attribute of the SimulationRun object
      Returns:
      returns the class name used to construct or identify the class to be used for trial runs. Allows different simulations to specify different trial classes. The class must subclass the object hec.clientapp.model.SimulationRun
      See Also:
    • setSimulation

      public void setSimulation(Simulation sim)
    • getSimulation

      public Simulation getSimulation()
    • acceptTrial

      public boolean acceptTrial(AltItem altItem, int pos, String newTrialKey, boolean propagate)
    • setName

      public void setName(String forecastName)
      Description copied from class: NamedType
      Set the NamedTypes's name to the argument String.
      Overrides:
      setName in class NamedType
    • setDescription

      public void setDescription(String forecastDescription)
      Description copied from class: NamedType
      Set the NamedType's description to the argument String.
      Overrides:
      setDescription in class NamedType
    • setConfigurationId

      public void setConfigurationId(long configId)
    • getConfigurationId

      public long getConfigurationId()
    • getTrials

      public Vector getTrials()
      return the list of TrialRuns
    • setComputeInundation

      public void setComputeInundation(boolean compute)
    • getComputeInundation

      public boolean getComputeInundation()
    • getAltItems

      public Vector<AltItem> getAltItems(String programName)
      return the list of AltItems that represent all alternatives for the given program.
    • getModel

      public String getModel(String programName)
    • getModelAlt

      public ModelAlt getModelAlt(String programName)
      returns the first model in the execution sequence for the programName
    • usesModeltAlt

      public boolean usesModeltAlt(ModelAlt malt)
    • hasModelAlt

      public boolean hasModelAlt(String program, int index)
      see if this SimulationRun contains a ModelAlt for Program program with manager index index
      Returns:
      true if this SimulationRun contains the ModelAlt
    • getIdForModelAlt

      public String getIdForModelAlt(ModelAlt alt)
      return the ID for the ModelAlt alt
    • getModelAlt

      public ModelAlt getModelAlt(AltItem altItem)
    • writeFile

      public boolean writeFile(Identifier id)
      Overrides:
      writeFile in class Manager
    • reLoadFile

      public boolean reLoadFile(Identifier id)
      Called when the file gets modified so the manager always has the most current data
      Overrides:
      reLoadFile in class Manager
    • readFile

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

      public String getRunKey(AltItem altItem)
      get the key (Q1) for the AltItem
      Parameters:
      altItem -
      Returns:
      the key or null
    • getModelNames

      public Vector<String> getModelNames(String modelName)
      return the list of keys (Q1B0R1) for the specified model (rss)
    • loadManager

      protected Manager loadManager(String model, String cls, String name)
    • setUserName

      public void setUserName(String name)
    • getUserName

      public String getUserName()
    • getBaseRunName

      public String getBaseRunName()
    • setAltList

      public void setAltList(Vector v)
    • getAltList

      public Vector<AltItem> getAltList()
    • getModelCount

      public int getModelCount()
    • setActiveRun

      public void setActiveRun(boolean b)
    • isActiveRun

      public boolean isActiveRun()
    • setSelected

      public void setSelected(boolean b)
    • isSelected

      public boolean isSelected()
    • getFileExtension

      public String getFileExtension()
    • addTrial

      public void addTrial(int mgrIndex, int modelPos, String trialKey)
    • removeTrial

      public boolean removeTrial(SimulationTrialRun trial2Remove)
      remove the trial from this SimulationRun
    • getTrialKeys

      public Vector getTrialKeys(int modelPos)
    • areManagersModified

      public boolean areManagersModified()
      check to see if any of the managers used by this system is modified.
    • saveManagers

      public void saveManagers()
    • setModelsLocked

      public boolean setModelsLocked(int lockType) throws LockFailedException
      Throws:
      LockFailedException
    • getKey

      public String getKey()
    • unloading

      public void unloading()
      Description copied from class: Manager
      called when the manager proxy is unloading the manager
      Overrides:
      unloading in class Manager
    • unload

      public void unload()
      satisfy the MapObjectInterface
      Specified by:
      unload in interface hec.map.MapObjectInterface
    • getExtent

      public hec.map.WorldRect getExtent()
      satisfy the MapObjectInterface
      Specified by:
      getExtent in interface hec.map.MapObjectInterface
      Returns:
      The Extent value
    • setExtent

      public void setExtent(hec.map.WorldRect rect)
      satisfy the MapObjectInterface
      Specified by:
      setExtent in interface hec.map.MapObjectInterface
      Parameters:
      rect - The new Extent value
    • getMapIdentifier

      public hec.map.MapIdentifier getMapIdentifier()
      satisfy the MapObjectInterface
      Specified by:
      getMapIdentifier in interface hec.map.MapObjectInterface
      Returns:
      The MapIdentifier value
    • setMapIdentifier

      public void setMapIdentifier(hec.map.MapIdentifier mapId)
      satisfy the MapObjectInterface
      Specified by:
      setMapIdentifier in interface hec.map.MapObjectInterface
      Parameters:
      mapId - The new MapIdentifier value
    • load

      public void load()
      satisfy the MapObjectInterface
      Specified by:
      load in interface hec.map.MapObjectInterface
    • getProgramOrder

      public Vector getProgramOrder()
    • 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
    • modifiedStateChanged

      public void modifiedStateChanged(rma.lang.Modifiable mgr, boolean modified)
      Specified by:
      modifiedStateChanged in interface hec.event.ModifiableListener
    • notifyModifiableListeners

      protected void notifyModifiableListeners(ModelAlt alt, boolean modified)
    • setExpanded

      public void setExpanded(boolean expanded)
    • isExpanded

      public boolean isExpanded()
    • getCoordinateReferenceSystem

      public hec.map.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
      Description copied from interface: hec.map.MapObjectInterface
      Returns the coordinate reference system that describes the location of this map. Users can return NULL if they don't have CoordinateReferenceSystem.
      Specified by:
      getCoordinateReferenceSystem in interface hec.map.MapObjectInterface
      Returns:
    • setDefaultModelAltClassName

      public static void setDefaultModelAltClassName(String classname)
    • setModified

      public void setModified(boolean modified)
      Description copied from class: NamedType
      Set the modified flag to true or false.
      Specified by:
      setModified in interface rma.lang.Modifiable
      Overrides:
      setModified in class Manager