public class SimulationContext extends Object
| Modifier and Type | Field and Description |
|---|---|
protected IsisCache |
cache
cache used by aspect for this simulation
|
protected ClassLoader |
classLoader |
protected Map<String,Double> |
contextEquationValue
Context value used in equation.
|
protected org.nuiton.topia.TopiaContext |
db
TopiaContext must be used by rule action to modify data
|
protected org.nuiton.topia.TopiaContext |
dbResult
TopiaContext must be used to save result
|
protected MetierMonitor |
metierMonitor |
protected PopulationMonitor |
populationMonitor |
protected ResultManager |
resultManager |
protected RuleMonitor |
ruleMonitor |
protected File |
scriptDirectory |
protected SimulationStorage |
simulation |
protected SimulationControl |
simulationControl |
protected Set<SimulationListener> |
simulationListeners |
protected Trace |
trace
l'objet trace qui conserve les donnees statistiques des appels de methodes
|
protected Map<String,Object> |
values |
protected Map<org.nuiton.topia.persistence.TopiaEntity,SimulationVariable> |
variablesCache
CacheAspect des variables d'entités.
|
| Modifier | Constructor and Description |
|---|---|
protected |
SimulationContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSimulationListener(SimulationListener l)
Add simulation listener, if listener is
SimulationResultListener, it's
automatically added as listener on ResultManager |
void |
clearCache(TimeStep step)
Clear isis fish cache for specified time step.
|
void |
closeDB() |
void |
closeDBResult() |
void |
fireAfterSimulation() |
void |
fireBeforeSimulation() |
static SimulationContext |
get() |
SimulationVariable |
get(org.nuiton.topia.persistence.TopiaEntity entity)
Get object containing variable for given entity.
|
IsisCache |
getCache() |
ClassLoader |
getClassLoader() |
org.nuiton.topia.TopiaContext |
getDB()
This method return TopiaContext that Rule action must used to modify
data.
|
org.nuiton.topia.TopiaContext |
getDbResult()
this method return TopiaContext that must be used to save result
|
MetierMonitor |
getMetierMonitor() |
PopulationMonitor |
getPopulationMonitor() |
ResultManager |
getResultManager() |
RuleMonitor |
getRuleMonitor() |
File |
getScriptDirectory() |
SimulationControl |
getSimulationControl() |
SimulationStorage |
getSimulationStorage() |
Trace |
getTrace() |
Object |
getValue(String name)
Permet de recuperer une valeur prealablement stocker avec un setValue
|
double |
getValueAndCompute(String key,
double defaultValue)
Return value from context.
|
void |
message(String message) |
static void |
remove()
remove simulation associate with current thread
|
void |
removeSimulationListener(SimulationListener l)
Remove simulation listener, if listener is
SimulationResultListener, it's
Automatically removed as listener on ResultManager |
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 |
setValue(String name,
Object value)
Permet de stocker une valeur en fonction d'une cle, cela peut-etre util
pour partager des informations entre Rule ou d'autre objet.
|
protected SimulationStorage simulation
protected SimulationControl simulationControl
protected PopulationMonitor populationMonitor
protected MetierMonitor metierMonitor
protected RuleMonitor ruleMonitor
protected ResultManager resultManager
protected Set<SimulationListener> simulationListeners
protected ClassLoader classLoader
protected File scriptDirectory
protected Trace trace
protected IsisCache cache
protected org.nuiton.topia.TopiaContext db
protected org.nuiton.topia.TopiaContext dbResult
protected Map<org.nuiton.topia.persistence.TopiaEntity,SimulationVariable> variablesCache
public static SimulationContext get()
public static void remove()
public void addSimulationListener(SimulationListener l)
SimulationResultListener, it's
automatically added as listener on ResultManagerl - public void closeDB()
public void closeDBResult()
public void removeSimulationListener(SimulationListener l)
SimulationResultListener, it's
Automatically removed as listener on ResultManagerl - public void fireBeforeSimulation()
public void fireAfterSimulation()
public ClassLoader getClassLoader()
public void setClassLoader(ClassLoader classLoader)
classLoader - The classLoader to set.public Trace getTrace()
public IsisCache getCache()
public Object getValue(String name)
name - le nom de la valeur souhaitéepublic void setValue(String name, Object value)
name - le nom de la valeurvalue - la valeurpublic SimulationStorage getSimulationStorage()
public void setSimulationStorage(SimulationStorage simulation)
simulation - The simulation storage to set.public SimulationControl getSimulationControl()
public void setSimulationControl(SimulationControl simulationControl)
simulationControl - The simulationControl to set.public PopulationMonitor getPopulationMonitor()
public MetierMonitor getMetierMonitor()
public RuleMonitor getRuleMonitor()
public ResultManager getResultManager()
public org.nuiton.topia.TopiaContext getDB()
throws org.nuiton.topia.TopiaException
org.nuiton.topia.TopiaExceptionpublic org.nuiton.topia.TopiaContext getDbResult()
throws org.nuiton.topia.TopiaException
org.nuiton.topia.TopiaExceptionpublic void clearCache(TimeStep step) throws org.nuiton.topia.TopiaException
step - time step to remove dataorg.nuiton.topia.TopiaExceptionpublic File getScriptDirectory()
public void setScriptDirectory(File scriptDirectory)
scriptDirectory - public void message(String message)
message - messagepublic void setComputeValue(String key, Double value)
key - keyvalue - valuepublic double getValueAndCompute(String key, double defaultValue)
key - keydefaultValue - default value or value to computepublic SimulationVariable get(org.nuiton.topia.persistence.TopiaEntity entity)
entity - entityCopyright © 1999–2013 CodeLutin. All rights reserved.