Package jasima.core.simulation
Class SimComponentBase
- java.lang.Object
-
- jasima.core.simulation.SimComponentBase
-
- All Implemented Interfaces:
SimComponent,SimLifecycleListener,SimOperations,Notifier<SimComponent,SimComponent.SimComponentEvent>,NotifierListener<Simulation,Simulation.SimLifecycleEvent>,ValueStore,Cloneable
- Direct Known Subclasses:
JobSource,SimComponentContainerBase,WorkStation
public class SimComponentBase extends Object implements SimComponent
Potential base class for simulation components implementing the interfaceSimComponent. Additionally this class introduces a name attribute (that is also used in thetoString()method).- 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 Modifier and Type Field Description protected Simulationsim-
Fields inherited from interface jasima.core.simulation.SimComponent
NAME_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description SimComponentBase()SimComponentBase(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimComponentBaseclone()Public clone method.StringgetHierarchicalName()Returns a base name for a SimComponent consisting of the hierarchical representation of the parent (SimComponent.getParent()), if it exists, and the (simple) name of the component's class.StringgetName()Gets the name of this component (must not be changed once set).SimComponentgetParent()Returns the container this component is contained in.SimulationgetSim()Returns the simulation this component is associated with.booleanisInitialized()NotifierImpl<SimComponent,SimComponent.SimComponentEvent>notifierImpl()SimComponents can notify registered listeners of certain events/messages occurring.voidsetInitialized(boolean initStatus)SimComponentsetName(String name)Sets a name for this component.protected voidsetNameInternal(String name)voidsetParent(SimComponent parent)Sets the container this component is contained in.voidsetSim(Simulation s)Sets the simulation this component is part of.StringtoString()ValueStorevalueStoreImpl()SimComponents provide aValueStoreto attach arbitrary key/value-pairs with them.-
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
addChild, addComponent, addResult, containsChild, done, getByHierarchicalName, getChild, getChildByName, getChildren, handleOther, inform, init, isValidName, numChildren, produceResults, removeChild, removeChildren, resetStats, simEnd, simStart
-
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
-
-
-
-
Field Detail
-
sim
protected transient Simulation sim
-
-
Constructor Detail
-
SimComponentBase
public SimComponentBase()
-
SimComponentBase
public SimComponentBase(String name)
-
-
Method Detail
-
getSim
public Simulation getSim()
Description copied from interface:SimComponentReturns the simulation this component is associated with.- Specified by:
getSimin interfaceSimComponent- Specified by:
getSimin interfaceSimOperations
-
setSim
public void setSim(Simulation s)
Description copied from interface:SimComponentSets the simulation this component is part of.- Specified by:
setSimin interfaceSimComponent
-
getParent
@Nullable public SimComponent getParent()
Description copied from interface:SimComponentReturns the container this component is contained in.- Specified by:
getParentin interfaceSimComponent
-
setParent
public void setParent(@Nullable SimComponent parent)
Description copied from interface:SimComponentSets the container this component is contained in.- Specified by:
setParentin interfaceSimComponent
-
getHierarchicalName
public String getHierarchicalName()
Description copied from interface:SimComponentReturns a base name for a SimComponent consisting of the hierarchical representation of the parent (SimComponent.getParent()), if it exists, and the (simple) name of the component's class.- Specified by:
getHierarchicalNamein interfaceSimComponent
-
isInitialized
public boolean isInitialized()
- Specified by:
isInitializedin interfaceSimComponent
-
setInitialized
public void setInitialized(boolean initStatus)
- Specified by:
setInitializedin interfaceSimComponent
-
getName
public String getName()
Description copied from interface:SimComponentGets the name of this component (must not be changed once set).- Specified by:
getNamein interfaceSimComponent
-
setName
public SimComponent setName(String name)
Sets a name for this component.- Specified by:
setNamein interfaceSimComponent
-
setNameInternal
protected void setNameInternal(String name)
-
valueStoreImpl
public ValueStore valueStoreImpl()
Description copied from interface:SimComponentSimComponents provide aValueStoreto attach arbitrary key/value-pairs with them. This can be used as a simple extension mechanism without having to use inheritance.- Specified by:
valueStoreImplin interfaceSimComponent- Specified by:
valueStoreImplin interfaceValueStore
-
notifierImpl
public NotifierImpl<SimComponent,SimComponent.SimComponentEvent> notifierImpl()
Description copied from interface:SimComponentSimComponents can notify registered listeners of certain events/messages occurring. The default implementation ofSimComponentinforms listeners of lifecycle events such as INIT, DONE, etc.- Specified by:
notifierImplin interfaceNotifier<SimComponent,SimComponent.SimComponentEvent>- Specified by:
notifierImplin interfaceSimComponent
-
clone
public SimComponentBase clone()
Description copied from interface:SimComponentPublic clone method. Implementing classes should implement a suitable functionality or throw aCloneNotSupportedExceptionwrapped in aRuntimeException.- Specified by:
clonein interfaceSimComponent- Overrides:
clonein classObject
-
-