congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Host.allocatePesForVm
Code IndexAdd Tabnine to your IDE (free)

How to use
allocatePesForVm
method
in
org.cloudbus.cloudsim.Host

Best Java code snippets using org.cloudbus.cloudsim.Host.allocatePesForVm (Showing top 3 results out of 315)

origin: thiagotts/CloudReports

/**
 * Gets the power after allocation.
 *
 * @param host the host.
 * @param vm the virtual machine.
 * @return the power usage after allocation of the virtual machine.
 */
protected double getPowerAfterAllocation(PowerHost host, Vm vm) {
  List<Double> allocatedMipsForVm = null;
  PowerHost allocatedHost = (PowerHost) vm.getHost();
  if (allocatedHost != null) {
    allocatedMipsForVm = allocatedHost.getAllocatedMipsForVm(vm);
  }
  if (!host.allocatePesForVm(vm, vm.getCurrentRequestedMips())) {
    return -1;
  }
  double power = host.getPower();
  host.deallocatePesForVm(vm);
  if (allocatedHost != null && allocatedMipsForVm != null) {
    vm.getHost().allocatePesForVm(vm, allocatedMipsForVm);
  }
  return power;
}
origin: Cloudslab/cloudsim

  /**
   * Gets the max utilization among the PEs of a given VM placed at a given host.
   * @param host The host where the VM is placed
   * @param vm The VM to get the max PEs utilization
   * @return The max utilization among the PEs of the VM
   */
protected double getMaxUtilizationAfterAllocation(NetworkHost host, Vm vm) {
  List<Double> allocatedMipsForVm = null;
  NetworkHost allocatedHost = (NetworkHost) vm.getHost();
  if (allocatedHost != null) {
    allocatedMipsForVm = vm.getHost().getAllocatedMipsForVm(vm);
  }
  if (!host.allocatePesForVm(vm, vm.getCurrentRequestedMips())) {
    return -1;
  }
  double maxUtilization = host.getMaxUtilizationAmongVmsPes(vm);
  host.deallocatePesForVm(vm);
  if (allocatedHost != null && allocatedMipsForVm != null) {
    vm.getHost().allocatePesForVm(vm, allocatedMipsForVm);
  }
  return maxUtilization;
}
origin: thiagotts/CloudReports

/**
 * Gets the maximum utilization after allocation.
 *
 * @param host the host.
 * @param vm the virtual machine.
 * @return the maximum utilization after allocation of the virtual machine.
 */
protected double getMaxUtilizationAfterAllocation(PowerHost host, Vm vm) {
  List<Double> allocatedMipsForVm = null;
  PowerHost allocatedHost = (PowerHost) vm.getHost();
  if (allocatedHost != null) {
    allocatedMipsForVm = vm.getHost().getAllocatedMipsForVm(vm);
  }
  if (!host.allocatePesForVm(vm, vm.getCurrentRequestedMips())) {
    return -1;
  }
  double maxUtilization = host.getMaxUtilizationAmongVmsPes(vm);
  host.deallocatePesForVm(vm);
  if (allocatedHost != null && allocatedMipsForVm != null) {
    vm.getHost().allocatePesForVm(vm, allocatedMipsForVm);
  }
  return maxUtilization;
}
org.cloudbus.cloudsimHostallocatePesForVm

Javadoc

Allocates PEs for a VM.

Popular methods of Host

  • getId
    Gets the host id.
  • getAllocatedMipsForVm
    Gets the MIPS share of each Pe that is allocated to a given VM.
  • getRamProvisioner
    Gets the ram provisioner.
  • vmCreate
    Try to allocate resources to a new VM in the Host.
  • <init>
    Instantiates a new host.
  • getBwProvisioner
    Gets the bw provisioner.
  • getNumberOfPes
    Gets the pes number.
  • getPeList
    Gets the pe list.
  • getStorage
    Gets the host storage.
  • getTotalMips
    Gets the total mips.
  • getVm
    Gets a VM by its id and user.
  • getVmList
    Gets the vm list.
  • getVm,
  • getVmList,
  • getVmScheduler,
  • getVmsMigratingIn,
  • isFailed,
  • reallocateMigratingInVms,
  • removeMigratingInVm,
  • setBwProvisioner,
  • setDatacenter

Popular in Java

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • setScale (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now