public class DatacenterCharacteristics
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ADVANCE_RESERVATION
A resource that supports Advanced Reservation mechanisms.
|
static int |
OTHER_POLICY_DIFFERENT_RATING
Assuming all PEs in a Machine have the same rating.
|
static int |
OTHER_POLICY_SAME_RATING
Assuming all PEs in all Machines have the same rating.
|
static int |
SPACE_SHARED
Spaced-shared system using First Come First Serve (FCFS) algorithm.
|
static int |
TIME_SHARED
Time-shared system using Round-Robin algorithm.
|
| Constructor and Description |
|---|
DatacenterCharacteristics(java.lang.String architecture,
java.lang.String os,
java.lang.String vmm,
java.util.List<? extends Host> hostList,
double timeZone,
double costPerSec,
double costPerMem,
double costPerStorage,
double costPerBw)
Allocates a new DatacenterCharacteristics object.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
getAllocationPolicy()
Gets the allocation policy.
|
protected java.lang.String |
getArchitecture()
Gets the architecture.
|
double |
getCostPerBw()
Get the cost to use bandwidth in this resource.
|
double |
getCostPerMem()
Get the cost to use memory in this resource.
|
double |
getCostPerMi()
Gets the cost per Millions Instruction (MI) associated with a resource.
|
double |
getCostPerSecond()
Gets the cost per second.
|
double |
getCostPerStorage()
Get the cost to use storage in this resource.
|
double |
getCpuTime(double cloudletLength,
double load)
Gets the CPU time given the specified parameters (only for TIME_SHARED).
|
<T extends Host> |
getHostList()
Gets the host list.
|
Host |
getHostWithFreePe()
Gets a Machine with at least one empty Pe.
|
Host |
getHostWithFreePe(int peNumber)
Gets a Machine with at least a given number of free Pe.
|
int |
getId()
Gets the id.
|
int |
getMips()
Gets the total MIPS rating, which is the sum of MIPS rating of all machines in a resource.
|
int |
getMipsOfOnePe()
Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (Pe).
|
int |
getMipsOfOnePe(int id,
int peId)
Gets Millions Instructions Per Second (MIPS) Rating of a Processing Element (Pe).
|
int |
getNumberOfBusyPes()
Gets the total number of BUSY PEs for all Machines.
|
int |
getNumberOfFailedHosts()
Gets the current number of failed machines.
|
int |
getNumberOfFreePes()
Gets the total number of FREE or non-busy PEs for all Machines.
|
int |
getNumberOfHosts()
Gets the total number of machines.
|
int |
getNumberOfPes()
Gets the total number of PEs for all Machines.
|
protected java.lang.String |
getOs()
Gets the os.
|
java.lang.String |
getResourceName()
Gets the name of a resource.
|
protected double |
getTimeZone()
Gets the time zone.
|
java.lang.String |
getVmm()
Gets the VMM in use in the datacenter.
|
boolean |
isWorking()
Checks whether all machines of this resource are working properly or not.
|
protected void |
setAllocationPolicy(int allocationPolicy)
Sets the allocation policy.
|
protected void |
setArchitecture(java.lang.String architecture)
Sets the architecture.
|
void |
setCostPerBw(double costPerBw)
Sets cost to use bw cost to use bw.
|
void |
setCostPerMem(double costPerMem)
Sets cost to use memory.
|
protected void |
setCostPerSecond(double costPerSecond)
Sets the cost per second.
|
void |
setCostPerStorage(double costPerStorage)
Sets cost to use storage.
|
protected <T extends Host> |
setHostList(java.util.List<T> hostList)
Sets the host list.
|
protected void |
setId(int id)
Sets the id.
|
protected void |
setOs(java.lang.String os)
Sets the os.
|
boolean |
setPeStatus(int status,
int hostId,
int peId)
Sets the particular Pe status on a Machine.
|
protected void |
setTimeZone(double timeZone)
Sets the time zone.
|
protected void |
setVmm(java.lang.String vmm)
Sets the vmm.
|
public static final int TIME_SHARED
public static final int SPACE_SHARED
public static final int OTHER_POLICY_SAME_RATING
public static final int OTHER_POLICY_DIFFERENT_RATING
public static final int ADVANCE_RESERVATION
public DatacenterCharacteristics(java.lang.String architecture,
java.lang.String os,
java.lang.String vmm,
java.util.List<? extends Host> hostList,
double timeZone,
double costPerSec,
double costPerMem,
double costPerStorage,
double costPerBw)
architecture - the architecture of a resourceos - the operating system usedvmm - the virtual machine monitor usedhostList - list of machines in a resourcetimeZone - local time zone of a user that owns this reservation. Time zone should be of
range [GMT-12 ... GMT+13]costPerSec - the cost per sec to use this resourcecostPerMem - the cost to use memory in this resourcecostPerStorage - the cost to use storage in this resourcecostPerBw - the cost per bwpublic java.lang.String getResourceName()
public Host getHostWithFreePe()
public Host getHostWithFreePe(int peNumber)
peNumber - the pe numberpublic int getMipsOfOnePe()
public int getMipsOfOnePe(int id,
int peId)
id - the machine IDpeId - the Pe IDpublic int getMips()
Total MIPS rating for:
public double getCpuTime(double cloudletLength,
double load)
cloudletLength - the length of a Cloudletload - the load of a Cloudletpublic int getNumberOfPes()
public int getNumberOfFreePes()
public int getNumberOfBusyPes()
public boolean setPeStatus(int status,
int hostId,
int peId)
status - Pe status, either Pe.FREE or Pe.BUSYhostId - Machine IDpeId - Pe idpublic double getCostPerMi()
public int getNumberOfHosts()
public int getNumberOfFailedHosts()
public boolean isWorking()
public double getCostPerMem()
public void setCostPerMem(double costPerMem)
costPerMem - cost to use memorypublic double getCostPerStorage()
public void setCostPerStorage(double costPerStorage)
costPerStorage - cost to use storagepublic double getCostPerBw()
public void setCostPerBw(double costPerBw)
costPerBw - the cost per bwpublic java.lang.String getVmm()
public int getId()
protected void setId(int id)
id - the new idprotected java.lang.String getArchitecture()
protected void setArchitecture(java.lang.String architecture)
architecture - the new architectureprotected java.lang.String getOs()
protected void setOs(java.lang.String os)
os - the new ospublic <T extends Host> java.util.List<T> getHostList()
T - the generic typeprotected <T extends Host> void setHostList(java.util.List<T> hostList)
T - the generic typehostList - the new host listprotected double getTimeZone()
protected void setTimeZone(double timeZone)
timeZone - the new time zonepublic double getCostPerSecond()
protected void setCostPerSecond(double costPerSecond)
costPerSecond - the new cost per secondprotected int getAllocationPolicy()
protected void setAllocationPolicy(int allocationPolicy)
allocationPolicy - the new allocation policyprotected void setVmm(java.lang.String vmm)
vmm - the new vmm