Class ModelingEngine

java.lang.Object
gov.nasa.jpl.engine.ModelingEngine
Direct Known Subclasses:
FunctionalWaitModelingEngine

public abstract class ModelingEngine extends Object
  • Constructor Details

    • ModelingEngine

      protected ModelingEngine()
  • Method Details

    • getEngine

      public static ModelingEngine getEngine()
      Gets singleton modeling engine. In the future if there are multiple engines this may be removed.
      Returns:
    • setEngine

      protected static void setEngine(ModelingEngine engine)
    • model

      public void model()
      The main method that REMODEL eventually calls. This loops through all activity instances registered to the engine and invokes in time-order their ActivityThread s, which calls the model() method defined in each activity.
    • initTime

      protected void initTime(Time currentModelingTime)
    • getCurrentTime

      public Time getCurrentTime()
      Getter for current modeling time
      Returns:
    • setTime

      public void setTime(Time t)
      Setter for current modeling time. Should only be used by engine internally and publicly for testing.
      Parameters:
      t -
    • isModeling

      public boolean isModeling()
      Returns whether or not the engine is currently inside the modeling loop. Inserting activities behaves differently if this is true or not, so this check is useful for that.
      Returns:
    • resetEngine

      public void resetEngine()
      TEST ONLY METHOD for resetting engine if a previous test left it mid-model
    • isCurrentlyReadingInFile

      public boolean isCurrentlyReadingInFile()
      Returns whether or not the engine is currently reading in a file. Activity decomposition behaves differently if the instances come from TOLs or not, so this is needed.
      Returns:
    • setCurrentlyReadingInFile

      public void setCurrentlyReadingInFile(boolean currentlyReadingInFile)
      Only to be set by input readers, not adapters. Changes how activity decomposition occurs.
      Parameters:
      currentlyReadingInFile -
    • runModeling

      protected abstract void runModeling()
      Run the modeling engine after queueing up all Activity instances.
    • insertActivityIntoEngine

      public abstract void insertActivityIntoEngine(Activity toInsert)
      Inserts an Activity into the engine to run.
      Parameters:
      toInsert -