public interface SimEntity extends Nameable, Cloneable, Runnable, Comparable<SimEntity>
CloudSimEntity
Modifier and Type | Interface and Description |
---|---|
static class |
SimEntity.State
Defines the event state.
|
Modifier and Type | Field and Description |
---|---|
static SimEntity |
NULL
An attribute that implements the Null Object Design Pattern for
SimEntity
objects. |
Modifier and Type | Method and Description |
---|---|
Simulation |
getSimulation()
Gets the CloudSim instance that represents the simulation to each the Entity is related to.
|
boolean |
isAlive()
Checks if the entity is alive, i.e, it's not finished.
|
boolean |
isFinished()
Checks if the entity is finished or not.
|
boolean |
isStarted()
Checks if the entity already was started or not.
|
void |
processEvent(SimEvent ev)
Processes events or services that are available for the entity.
|
void |
run()
The run loop to process events fired during the simulation.
|
void |
schedule(SimEntity dest,
double delay,
int tag)
Sends an event to another entity with no attached data.
|
void |
setLog(boolean log)
Define if log is enabled for this particular entity or not.
|
SimEntity |
setName(String newName)
Sets the Entity name.
|
SimEntity |
setSimulation(Simulation simulation)
Sets the CloudSim instance that represents the simulation the Entity is related to.
|
SimEntity |
setState(SimEntity.State state) |
void |
shutdownEntity()
Shuts down the entity.
|
void |
start()
Starts the entity during simulation start.
|
getId
compareTo
SimEntity setState(SimEntity.State state)
boolean isStarted()
boolean isAlive()
boolean isFinished()
Simulation getSimulation()
SimEntity setSimulation(Simulation simulation)
simulation
- The CloudSim instance that represents the simulation the Entity is related tovoid processEvent(SimEvent ev)
CloudSim
class whenever there is an
event in the deferred queue, which needs to be processed by the entity.ev
- information about the event just happenedvoid schedule(SimEntity dest, double delay, int tag)
dest
- the destination entitydelay
- How many seconds after the current simulation time the event should be senttag
- An user-defined number representing the type of event.void run()
processEvent(SimEvent)
method.run
in interface Runnable
processEvent(SimEvent)
void start()
CloudSim
class when the simulation is started.void shutdownEntity()
CloudSim
before the simulation finishes. If you want to save data in log files
this is the method in which the corresponding code would be placed.SimEntity setName(String newName) throws IllegalArgumentException
newName
- the new nameIllegalArgumentException
- when the entity name is null or emptyvoid setLog(boolean log)
log
- true to enable logging, false to disableCopyright © 2015–2018 Systems, Security and Image Communication Lab - Instituto de Telecomunicações (IT) - Universidade da Beira Interior (UBI) - Instituto Federal de Educação Ciência e Tecnologia do Tocantins (IFTO). All rights reserved.