Package fr.ifremer.isisfish.simulator
Class SimulationContext
java.lang.Object
fr.ifremer.isisfish.simulator.SimulationContext
Keep all information on one simulation.
- Launch parameter
- Database (TopiaContext)
- SimulationControl
- Effective by pop (N)
- Result
- Version:
- $Revision$ Last update: $Date$ by : $Author$
- Author:
- poussin
-
Field Summary
Modifier and TypeFieldDescriptionprotected IsisCache
cache used by aspect for this simulationprotected ClassLoader
protected ComputeResultTrace
l'objet trace qui conserve les donnees statistiques des appels de methodesprotected org.nuiton.config.ApplicationConfig
configuration for current simulation (some value of config is overwrited for simulation)Context value used in equation.protected org.nuiton.topia.TopiaContext
TopiaContext must be used by rule action to modify dataprotected org.nuiton.topia.TopiaContext
TopiaContext must be used to save resultprotected Map<String,
ClassLoader> protected MetierMonitor
protected PopulationMonitor
protected ResultManager
protected RuleMonitor
protected File
protected SimulationStorage
protected SimulationControl
protected Set<SimulationListener>
protected PropertyChangeListener
protected org.nuiton.profiling.Statistic
protected org.nuiton.profiling.Trace
l'objet trace qui conserve les donnees statistiques des appels de methodesprotected Map<org.nuiton.topia.persistence.TopiaEntity,
SimulationVariable> CacheAspect des variables d'entités. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add simulation listener, if listener isSimulationResultListener
, it's automatically added as listener onResultManager
void
clearCache
(TimeStep step) Deprecated.ne sert plus a rien, le cache est directement listener de la simulationvoid
closeDB()
void
Deprecated.a supprimer lorsqu'on aura supprimer ResultDatabaseStoragevoid
Deprecated.ne sert plus a rien lorsque ResultDatabaseStorage sera supprimevoid
void
void
fireStepChange
(TimeStep step) static SimulationContext
get()
Return SimulationContext if not created, create new context without initialisation needed for simulationget
(org.nuiton.topia.persistence.TopiaEntity entity) Get object containing variable for given entity.GetActiveRuleDAO
on region database.getCache()
GetCellDAO
on region database.org.nuiton.config.ApplicationConfig
Get specifique ApplicationConfig for current thread.simulation.org.nuiton.topia.TopiaContext
getDB()
This method return TopiaContext that Rule action must used to modify data.org.nuiton.topia.TopiaContext
Deprecated.ne sert plus a rien lorsque ResultDatabaseStorage sera supprimeGetEffortDescriptionDAO
on region database.GetEquationDAO
on region database.GetFisheryRegionDAO
on region database.GetGearDAO
on region database.GetMetierDAO
on region database.GetMetierSeasonInfoDAO
on region database.GetObservationDAO
on region database.GetPopulationDAO
on region database.GetPopulationGroupDAO
on region database.GetPopulationSeasonInfoDAO
on region database.GetPortDAO
on region database.GetResultDAO
on region database.GetSeasonDAO
on region database.GetSelectivityDAO
on region database.GetSetOfVesselsDAO
on region database.GetSpeciesDAO
on region database.GetStrategyDAO
on region database.GetStrategyMonthInfoDAO
on region database.GetTargetSpeciesDAO
on region database.org.nuiton.profiling.Statistic
org.nuiton.profiling.Trace
getTrace()
GetTripTypeDAO
on region database.Permet de recuperer une valeur prealablement stocker avec un setValuedouble
getValueAndCompute
(String key, double defaultValue) Return value from context.GetVariableDAO
on region database.GetVesselTypeDAO
on region database.GetZoneDAO
on region database.void
init SimulationContext for simulation.void
static void
remove()
remove simulation associate with current threadvoid
Remove simulation listener, if listener isSimulationResultListener
, it's Automatically removed as listener onResultManager
void
Rollback region database transaction.void
setClassLoader
(ClassLoader classLoader) void
setComputeValue
(String key, Double value) Add value/key pair into context (computed value).void
setScriptDirectory
(File scriptDirectory) Script directory to use.void
setSimulationControl
(SimulationControl simulationControl) void
setSimulationStorage
(SimulationStorage simulation) void
Permet de stocker une valeur en fonction d'une cle, cela peut-etre util pour partager des informations entre Rule ou d'autre objet.void
Valide (commit) database modification
-
Field Details
-
config
protected org.nuiton.config.ApplicationConfig configconfiguration for current simulation (some value of config is overwrited for simulation) -
values
-
simulation
-
simulationControl
-
populationMonitor
-
metierMonitor
-
ruleMonitor
-
resultManager
-
simulationListeners
-
stepListener
-
timeStepStat
protected org.nuiton.profiling.Statistic timeStepStat -
classLoader
-
equationClassLoaders
-
scriptDirectory
-
trace
protected org.nuiton.profiling.Trace tracel'objet trace qui conserve les donnees statistiques des appels de methodes -
computeResultTrace
l'objet trace qui conserve les donnees statistiques des appels de methodes -
cache
cache used by aspect for this simulation -
db
protected org.nuiton.topia.TopiaContext dbTopiaContext must be used by rule action to modify data -
dbResult
protected org.nuiton.topia.TopiaContext dbResultTopiaContext must be used to save result -
variablesCache
CacheAspect des variables d'entités. Topia id > map of attributes. -
contextEquationValue
Context value used in equation.
-
-
Constructor Details
-
SimulationContext
protected SimulationContext()
-
-
Method Details
-
initForSimulation
public void initForSimulation()init SimulationContext for simulation. -
get
Return SimulationContext if not created, create new context without initialisation needed for simulation- Returns:
- simulation context for the current simulation (current thread)
-
remove
public static void remove()remove simulation associate with current thread -
getConfig
public org.nuiton.config.ApplicationConfig getConfig()Get specifique ApplicationConfig for current thread.simulation. Needed for simulation some configurations values are overwrited by simulation parameter tag/value- Returns:
-
addSimulationListener
Add simulation listener, if listener isSimulationResultListener
, it's automatically added as listener onResultManager
- Parameters:
l
-
-
closeDB
public void closeDB() -
closeDBResult
Deprecated.a supprimer lorsqu'on aura supprimer ResultDatabaseStorage -
removeSimulationListener
Remove simulation listener, if listener isSimulationResultListener
, it's Automatically removed as listener onResultManager
- Parameters:
l
-
-
fireBeforeSimulation
public void fireBeforeSimulation() -
fireStepChange
-
fireAfterSimulation
public void fireAfterSimulation() -
getClassLoader
- Returns:
- Returns the classLoader.
-
getEquationClassLoaders
-
setClassLoader
- Parameters:
classLoader
- The classLoader to set.
-
getTrace
public org.nuiton.profiling.Trace getTrace() -
getComputeResultTrace
-
getCache
-
getValue
Permet de recuperer une valeur prealablement stocker avec un setValue- Parameters:
name
- le nom de la valeur souhaitée- Returns:
- la valeur ou null si aucune valeur ne porte se nom
-
setValue
Permet de stocker une valeur en fonction d'une cle, cela peut-etre util pour partager des informations entre Rule ou d'autre objet.- Parameters:
name
- le nom de la valeurvalue
- la valeur
-
getSimulationStorage
- Returns:
- Returns the topiaContext.
-
setSimulationStorage
- Parameters:
simulation
- The simulation storage to set.
-
getTimeStepStat
public org.nuiton.profiling.Statistic getTimeStepStat() -
getSimulationControl
- Returns:
- Returns the simulationControl.
-
setSimulationControl
- Parameters:
simulationControl
- The simulationControl to set.
-
getPopulationMonitor
- Returns:
- Returns the populationMonitor.
-
getMetierMonitor
- Returns:
- Returns the metierMonitor.
-
getRuleMonitor
- Returns:
- Returns the ruleMonitor.
-
getResultManager
- Returns:
- Returns the resultManager.
-
getDB
public org.nuiton.topia.TopiaContext getDB() throws org.nuiton.topia.TopiaExceptionThis method return TopiaContext that Rule action must used to modify data. This TopiaContext is rollbacked after each step.- Returns:
- TopiaContext that Rule action must used
- Throws:
org.nuiton.topia.TopiaException
-
getDbResult
@Deprecated public org.nuiton.topia.TopiaContext getDbResult() throws org.nuiton.topia.TopiaExceptionDeprecated.ne sert plus a rien lorsque ResultDatabaseStorage sera supprimethis method return TopiaContext that must be used to save result- Returns:
- Returns the dbResult.
- Throws:
org.nuiton.topia.TopiaException
-
clearCache
Deprecated.ne sert plus a rien, le cache est directement listener de la simulationClear isis fish cache for specified time step.- Parameters:
step
- time step to remove data- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.1.1.0
-
getScriptDirectory
- Returns:
- Returns the scriptDirectory.
-
setScriptDirectory
Script directory to use. Used to change isis-database-3 directory in running simulation context.- Parameters:
scriptDirectory
-
-
message
- Parameters:
message
- message
-
setComputeValue
Add value/key pair into context (computed value).- Parameters:
key
- keyvalue
- value
-
getValueAndCompute
Return value from context.- Parameters:
key
- keydefaultValue
- default value or value to compute- Returns:
- computed value or
defaultValue
if not found
-
get
Get object containing variable for given entity.- Parameters:
entity
- entity- Returns:
- map object for this class
- Since:
- 4.1.0.0
-
rollbackRuleChanges
public void rollbackRuleChanges() throws org.nuiton.topia.TopiaExceptionRollback region database transaction.- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
validateDBChanges
public void validateDBChanges() throws org.nuiton.topia.TopiaExceptionValide (commit) database modification- Throws:
org.nuiton.topia.TopiaException
-
commitResults
Deprecated.ne sert plus a rien lorsque ResultDatabaseStorage sera supprimeCommit result storage transaction.- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getActiveRuleDAO
GetActiveRuleDAO
on region database.- Returns:
- ActiveRuleDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getCellDAO
GetCellDAO
on region database.- Returns:
- CellDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getEffortDescriptionDAO
GetEffortDescriptionDAO
on region database.- Returns:
- EffortDescriptionDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getEquationDAO
GetEquationDAO
on region database.- Returns:
- EquationDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getFisheryRegionDAO
GetFisheryRegionDAO
on region database.- Returns:
- FisheryRegionDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getGearDAO
GetGearDAO
on region database.- Returns:
- GearDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getMetierDAO
GetMetierDAO
on region database.- Returns:
- MetierDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getMetierSeasonInfoDAO
GetMetierSeasonInfoDAO
on region database.- Returns:
- MetierSeasonInfoDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getObservationDAO
GetObservationDAO
on region database.- Returns:
- ObservationDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getPopulationDAO
GetPopulationDAO
on region database.- Returns:
- PopulationDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getPopulationGroupDAO
GetPopulationGroupDAO
on region database.- Returns:
- PopulationGroupDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getPopulationSeasonInfoDAO
GetPopulationSeasonInfoDAO
on region database.- Returns:
- PopulationSeasonInfoDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getPortDAO
GetPortDAO
on region database.- Returns:
- PortDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getResultDAO
GetResultDAO
on region database.- Returns:
- ResultDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getSeasonDAO
GetSeasonDAO
on region database.- Returns:
- SeasonDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getSelectivityDAO
GetSelectivityDAO
on region database.- Returns:
- SelectivityDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getSetOfVesselsDAO
GetSetOfVesselsDAO
on region database.- Returns:
- SetOfVesselsDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getSpeciesDAO
GetSpeciesDAO
on region database.- Returns:
- SpeciesDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getStrategyDAO
GetStrategyDAO
on region database.- Returns:
- StrategyDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getStrategyMonthInfoDAO
GetStrategyMonthInfoDAO
on region database.- Returns:
- StrategyMonthInfoDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getTargetSpeciesDAO
GetTargetSpeciesDAO
on region database.- Returns:
- TargetSpeciesDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getTripTypeDAO
GetTripTypeDAO
on region database.- Returns:
- TripTypeDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getVariableDAO
GetVariableDAO
on region database.- Returns:
- VariableDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getVesselTypeDAO
GetVesselTypeDAO
on region database.- Returns:
- VesselTypeDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-
getZoneDAO
GetZoneDAO
on region database.- Returns:
- ZoneDAO
- Throws:
org.nuiton.topia.TopiaException
- Since:
- 4.3.1.0
-