public class Vm
extends java.lang.Object
| Constructor and Description |
|---|
Vm(int id,
int userId,
double mips,
int numberOfPes,
int ram,
long bw,
long size,
java.lang.String vmm,
CloudletScheduler cloudletScheduler)
Creates a new VMCharacteristics object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStateHistoryEntry(double time,
double allocatedMips,
double requestedMips,
boolean isInMigration)
Adds the state history entry.
|
long |
getBw()
Gets the amount of bandwidth.
|
CloudletScheduler |
getCloudletScheduler()
Gets the vm scheduler.
|
long |
getCurrentAllocatedBw()
Gets the current allocated bw.
|
java.util.List<java.lang.Double> |
getCurrentAllocatedMips()
Gets the current allocated mips.
|
int |
getCurrentAllocatedRam()
Gets the current allocated ram.
|
long |
getCurrentAllocatedSize()
Gets the current allocated size.
|
long |
getCurrentRequestedBw()
Gets the current requested bw.
|
double |
getCurrentRequestedMaxMips()
Gets the current requested max mips among all virtual PEs.
|
java.util.List<java.lang.Double> |
getCurrentRequestedMips()
Gets the current requested mips.
|
int |
getCurrentRequestedRam()
Gets the current requested ram.
|
double |
getCurrentRequestedTotalMips()
Gets the current requested total mips.
|
Host |
getHost()
Gets the host.
|
int |
getId()
Gets the id.
|
double |
getMips()
Gets the mips.
|
int |
getNumberOfPes()
Gets the number of pes.
|
int |
getRam()
Gets the amount of ram.
|
long |
getSize()
Gets the amount of storage.
|
java.util.List<VmStateHistoryEntry> |
getStateHistory()
Gets the state history.
|
double |
getTotalUtilizationOfCpu(double time)
Get utilization created by all clouddlets running on this VM.
|
double |
getTotalUtilizationOfCpuMips(double time)
Get utilization created by all cloudlets running on this VM in MIPS.
|
java.lang.String |
getUid()
Get unique string identificator of the VM.
|
static java.lang.String |
getUid(int userId,
int vmId)
Generate unique string identificator of the VM.
|
int |
getUserId()
Gets the ID of the owner of the VM.
|
java.lang.String |
getVmm()
Gets the VMM.
|
boolean |
isBeingInstantiated()
Checks if is being instantiated.
|
boolean |
isInMigration()
Checks if is in migration.
|
void |
setBeingInstantiated(boolean beingInstantiated)
Sets the being instantiated.
|
void |
setBw(long bw)
Sets the amount of bandwidth.
|
protected void |
setCloudletScheduler(CloudletScheduler cloudletScheduler)
Sets the vm scheduler.
|
void |
setCurrentAllocatedBw(long currentAllocatedBw)
Sets the current allocated bw.
|
void |
setCurrentAllocatedMips(java.util.List<java.lang.Double> currentAllocatedMips)
Sets the current allocated mips.
|
void |
setCurrentAllocatedRam(int currentAllocatedRam)
Sets the current allocated ram.
|
protected void |
setCurrentAllocatedSize(long currentAllocatedSize)
Sets the current allocated size.
|
void |
setHost(Host host)
Sets the host that runs this VM.
|
protected void |
setId(int id)
Sets the id.
|
void |
setInMigration(boolean inMigration)
Sets the in migration.
|
protected void |
setMips(double mips)
Sets the mips.
|
protected void |
setNumberOfPes(int numberOfPes)
Sets the number of pes.
|
void |
setRam(int ram)
Sets the amount of ram.
|
void |
setSize(long size)
Sets the amount of storage.
|
void |
setUid(java.lang.String uid)
Sets the uid.
|
protected void |
setUserId(int userId)
Sets the user id.
|
protected void |
setVmm(java.lang.String vmm)
Sets the VMM.
|
double |
updateVmProcessing(double currentTime,
java.util.List<java.lang.Double> mipsShare)
Updates the processing of cloudlets running on this VM.
|
public Vm(int id, int userId, double mips, int numberOfPes, int ram, long bw, long size, java.lang.String vmm, CloudletScheduler cloudletScheduler)
id - unique ID of the VMuserId - ID of the VM's ownermips - the mipsnumberOfPes - amount of CPUsram - amount of rambw - amount of bandwidthsize - amount of storagevmm - virtual machine monitorcloudletScheduler - cloudletScheduler policy for cloudletspublic double updateVmProcessing(double currentTime,
java.util.List<java.lang.Double> mipsShare)
currentTime - current simulation timemipsShare - array with MIPS share of each Pe available to the schedulerpublic java.util.List<java.lang.Double> getCurrentRequestedMips()
public double getCurrentRequestedTotalMips()
public double getCurrentRequestedMaxMips()
public long getCurrentRequestedBw()
public int getCurrentRequestedRam()
public double getTotalUtilizationOfCpu(double time)
time - the timepublic double getTotalUtilizationOfCpuMips(double time)
time - the timepublic void setUid(java.lang.String uid)
uid - the new uidpublic java.lang.String getUid()
public static java.lang.String getUid(int userId,
int vmId)
userId - the user idvmId - the vm idpublic int getId()
protected void setId(int id)
id - the new idprotected void setUserId(int userId)
userId - the new user idpublic int getUserId()
public double getMips()
protected void setMips(double mips)
mips - the new mipspublic int getNumberOfPes()
protected void setNumberOfPes(int numberOfPes)
numberOfPes - the new number of pespublic int getRam()
public void setRam(int ram)
ram - new amount of rampublic long getBw()
public void setBw(long bw)
bw - new amount of bandwidthpublic long getSize()
public void setSize(long size)
size - new amount of storagepublic java.lang.String getVmm()
protected void setVmm(java.lang.String vmm)
vmm - the new VMMpublic void setHost(Host host)
host - Host running the VMpublic Host getHost()
public CloudletScheduler getCloudletScheduler()
protected void setCloudletScheduler(CloudletScheduler cloudletScheduler)
cloudletScheduler - the new vm schedulerpublic boolean isInMigration()
public void setInMigration(boolean inMigration)
inMigration - the new in migrationpublic long getCurrentAllocatedSize()
protected void setCurrentAllocatedSize(long currentAllocatedSize)
currentAllocatedSize - the new current allocated sizepublic int getCurrentAllocatedRam()
public void setCurrentAllocatedRam(int currentAllocatedRam)
currentAllocatedRam - the new current allocated rampublic long getCurrentAllocatedBw()
public void setCurrentAllocatedBw(long currentAllocatedBw)
currentAllocatedBw - the new current allocated bwpublic java.util.List<java.lang.Double> getCurrentAllocatedMips()
public void setCurrentAllocatedMips(java.util.List<java.lang.Double> currentAllocatedMips)
currentAllocatedMips - the new current allocated mipspublic boolean isBeingInstantiated()
public void setBeingInstantiated(boolean beingInstantiated)
beingInstantiated - the new being instantiatedpublic java.util.List<VmStateHistoryEntry> getStateHistory()
public void addStateHistoryEntry(double time,
double allocatedMips,
double requestedMips,
boolean isInMigration)
time - the timeallocatedMips - the allocated mipsrequestedMips - the requested mipsisInMigration - the is in migration