Interface SimEntityNullBase
- All Superinterfaces:
Comparable<SimEntity>,Identifiable,Nameable,Runnable,SimEntity
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cloudsimplus.core.SimEntity
SimEntity.State -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault longgetId()default StringgetName()default doubledefault Simulationdefault doubledefault SimEntity.StategetState()default booleanisAlive()default booleandefault booleandefault voidprocessEvent(SimEvent evt) Processes events or services that are available for the entity.default voidrun()Starts the run loop to process events fired during the simulation.default booleanschedule(double delay, int tag) Sends an event from the entity to itself with no data.default booleanSends an event from the entity to itself.default booleanSends an event from the entity to itself with no delay.default booleanSends an event where all data required is defined inside the event instance.default booleanSends an event to another entity with no attached data.default booleanSends an event to another entity.default SimEntitySets the Entity name.default SimEntitysetState(SimEntity.State state) Sets the entity state.default voidshutdown()Shuts down the entity.default booleanstart()Starts the entity during simulation start.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
getState
-
setState
Description copied from interface:SimEntitySets the entity state. -
isStarted
-
isAlive
-
isFinished
default boolean isFinished()- Specified by:
isFinishedin interfaceSimEntity- Returns:
- true if the entity is finished, false otherwise.
-
getSimulation
- Specified by:
getSimulationin interfaceSimEntity- Returns:
- the
CloudSimPlusinstance that represents the simulation to which the Entity belongs to.
-
processEvent
Description copied from interface:SimEntityProcesses events or services that are available for the entity. This method is invoked, by theCloudSimPlusclass, whenever there is an event in the deferred queue that needs to be processed by the entity.- Specified by:
processEventin interfaceSimEntity- Parameters:
evt- information about the event just happened
-
schedule
Description copied from interface:SimEntitySends an event where all data required is defined inside the event instance. -
schedule
Description copied from interface:SimEntitySends an event to another entity.- Specified by:
schedulein interfaceSimEntity- Parameters:
dest- the destination entitydelay- How many seconds after the current simulation time the event should be senttag- a tag representing the type of event, according to theCloudSimTagor some custom one.data- The data to be sent with the event, according to the tag- Returns:
- true if the event was sent; false if the simulation was not started yet
-
schedule
Description copied from interface:SimEntitySends an event from the entity to itself.- Specified by:
schedulein interfaceSimEntity- Parameters:
delay- How many seconds after the current simulation time the event should be senttag- a tag representing the type of event, according to theCloudSimTagor some custom one.data- The data to be sent with the event, according to the tag- Returns:
- true if the event was sent; false if the simulation was not started yet
-
schedule
Description copied from interface:SimEntitySends an event to another entity with no attached data.- Specified by:
schedulein interfaceSimEntity- Parameters:
dest- the destination entitydelay- How many seconds after the current simulation time the event should be senttag- a tag representing the type of event, according to theCloudSimTagor some custom one.- Returns:
- true if the event was sent; false if the simulation was not started yet
-
schedule
Description copied from interface:SimEntitySends an event from the entity to itself with no delay.- Specified by:
schedulein interfaceSimEntity- Parameters:
tag- a tag representing the type of event, according to theCloudSimTagor some custom one.data- The data to be sent with the event, according to the tag- Returns:
- true if the event was sent; false if the simulation was not started yet
-
schedule
default boolean schedule(double delay, int tag) Description copied from interface:SimEntitySends an event from the entity to itself with no data.- Specified by:
schedulein interfaceSimEntity- Parameters:
delay- How many seconds after the current simulation time the event should be senttag- a tag representing the type of event, according to theCloudSimTagor some custom one.- Returns:
- true if the event was sent; false if the simulation was not started yet
-
run
default void run()Description copied from interface:SimEntityStarts the run loop to process events fired during the simulation. The events that will be processed are defined in theSimEntity.processEvent(SimEvent)method. -
start
default boolean start()Description copied from interface:SimEntityStarts the entity during simulation start. This method is invoked by theCloudSimPlusclass when the simulation is started. -
shutdown
default void shutdown()Description copied from interface:SimEntityShuts down the entity. This method is invoked byCloudSimPlusbefore the simulation finishes. If you want to save data in log files, this is the method in which the corresponding code may be placed. -
setName
Description copied from interface:SimEntitySets the Entity name.- Specified by:
setNamein interfaceSimEntity- Parameters:
newName- the new name- Returns:
- this entity instance
- Throws:
IllegalArgumentException- when the entity name is null or empty
-
getName
-
getId
default long getId()- Specified by:
getIdin interfaceIdentifiable- Returns:
- the id number assigned to this entity.
-
getShutdownTime
default double getShutdownTime()- Specified by:
getShutdownTimein interfaceSimEntity- Returns:
- the time the entity was shutdown (in seconds),
or -1 if the entity
SimEntity.isAlive()yet.
-
getStartTime
default double getStartTime()- Specified by:
getStartTimein interfaceSimEntity- Returns:
- the time the entity was started (in seconds) or -1 if it hasn't started yet.
-