1 | /** |
2 | * |
3 | */ |
4 | package de.uka.ipd.sdq.simulation.abstractsimengine.desmoj; |
5 | |
6 | import de.uka.ipd.sdq.simulation.abstractsimengine.ISimEngineFactory; |
7 | import de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationConfig; |
8 | import de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationControl; |
9 | import de.uka.ipd.sdq.simulation.abstractsimengine.ISimulationModel; |
10 | import desmoj.core.simulator.Model; |
11 | |
12 | /** |
13 | * @author Steffen Becker |
14 | * @author Philipp Merkle |
15 | * |
16 | */ |
17 | public class DesmoJModel extends Model implements ISimulationModel { |
18 | |
19 | private final ISimulationModel model; |
20 | |
21 | public DesmoJModel(final ISimulationModel model, final String modelName) { |
22 | super(null, modelName, false, false); |
23 | this.model = model; |
24 | } |
25 | |
26 | /** |
27 | * {@inheritDoc} |
28 | */ |
29 | @Override |
30 | public String description() { |
31 | return this.getName(); |
32 | } |
33 | |
34 | /** |
35 | * {@inheritDoc} |
36 | */ |
37 | @Override |
38 | public void doInitialSchedules() { |
39 | this.model.init(); |
40 | } |
41 | |
42 | /** |
43 | * {@inheritDoc} |
44 | */ |
45 | @Override |
46 | public void finalise() { |
47 | this.model.finalise(); |
48 | } |
49 | |
50 | /** |
51 | * {@inheritDoc} |
52 | */ |
53 | @Override |
54 | public ISimulationConfig getConfiguration() { |
55 | return this.model.getConfiguration(); |
56 | } |
57 | |
58 | /** |
59 | * {@inheritDoc} |
60 | */ |
61 | @Override |
62 | public ISimEngineFactory getSimEngineFactory() { |
63 | return this.model.getSimEngineFactory(); |
64 | } |
65 | |
66 | /** |
67 | * {@inheritDoc} |
68 | */ |
69 | @Override |
70 | public ISimulationControl getSimulationControl() { |
71 | return this.model.getSimulationControl(); |
72 | } |
73 | |
74 | /** |
75 | * {@inheritDoc} |
76 | */ |
77 | @Override |
78 | public void init() { |
79 | // do nothing since we have the doInitialSchedules method where initial events are scheduled |
80 | } |
81 | |
82 | /** |
83 | * {@inheritDoc} |
84 | */ |
85 | @Override |
86 | public void setSimulationControl(final ISimulationControl control) { |
87 | this.model.setSimulationControl(control); |
88 | } |
89 | |
90 | /** |
91 | * {@inheritDoc} |
92 | */ |
93 | @Override |
94 | public void setSimulationEngineFactory(final ISimEngineFactory factory) { |
95 | this.model.setSimulationEngineFactory(factory); |
96 | } |
97 | |
98 | } |