Package jasima.core.simulation
Class SimEntity
- java.lang.Object
-
- jasima.core.simulation.SimComponentBase
-
- jasima.core.simulation.SimComponentContainerBase
-
- jasima.core.simulation.SimEntity
-
- All Implemented Interfaces:
SimComponent,SimComponentContainer,SimLifecycleListener,SimOperations,Notifier<SimComponent,SimComponent.SimComponentEvent>,NotifierListener<Simulation,Simulation.SimLifecycleEvent>,ValueStore,Cloneable
public class SimEntity extends SimComponentContainerBase
ASimEntityis aSimComponentwith a singleSimProcessmodelling its main lifecycle actions using the process-oriented modelling world view. The behaviour ofSimEntitys can be defined either by specifying aSimProcessUtil.SimActionlifecycleActionsor by subclassing and overriding the methodlifecycle().- Since:
- 3.0
- Author:
- Torsten Hildebrandt
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jasima.core.simulation.SimComponent
SimComponent.ProduceResultsEvent, SimComponent.SimComponentEvent, SimComponent.SimComponentLifeCycleMessage
-
Nested classes/interfaces inherited from interface jasima.core.simulation.SimLifecycleListener
SimLifecycleListener.DoneListener, SimLifecycleListener.OtherListener, SimLifecycleListener.ResetStatsListener, SimLifecycleListener.ResultsListener, SimLifecycleListener.SimEndListener, SimLifecycleListener.SimInitialized, SimLifecycleListener.SimStartListener
-
Nested classes/interfaces inherited from interface jasima.core.simulation.util.SimOperations
SimOperations.SimEventType
-
-
Field Summary
-
Fields inherited from class jasima.core.simulation.SimComponentBase
sim
-
Fields inherited from interface jasima.core.simulation.SimComponent
NAME_SEPARATOR
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidawakeAt(double tAbs)voidawakeAt(Instant instant)voidawakeIn(double deltaT)voidawakeIn(long amount, TemporalUnit u)voidawakeIn(Duration d)SimProcess<Void>cancel()SimProcess<Void>getLifecycleProcess()voidinit()SimProcess<Void>join()protected voidlifecycle()Defines the behaviour of theSimEntity, potentially using blocking/process-oriented operations.voidresume()voidsimStart()SimProcess<Void>suspend()-
Methods inherited from class jasima.core.simulation.SimComponentContainerBase
addChild, addComponent, clone, getChild, getChildByName, getChildren, numChildren, removeChild, removeChildren
-
Methods inherited from class jasima.core.simulation.SimComponentBase
getHierarchicalName, getName, getParent, getSim, isInitialized, notifierImpl, setInitialized, setName, setNameInternal, setParent, setSim, toString, valueStoreImpl
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jasima.core.util.observer.Notifier
addListener, addListener, addListener, fire, fire, getListener, numListener, removeCurrentListener, removeListener
-
Methods inherited from interface jasima.core.simulation.SimComponent
addResult, containsChild, done, getHierarchicalName, getName, getParent, getSim, handleOther, inform, isInitialized, isValidName, notifierImpl, produceResults, resetStats, setInitialized, setName, setParent, setSim, simEnd, valueStoreImpl
-
Methods inherited from interface jasima.core.simulation.SimComponentContainer
componentSetHelper, getByHierarchicalName
-
Methods inherited from interface jasima.core.simulation.util.SimOperations
activateEntity, currentPrio, end, getRootComponent, initRndGen, initRndGen, isEndRequested, isTraceEnabled, schedule, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleAt, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, scheduleIn, schedulePeriodically, schedulePeriodically, scheduleProcess, scheduleProcess, simTime, simTimeAbs, simTimeToInstant, toSimTime, toSimTime, toSimTime, trace
-
Methods inherited from interface jasima.core.util.ValueStore
valueStoreContains, valueStoreGet, valueStoreGet, valueStoreGetAllKeys, valueStoreGetNumKeys, valueStorePut, valueStoreRemove, valueStoreUpdate
-
-
-
-
Constructor Detail
-
SimEntity
public SimEntity()
-
SimEntity
public SimEntity(String name)
-
-
Method Detail
-
init
public void init()
-
simStart
public void simStart()
-
lifecycle
protected void lifecycle() throws SimProcess.MightBlockDefines the behaviour of theSimEntity, potentially using blocking/process-oriented operations. This method can be overridden, the implementation here only delegates to#lifecycleActionsif set.- Throws:
SimProcess.MightBlock
-
getLifecycleProcess
public SimProcess<Void> getLifecycleProcess()
-
resume
public void resume()
- See Also:
SimProcess.resume()
-
suspend
public SimProcess<Void> suspend() throws SimProcess.MightBlock
- Throws:
SimProcess.MightBlock- See Also:
SimProcess.suspend()
-
join
public SimProcess<Void> join() throws SimProcess.MightBlock
- Throws:
SimProcess.MightBlock- See Also:
SimProcess.join()
-
awakeIn
public void awakeIn(double deltaT)
- See Also:
SimProcess.awakeIn(double)
-
awakeIn
public void awakeIn(long amount, TemporalUnit u)- See Also:
SimProcess.awakeIn(long,TemporalUnit)
-
awakeIn
public void awakeIn(Duration d)
- See Also:
SimProcess.awakeIn(Duration)
-
awakeAt
public void awakeAt(double tAbs)
- See Also:
SimProcess.awakeAt(double)
-
awakeAt
public void awakeAt(Instant instant)
- See Also:
SimProcess.awakeAt(Instant)
-
cancel
public SimProcess<Void> cancel()
- See Also:
SimProcess.cancel()
-
-