public Vm( int id, int userId, double mips, int numberOfPes, int ram, long bw, long size, string vmm, CloudletScheduler cloudletScheduler) { Id = id; UserId = userId; Uid = GetUid(userId, id); Mips = mips; NumberOfPes = numberOfPes; Ram = ram; Bw = bw; Size = size; Vmm = vmm; CloudletScheduler = cloudletScheduler; InMigration = false; BeingInstantiated = true; CurrentAllocatedBw = 0; CurrentAllocatedMips = null; CurrentAllocatedRam = 0; CurrentAllocatedSize = 0; }
public double UpdateVmProcessing(double currentTime, List <double> mipsShare) { if (mipsShare != null) { return(CloudletScheduler.UpdateVmProcessing(currentTime, mipsShare)); } return(0); }
public int GetCurrentRequestedRam() { if (BeingInstantiated) { return(Ram); } return((int)(CloudletScheduler.GetCurrentRequestedUtilizationOfRam() * Ram)); }
public long GetCurrentRequestedBw() { if (BeingInstantiated) { return(Bw); } return((long)(CloudletScheduler.GetCurrentRequestedUtilizationOfBw() * Bw)); }
public List <double> GetCurrentRequestedMips() { List <double> currentRequestedMips = CloudletScheduler.GetCurrentRequestedMips(); if (BeingInstantiated) { currentRequestedMips = new List <double>(); for (int i = 0; i < NumberOfPes; i++) { currentRequestedMips.Add(Mips); } } return(currentRequestedMips); }
public double GetTotalUtilizationOfCpu(double time) { return(CloudletScheduler.GetTotalUtilizationOfCpu(time)); }