public class SpringSimulationController extends SimulationController implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean
SpringSimulationController
is responsible for running
one or more independent JABM simulations which are configured using the
Spring Framework.
It is responsible for running one or more Monte-carlo simulations; that is,
any object implementing the Simulation
interface.
Typically a simulation will be run several hundred times with different
realisations of random variables. In order to ensure that each sample
is independent, the underlying simulation is initialised as a freshly
constructed bean from the Spring factory for every run.
A simulation model is constructed using
dependency injection
by creating a
Spring beans configuration file which specifies which classes to use
in the simulation and the values of any attributes (parameters).
The Spring configuration file is specified using the system property
jabm.config
.
Simulation
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected org.springframework.beans.factory.BeanFactory |
beanFactory |
protected String |
simulationBeanName
The name of the bean representing the Simulation.
|
protected boolean |
simulationInitialised |
protected SimulationScope |
simulationScope
The container for beans with scope="simulation".
|
batch, isRunning, listenersInitialised, modelDescription, numSimulations, reports, simulation, simulationFactory, slowSleepInterval
deleteQueue, genericListeners, specificListeners
Constructor and Description |
---|
SpringSimulationController() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected void |
constructSimulation() |
org.springframework.beans.factory.BeanFactory |
getBeanFactory() |
String |
getSimulationBeanName() |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setSimulationBeanName(String simulationBean)
The name of bean representing the Simulation to be run
as part of this experiment.
|
protected void |
tearDownSimulation()
Remove listeners prior to reconstructing the simulation object.
|
addReport, fireEvent, getModelDescription, getNumSimulations, getPopulation, getReports, getSimulation, getSimulationFactory, getSimulationTime, getSlowSleepInterval, isRunning, run, runSingleSimulation, setListeners, setModelDescription, setNumSimulations, setReports, setSimulation, setSimulationFactory, setSlowSleepInterval, slow, terminate, wireReports, wireSimulation
addListener, addListener, clearListeners, clone, notifyGenericListeners, notifySpecificListeners, processDeleteQueue, removeListener
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addListener, addListener, removeListener
protected String simulationBeanName
protected SimulationScope simulationScope
protected org.springframework.beans.factory.BeanFactory beanFactory
protected boolean simulationInitialised
protected void tearDownSimulation()
SimulationController
tearDownSimulation
in class SimulationController
protected void constructSimulation()
constructSimulation
in class SimulationController
public String getSimulationBeanName()
public void setSimulationBeanName(String simulationBean)
simulationBean
- Simulation
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public org.springframework.beans.factory.BeanFactory getBeanFactory()
Copyright © 2014. All rights reserved.