Package org.cloudbus.cloudsim.brokers
Class DatacenterBrokerBestFit
java.lang.Object
org.cloudbus.cloudsim.core.CloudSimEntity
org.cloudbus.cloudsim.brokers.DatacenterBrokerAbstract
org.cloudbus.cloudsim.brokers.DatacenterBrokerSimple
org.cloudbus.cloudsim.brokers.DatacenterBrokerBestFit
- All Implemented Interfaces:
Cloneable
,Comparable<SimEntity>
,Runnable
,DatacenterBroker
,Identifiable
,Nameable
,SimEntity
A implementation of
DatacenterBroker
that uses a Best Fit
mapping between submitted cloudlets and Vm's, trying to place a Cloudlet
at the best suitable Vm which can be found (according to the required Cloudlet's PEs).
The Broker then places the submitted Vm's at the first Datacenter found.
If there isn't capacity in that one, it will try the other ones.- Since:
- CloudSim Plus 4.3.8
- Author:
- Manoel Campos da Silva Filho
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cloudbus.cloudsim.core.SimEntity
SimEntity.State
-
Field Summary
Fields inherited from interface org.cloudbus.cloudsim.brokers.DatacenterBroker
DEF_VM_DESTRUCTION_DELAY, LOGGER, NULL
-
Constructor Summary
ConstructorDescriptionDatacenterBrokerBestFit
(CloudSim simulation) Creates a DatacenterBroker object. -
Method Summary
Modifier and TypeMethodDescriptiondefaultVmMapper
(Cloudlet cloudlet) Selects the VM with the lowest number of PEs that is able to run a given Cloudlet.Methods inherited from class org.cloudbus.cloudsim.brokers.DatacenterBrokerSimple
defaultDatacenterMapper
Methods inherited from class org.cloudbus.cloudsim.brokers.DatacenterBrokerAbstract
addOnVmsCreatedListener, bindCloudletToVm, closestDatacenterMapper, destroyVm, getCloudletCreatedList, getCloudletFinishedList, getCloudletSubmittedList, getCloudletWaitingList, getDatacenter, getDatacenterList, getFailedVmsRetryDelay, getVmCreatedList, getVmCreationRequests, getVmDestructionDelayFunction, getVmExecList, getVmFailedList, getVmFromCreatedList, getVmsNumber, getVmWaitingList, getWaitingVm, isRetryFailedVms, isSelectClosestDatacenter, isShutdownWhenIdle, processEvent, removeOnVmsCreatedListener, requestDatacentersToCreateWaitingCloudlets, requestIdleVmDestruction, requestShutdownWhenIdle, setCloudletComparator, setDatacenterMapper, setFailedVmsRetryDelay, setSelectClosestDatacenter, setShutdownWhenIdle, setVmComparator, setVmDestructionDelay, setVmDestructionDelayFunction, setVmMapper, shutdown, startInternal, submitCloudlet, submitCloudletList, submitCloudletList, submitCloudletList, submitCloudletList, submitVm, submitVmList, submitVmList, toString
Methods inherited from class org.cloudbus.cloudsim.core.CloudSimEntity
cancelEvent, clone, compareTo, equals, getId, getName, getNextEvent, getNextEvent, getShutdownTime, getSimulation, getStartTime, getState, hashCode, isAlive, isFinished, isStarted, pause, run, run, schedule, schedule, schedule, schedule, schedule, schedule, scheduleFirst, scheduleFirst, scheduleFirstNow, scheduleFirstNow, scheduleNow, scheduleNow, selectEvent, send, send, sendNow, sendNow, setEventBuffer, setId, setName, setSimulation, setState, start, waitForEvent
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.cloudbus.cloudsim.core.Identifiable
getId
Methods inherited from interface org.cloudbus.cloudsim.core.SimEntity
getShutdownTime, getSimulation, getStartTime, getState, isAlive, isFinished, isStarted, run, schedule, schedule, schedule, schedule, schedule, schedule, schedule, setName, setSimulation, setState, start
-
Constructor Details
-
DatacenterBrokerBestFit
Creates a DatacenterBroker object.- Parameters:
simulation
- The CloudSim instance that represents the simulation the Entity is related to
-
-
Method Details
-
defaultVmMapper
Selects the VM with the lowest number of PEs that is able to run a given Cloudlet. In case the algorithm can't find such a VM, it uses the default DatacenterBroker VM mapper as a fallback.- Overrides:
defaultVmMapper
in classDatacenterBrokerSimple
- Parameters:
cloudlet
- the Cloudlet to find a VM to run it- Returns:
- the VM selected for the Cloudlet or
Vm.NULL
if no suitable VM was found - See Also:
-