Example #1
0
        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;
        }
Example #2
0
 public double UpdateVmProcessing(double currentTime, List <double> mipsShare)
 {
     if (mipsShare != null)
     {
         return(CloudletScheduler.UpdateVmProcessing(currentTime, mipsShare));
     }
     return(0);
 }
Example #3
0
 public int GetCurrentRequestedRam()
 {
     if (BeingInstantiated)
     {
         return(Ram);
     }
     return((int)(CloudletScheduler.GetCurrentRequestedUtilizationOfRam() * Ram));
 }
Example #4
0
 public long GetCurrentRequestedBw()
 {
     if (BeingInstantiated)
     {
         return(Bw);
     }
     return((long)(CloudletScheduler.GetCurrentRequestedUtilizationOfBw() * Bw));
 }
Example #5
0
        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);
        }
Example #6
0
 public double GetTotalUtilizationOfCpu(double time)
 {
     return(CloudletScheduler.GetTotalUtilizationOfCpu(time));
 }