1 | package de.uka.ipd.sdq.simulation.abstractsimengine.desmoj; |
2 | |
3 | import de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEntityDelegator; |
4 | import de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimEventDelegator; |
5 | import de.uka.ipd.sdq.simulation.abstractsimengine.AbstractSimProcessDelegator; |
6 | import de.uka.ipd.sdq.simulation.abstractsimengine.IEntity; |
7 | import de.uka.ipd.sdq.simulation.abstractsimengine.ISimEngineFactory; |
8 | import de.uka.ipd.sdq.simulation.abstractsimengine.ISimEvent; |
9 | import de.uka.ipd.sdq.simulation.abstractsimengine.ISimProcess; |
10 | import de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationControl; |
11 | import de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationModel; |
12 | |
13 | /** |
14 | * @author Steffen Becker |
15 | * @author Philipp Merkle |
16 | */ |
17 | public class DesmoJSimEngineFactory implements ISimEngineFactory { |
18 | |
19 | private DesmoJModel model; |
20 | |
21 | @Override |
22 | public void setModel(final ISimulationModel model) { |
23 | final String modelName = model.getConfiguration().getNameExperimentRun(); |
24 | this.model = new DesmoJModel(model, modelName); |
25 | } |
26 | |
27 | @Override |
28 | public ISimulationControl createSimulationControl() { |
29 | final ISimulationControl delegate = new DesmoJExperiment(this.model); |
30 | this.model.setSimulationControl(delegate); |
31 | return delegate; |
32 | } |
33 | |
34 | @Override |
35 | public IEntity createEntity(final AbstractSimEntityDelegator e, final String name) { |
36 | return new DesmoJEntity(e, this.model, name); |
37 | } |
38 | |
39 | @Override |
40 | public <E extends IEntity> ISimEvent<E> createSimEvent(final AbstractSimEventDelegator<E> myEvent, final String name) { |
41 | return new DesmoJSimEvent<E>(myEvent, this.model, name); |
42 | } |
43 | |
44 | @Override |
45 | public ISimProcess createSimProcess(final AbstractSimProcessDelegator myProcess, final String name) { |
46 | return new DesmoJSimProcess(myProcess, this.model, name); |
47 | } |
48 | |
49 | } |