VmBuilder

public class VmBuilder implements Builder

A Builder class to create Vm objects using the default values defined in Vm class.

Author:Manoel Campos da Silva Filho

See also: VmSimple.setDefaultRamCapacity(long), VmSimple.setDefaultBwCapacity(long), VmSimple.setDefaultStorageCapacity(long)

Constructors

VmBuilder

public VmBuilder(DatacenterBrokerSimple broker)

Methods

createAndSubmit

public VmBuilder createAndSubmit()

Creates and submits one VM to its broker.

createAndSubmit

public VmBuilder createAndSubmit(int amount)

Creates and submits a list of VM to its broker.

getMips

public double getMips()

getPes

public long getPes()

getVmById

public Vm getVmById(int id)

getVms

public List<Vm> getVms()

setCloudletSchedulerSupplier

public VmBuilder setCloudletSchedulerSupplier(Supplier<CloudletScheduler> cloudletSchedulerSupplier)

setMips

public VmBuilder setMips(double defaultMIPS)

setOnHostAllocationListener

public VmBuilder setOnHostAllocationListener(EventListener<VmHostEventInfo> listener)

setOnHostDeallocationListener

public VmBuilder setOnHostDeallocationListener(EventListener<VmHostEventInfo> listener)

setOnUpdateVmProcessingListener

public VmBuilder setOnUpdateVmProcessingListener(EventListener<VmHostEventInfo> listener)

setOnVmCreationFailureListener

public VmBuilder setOnVmCreationFailureListener(EventListener<VmDatacenterEventInfo> listener)

setPes

public VmBuilder setPes(long defaultPEs)

setVmCreationFunction

public VmBuilder setVmCreationFunction(BiFunction<Double, Long, Vm> vmCreationFunction)

Sets a BiFunction used to create VMs. It must receive the MIPS capacity of each Pe and the number of PEs for the VM it will create.

Parameters:
  • vmCreationFunction