Interface Machine<T extends Resource>
- Type Parameters:
T- The type of the storage device for the machine
- All Superinterfaces:
ChangeableId,ExecDelayable,Identifiable,Resourceful,Startable
- All Known Subinterfaces:
Host,PhysicalMachine,Vm
- All Known Implementing Classes:
HostAbstract,HostSimple,NetworkHost,NetworkVm,VmAbstract,VmGroup,VmSimple
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MachineAn attribute that implements the Null Object Design Pattern forMachineobjects.Fields inherited from interface org.cloudsimplus.core.Startable
NOT_ASSIGNED -
Method Summary
Modifier and TypeMethodDescriptiongetBw()default doubleGets the time interval the Machine has been idle.doubleGets the last time the entity was running some process orStartable.NOT_ASSIGNEDif it has not been busy yet.doublegetMips()longgetRam()doubledefault booleanisIdle()default booleanisIdleEnough(double time) Checks if the Machine has been idle for a given amount of time (in seconds).static voidvalidateCapacity(double capacity) Validates a capacity for a machine resource.Methods inherited from interface org.cloudsimplus.core.ChangeableId
setIdMethods inherited from interface org.cloudsimplus.core.ExecDelayable
getRemainingStartupTime, getShutdownBeginTime, getShutDownDelay, getStartupCompletionTime, getStartupDelay, isShutDownDelayed, isShuttingDown, isStartingUp, isStartupDelayed, setShutdownBeginTime, setShutDownDelay, setStartupDelay, shutdownMethods inherited from interface org.cloudsimplus.core.Identifiable
getIdMethods inherited from interface org.cloudsimplus.resources.Resourceful
getResource, getResourcesMethods inherited from interface org.cloudsimplus.core.Startable
getFinishTime, getStartTime, getTotalExecutionTime, hasStarted, isFinished, setFinishTime, setLastBusyTime, setStartTime
-
Field Details
-
NULL
-
-
Method Details
-
getBw
Resource getBw()- Returns:
- a resource representing the machine bandwidth (bw) in Megabits/s.
-
getRam
Resource getRam()- Returns:
- a resource representing the machine memory in Megabytes.
-
getStorage
T getStorage()- Returns:
- the storage device of the machine with capacity in Megabytes.
-
getPesNumber
long getPesNumber()- Returns:
- the overall number of
Pes the machine has, that include PEs of all statuses, including failed PEs.
-
getMips
double getMips()- Returns:
- the individual MIPS capacity of any machine's
Pe, considering that all PEs have the same capacity.
-
getTotalMipsCapacity
double getTotalMipsCapacity()- Returns:
- total MIPS capacity across all PEs of the machine.
-
getSimulation
Simulation getSimulation()- Specified by:
getSimulationin interfaceStartable- Returns:
- the
CloudSimPlusinstance that represents the simulation the Entity belongs to.
-
isIdleEnough
default boolean isIdleEnough(double time) Checks if the Machine has been idle for a given amount of time (in seconds).- Parameters:
time- the time interval to check if the Machine has been idle (in seconds). If time is zero, it will be checked if the Machine is currently idle. If it's negative, even if the Machine is idle, it's considered that it isn't idle enough. This is useful if you don't want to perform any operation when the machine becomes idle (for instance, if idle machines might be shut down and a negative value is given, they won't).- Returns:
- true if the Machine has been idle as long as the given time; false if it's active or isn't idle long enough
-
getIdleInterval
default double getIdleInterval()Gets the time interval the Machine has been idle.- Returns:
- the idle time interval (in seconds) or 0 if the Machine is not idle
-
getLastBusyTime
double getLastBusyTime()Description copied from interface:StartableGets the last time the entity was running some process orStartable.NOT_ASSIGNEDif it has not been busy yet.- Specified by:
getLastBusyTimein interfaceStartable- Returns:
- the last time the Machine was running some process (in seconds).
-
isIdle
default boolean isIdle()- Returns:
- true if the Machine is currently idle, false otherwise
-
validateCapacity
static void validateCapacity(double capacity) Validates a capacity for a machine resource.- Parameters:
capacity- the capacity to check- Throws:
IllegalArgumentException- if the given capacity is zero or negative
-