| 1 | package de.uka.ipd.sdq.simulation.abstractsimengine; |
| 2 | |
| 3 | /** |
| 4 | * @author Steffen Becker (this code has been factored out from SimuCom) |
| 5 | * @author Philipp Merkle |
| 6 | * |
| 7 | * @param <M> |
| 8 | * the type of the simulation model |
| 9 | * @see IEntity |
| 10 | */ |
| 11 | public abstract class AbstractSimEntityDelegator extends SimulationElement implements IEntity { |
| 12 | |
| 13 | /** |
| 14 | * the delegate has the simulation-library-specific knowledge of how entities are handled. |
| 15 | */ |
| 16 | protected IEntity delegate; |
| 17 | |
| 18 | protected AbstractSimEntityDelegator(ISimulationModel model, String name) { |
| 19 | super(model, name); |
| 20 | delegate = model.getSimEngineFactory().createEntity(this, name); |
| 21 | } |
| 22 | |
| 23 | public boolean isScheduled() { |
| 24 | return delegate.isScheduled(); |
| 25 | } |
| 26 | |
| 27 | public void reschedule(double d) { |
| 28 | delegate.reschedule(d); |
| 29 | } |
| 30 | |
| 31 | public IEntity getEncapsulatedEntity() { |
| 32 | return delegate; |
| 33 | } |
| 34 | |
| 35 | } |