public class SimulationMonitor extends Thread
SimulationServiceListener
car elle ne doit pas écouter toutes les simulations, mais
seulement celle dit simple, c'est-à-dire "master plan" du plan
d'analyse.
Il faut bien faire attention lors du relancement des simulations a copier
le zip a un autre endroit. Il est important d'avoir deux zip car celui
de la sauvegarde est supprimé des que la simulation est arrete.Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected Timer |
checkScheduler
Check scheduler.
|
protected SortedSet<AbstractMap.SimpleEntry<Date,SimulationJob>> |
checkSet
Map to remember when a simulation have to be checked.
|
protected static SimulationMonitor |
instance
Instance.
|
protected File |
monitorFolder
Simulation information saving file.
|
protected static String |
PROPERTIES_FILE |
protected static String |
PROPERTY_DATE |
protected static String |
PROPERTY_LASTSIMULATION |
protected static String |
PROPERTY_LAUNCHER |
protected static String |
PROPERTY_STANDALONE |
protected static String |
PROPERTY_ZIP |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Modifier | Constructor and Description |
---|---|
protected |
SimulationMonitor()
Constructeur.
|
Modifier and Type | Method and Description |
---|---|
protected void |
analyzeSensitivityResult(SimulationJob job,
SimulationStorage simulation)
For each finished simulation, check that all sensitivity
simulation are available (in case of sensitivity simulation only).
|
protected boolean |
checkProgression(SimulationJob job,
SimulatorLauncher launcher)
Check progression.
|
protected void |
doPostSimulationOperation(SimulationJob job,
SimulatorLauncher launcher)
Operation to do after simulation end.
|
static SimulationMonitor |
getInstance()
Instance getter.
|
protected int |
getNumberOfFinishedSimulation(String asPrefixName,
int numberOfSimulation)
Parcourt le dossier de toutes les simulation commencant par le prefix donné,
et retourne le nombre de simulation terminées.
|
protected List<SimulationStorage> |
getStorageListForSecondPass(String asPrefixName,
int numberOfSimulation)
Parcourt les dossiers et instancie les storages une fois
qu'on est sur qu'on a toutes les simulations.
|
void |
reloadConfig(SimulationService service)
Reload config and read non simulation job into simulation service.
|
protected void |
restartSimulation(SimulationService service,
File simulationFolder,
String simulationId,
Properties propertiesFile)
Restart a single simulation.
|
protected void |
restartSimulationProgression(SimulationService service)
Take all simulation in loaded file.
|
void |
run() |
void |
simulationStart(SimulationJob job)
Save simulation informations for started simulations.
|
void |
simulationStop(SimulationJob job)
Mark a simulation as stopped.
|
protected void |
waitAndCheckProgression()
Wait a little time, and check for first
simulation progression, if first simulation time
is reached.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected static final String PROPERTIES_FILE
protected static final String PROPERTY_LAUNCHER
protected static final String PROPERTY_DATE
protected static final String PROPERTY_ZIP
protected static final String PROPERTY_STANDALONE
protected static final String PROPERTY_LASTSIMULATION
protected static SimulationMonitor instance
protected File monitorFolder
protected SortedSet<AbstractMap.SimpleEntry<Date,SimulationJob>> checkSet
protected Timer checkScheduler
public static SimulationMonitor getInstance()
public void reloadConfig(SimulationService service)
service
- SimulationServiceprotected void restartSimulationProgression(SimulationService service)
protected void restartSimulation(SimulationService service, File simulationFolder, String simulationId, Properties propertiesFile) throws IOException
service
- simulation servicesimulationFolder
- simulation information foldersimulationId
- simulation idpropertiesFile
- simulation properties fileIOException
public void simulationStart(SimulationJob job)
job
- started jobpublic void simulationStop(SimulationJob job)
job
- job that control the simulationprotected void waitAndCheckProgression()
protected boolean checkProgression(SimulationJob job, SimulatorLauncher launcher)
job
- job to check progressionlauncher
- SimulatorLauncher that manage simulationtrue
is simulation is finished, false
otherwiseprotected void doPostSimulationOperation(SimulationJob job, SimulatorLauncher launcher)
job
- joblauncher
- SimulatorLauncher
that manage simulationprotected void analyzeSensitivityResult(SimulationJob job, SimulationStorage simulation)
job
- jobsimulation
- simulationprotected int getNumberOfFinishedSimulation(String asPrefixName, int numberOfSimulation)
asPrefixName
- simulation name (without number suffix)numberOfSimulation
- total simulation numberprotected List<SimulationStorage> getStorageListForSecondPass(String asPrefixName, int numberOfSimulation)
asPrefixName
- simulation name (without number suffix)numberOfSimulation
- total simulation numberCopyright © 1999–2020 CodeLutin. All rights reserved.