Package gov.nasa.jpl.engine
Class ModelingEngine
java.lang.Object
gov.nasa.jpl.engine.ModelingEngine
- Direct Known Subclasses:
FunctionalWaitModelingEngine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter for current modeling timestatic ModelingEngineGets singleton modeling engine.protected voidabstract voidinsertActivityIntoEngine(Activity toInsert) Inserts an Activity into the engine to run.booleanReturns whether or not the engine is currently reading in a file.booleanReturns whether or not the engine is currently inside the modeling loop.voidmodel()The main method that REMODEL eventually calls.voidTEST ONLY METHOD for resetting engine if a previous test left it mid-modelprotected abstract voidRun the modeling engine after queueing up all Activity instances.voidsetCurrentlyReadingInFile(boolean currentlyReadingInFile) Only to be set by input readers, not adapters.protected static voidsetEngine(ModelingEngine engine) voidSetter for current modeling time.
-
Constructor Details
-
ModelingEngine
protected ModelingEngine()
-
-
Method Details
-
getEngine
Gets singleton modeling engine. In the future if there are multiple engines this may be removed.- Returns:
-
setEngine
-
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
-
getCurrentTime
Getter for current modeling time- Returns:
-
setTime
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
Inserts an Activity into the engine to run.- Parameters:
toInsert-
-