Tabnine Logo
VmSimple
Code IndexAdd Tabnine to your IDE (free)

How to use
VmSimple
in
org.cloudbus.cloudsim.vms

Best Java code snippets using org.cloudbus.cloudsim.vms.VmSimple (Showing top 20 results out of 315)

origin: manoelcampos/cloudsim-plus

private Vm createVm(DatacenterBroker broker) {
  final long   mips = 1000;
  final long   storage = 10000; // vm image size (Megabyte)
  final int    ram = 512; // vm memory (Megabyte)
  final long   bw = 1000; // vm bandwidth (Megabits/s)
  final long   pesNumber = 2; // number of CPU cores
  return new VmSimple(vmList.size(), mips, pesNumber)
      .setRam(ram)
      .setBw(bw)
      .setSize(storage)
      .setCloudletScheduler(new CloudletSchedulerTimeShared());
}
origin: manoelcampos/cloudsim-plus

private <T extends VmScaling> T validateAndConfigureVmScaling(final T vmScaling) {
  requireNonNull(vmScaling);
  if(vmScaling.getVm() != null && vmScaling.getVm() != Vm.NULL && vmScaling.getVm() != this){
    final String name = vmScaling.getClass().getSimpleName();
    throw new IllegalArgumentException(
      "The "+name+" given is already linked to a Vm. " +
      "Each Vm must have its own "+name+" object or none at all. " +
      "Another "+name+" has to be provided for this Vm.");
  }
  vmScaling.setVm(this);
  this.addOnUpdateProcessingListener(vmScaling::requestUpScalingIfPredicateMatches);
  return vmScaling;
}
origin: manoelcampos/cloudsim-plus

@Override
public boolean equals(final Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  final VmSimple vmSimple = (VmSimple) o;
  if (getId() != vmSimple.getId()) return false;
  return getBroker().equals(vmSimple.getBroker());
}
origin: manoelcampos/cloudsim-plus

@Override
public double getTotalCpuMipsUsage(final double time) {
  return getCpuPercentUsage(time) * getTotalMipsCapacity();
}
origin: manoelcampos/cloudsim-plus

@Override
public double getCpuPercentUsage() {
  return getCpuPercentUsage(getSimulation().clock());
}
origin: manoelcampos/cloudsim-plus

setInMigration(false);
setHost(Host.NULL);
setCloudletScheduler(new CloudletSchedulerTimeShared());
this.processor = new Processor(this, mipsCapacity, numberOfPes);
this.description = "";
this.lastBusyTime = 0;
setId(id);
setBroker(DatacenterBroker.NULL);
setMips(mipsCapacity);
setNumberOfPes(numberOfPes);
setRam(new Ram(1024));
setBw(new Bandwidth(1000));
setStorage(new Storage(1024));
setSubmissionDelay(0);
setVmm("Xen");
stateHistory = new LinkedList<>();
this.onCreationFailureListeners = new HashSet<>();
this.onUpdateProcessingListeners = new HashSet<>();
this.setHorizontalScaling(HorizontalVmScaling.NULL);
this.setRamVerticalScaling(VerticalVmScaling.NULL);
this.setBwVerticalScaling(VerticalVmScaling.NULL);
this.setPeVerticalScaling(VerticalVmScaling.NULL);
origin: manoelcampos/cloudsim-plus

/**
 * Creates a list of VMs.
 */
private List<Vm> createVms() {
  final List<Vm> list = new ArrayList<>(VMS);
  for (int i = 0; i < VMS; i++) {
    //Uses a CloudletSchedulerTimeShared by default to schedule Cloudlets
    final Vm vm = new VmSimple(1000, VM_PES);
    vm.setRam(512).setBw(1000).setSize(10000);
    list.add(vm);
  }
  return list;
}
origin: manoelcampos/cloudsim-plus

@Override
public final Vm setRam(final long ramCapacity) {
  if(this.isCreated()){
    throw new UnsupportedOperationException("RAM capacity can just be changed when the Vm was not created inside a Host yet.");
  }
  setRam(new Ram(ramCapacity));
  return this;
}
origin: manoelcampos/cloudsim-plus

@Override
public double getCurrentRequestedTotalMips() {
  return getCurrentRequestedMipsStream().sum();
}
origin: manoelcampos/cloudsim-plus

private DoubleStream getCurrentRequestedMipsStream() {
  return getCurrentRequestedMips().stream().mapToDouble(mips -> mips);
}
origin: manoelcampos/cloudsim-plus

private CloudletToVmMappingSolution createInstance() {
  final CloudletToVmMappingSolution result = new CloudletToVmMappingSolution(heuristic);
  UtilizationModel um = UtilizationModel.NULL;
  IntStream.range(0, 100).forEach(i
      -> result.bindCloudletToVm(
          new CloudletSimple(i, 1, 1).setUtilizationModel(um),
          new VmSimple(i, 1000, 1))
  );
  return result;
}
origin: manoelcampos/cloudsim-plus

@Override
public double getCurrentRequestedMaxMips() {
  return getCurrentRequestedMipsStream().max().orElse(0.0);
}
origin: manoelcampos/cloudsim-plus

/**
 * Creates a list of VMs for the {@link #broker0}.
 */
private void createVms() {
  for (int v = 0; v < VMS; v++) {
    Vm vm =
      new VmSimple(v, VM_PE_MIPS, VM_PES)
        .setRam(VM_RAM).setBw(VM_BW).setSize(VM_SIZE)
        .setCloudletScheduler(new CloudletSchedulerTimeShared());
    vmList.add(vm);
  }
}
origin: manoelcampos/cloudsim-plus

private Vm createVm(final int id) {
  final int mips = 10000;
  final long size = 10000; // image size (Megabyte)
  final int ram = 4096;    // vm memory (Megabyte)
  final long bw = 1000;
  //It uses a CloudletSchedulerTimeShared by default
  final Vm vm = new VmSimple(id, mips, VM_PES_NUMBER);
  vm.setRam(ram).setBw(bw).setSize(size);
  return vm;
}
origin: manoelcampos/cloudsim-plus

@Override
public String toString() {
  final String desc = StringUtils.isBlank(description) ? "" : String.format(" (%s)", description);
  final String brokerName = getBroker() == DatacenterBroker.NULL ? "" : "/Broker " + getBroker().getId();
  return String.format("Vm %d%s%s", getId(), brokerName, desc);
}
origin: manoelcampos/cloudsim-plus

private Vm createVm(DatacenterBroker broker) {
  long   mips = 1000;
  long   storage = 10000; // vm image size (Megabyte)
  int    ram = 512; // vm memory (Megabyte)
  long   bw = 1000; // vm bandwidth (Megabits/s)
  int    pesNumber = 2; // number of CPU cores
  return new VmSimple(vmList.size(), mips, pesNumber)
      .setRam(ram)
      .setBw(bw)
      .setSize(storage)
      .setCloudletScheduler(new CloudletSchedulerTimeShared());
}
origin: manoelcampos/cloudsim-plus

public Vm createVm() {
  Vm vm = new VmSimple(vmList.size()+1, VM_MIPS, VM_PES);
  vm
    .setRam(VM_RAM).setBw(VM_BW).setSize(VM_SIZE)
    .setCloudletScheduler(new CloudletSchedulerTimeShared());
  return vm;
}
origin: manoelcampos/cloudsim-plus

/**
 * Creates a list of VMs.
 */
private List<Vm> createVms() {
  final List<Vm> list = new ArrayList<>(VMS);
  for (int i = 0; i < VMS; i++) {
    Vm vm =
      new VmSimple(i, 1000, VM_PES)
        .setRam(512).setBw(1000).setSize(10000)
        .setCloudletScheduler(new CloudletSchedulerTimeShared());
    list.add(vm);
  }
  return list;
}
origin: manoelcampos/cloudsim-plus

private Vm createVm() {
  final Vm vm = new VmSimple(vmList.size(), VM_MIPS, VM_PES_NUM);
  vm.setRam(VM_RAM).setBw(VM_BW).setSize(VM_SIZE)
   .setCloudletScheduler(new CloudletSchedulerTimeShared());
  return vm;
}
origin: manoelcampos/cloudsim-plus

/**
 * Creates a list of VMs.
 */
private List<Vm> createVms() {
  final List<Vm> list = new ArrayList<>(VMS);
  for (int i = 0; i < VMS; i++) {
    Vm vm =
      new VmSimple(i, VM_MIPS, VM_PES)
        .setRam(512).setBw(1000).setSize(10000)
        .setCloudletScheduler(new CloudletSchedulerTimeShared());
    list.add(vm);
  }
  return list;
}
org.cloudbus.cloudsim.vmsVmSimple

Javadoc

Implements the basic features of a Virtual Machine (VM) that runs inside a Host that may be shared among other VMs. It processes Cloudlet. This processing happens according to a policy, defined by the CloudletScheduler. Each VM has a owner (user), which can submit cloudlets to the VM to execute them.

Most used methods

  • <init>
    Creates a Vm with 1024 MEGA of RAM, 1000 Megabits/s of Bandwidth and 1024 MEGA of Storage Size. To c
  • setRam
    Sets a new Ram resource for the Vm.
  • addOnUpdateProcessingListener
  • getBroker
  • getCpuPercentUsage
  • getCurrentRequestedMips
  • getCurrentRequestedMipsStream
  • getId
  • getIdleInterval
  • getMips
  • getNumberOfPes
  • getResource
  • getNumberOfPes,
  • getResource,
  • getSimulation,
  • getTotalCpuMipsUsage,
  • getTotalMipsCapacity,
  • isCreated,
  • isFailed,
  • isIdle,
  • notifyOnUpdateProcessingListeners,
  • setBroker

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • getContentResolver (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Join (org.hibernate.mapping)
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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