Class DatacenterCharacteristicsSimple
- java.lang.Object
-
- org.cloudbus.cloudsim.datacenters.DatacenterCharacteristicsSimple
-
- All Implemented Interfaces:
Identifiable
,DatacenterCharacteristics
public class DatacenterCharacteristicsSimple extends Object implements DatacenterCharacteristics
Represents static properties of a Datacenter such as architecture, Operating System (OS), management policy (time- or space-shared), cost and time zone at which the resource is located along resource configuration. EachDatacenter
has to have its own instance of this class, since it stores the Datacenter host list.- Since:
- CloudSim Toolkit 1.0
- Author:
- Manzur Murshed, Rajkumar Buyya, Rodrigo N. Calheiros, Anton Beloglazov
-
-
Field Summary
-
Fields inherited from interface org.cloudbus.cloudsim.datacenters.DatacenterCharacteristics
DEFAULT_ARCH, DEFAULT_OS, DEFAULT_TIMEZONE, DEFAULT_VMM, NULL
-
-
Constructor Summary
Constructors Constructor Description DatacenterCharacteristicsSimple(Datacenter datacenter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getArchitecture()
Gets the architecture of the Datacenter.double
getCostPerBw()
Get the monetary cost to use each each Megabit of bandwidth in the Datacenter.double
getCostPerMem()
Get the monetary cost to use each Megabyte of RAM in the Datacenter.double
getCostPerSecond()
Gets the monetary cost per second of CPU for using the Hosts in the Datacenter.double
getCostPerStorage()
Get the monetary cost to use each Megabyte of storage in the Datacenter.Datacenter
getDatacenter()
Gets theDatacenter
that owns these characteristicslong
getId()
Gets the Datacenter id, setup when Datacenter is created.double
getMips()
Gets the total MIPS rating, which is the sum of MIPS rating of all Hosts in the Datacenter.long
getNumberOfFailedHosts()
Gets the current number of failed PMs.int
getNumberOfFreePes()
Gets the total number of FREE or non-busy PEs for all PMs.int
getNumberOfPes()
Gets the total number of PEs for all PMs.String
getOs()
Gets the Operating System (OS) used by the Hosts in the Datacenter.double
getTimeZone()
Gets the time zone, a value between [-12 and 13], in which the Datacenter is physically located.String
getVmm()
Gets the Virtual Machine Monitor (VMM), also called hypervisor, used in the Datacenter.boolean
isWorking()
Checks whether all PMs of the Datacenter are working properly or not.DatacenterCharacteristics
setArchitecture(String architecture)
Sets the architecture.DatacenterCharacteristics
setCostPerBw(double costPerBw)
Sets the monetary cost to use each Megabit of bandwidth.DatacenterCharacteristics
setCostPerMem(double costPerMem)
Sets the monetary cost to use each Megabyte of RAM in the Datacenter.DatacenterCharacteristics
setCostPerSecond(double costPerSecond)
Sets the monetary cost per second of CPU.DatacenterCharacteristics
setCostPerStorage(double costPerStorage)
Sets the monetary cost to use each Megabyte of storage.DatacenterCharacteristics
setOs(String os)
Sets the Operating System (OS).DatacenterCharacteristics
setTimeZone(double timeZone)
Sets the time zone.DatacenterCharacteristics
setVmm(String vmm)
Sets the vmm.
-
-
-
Constructor Detail
-
DatacenterCharacteristicsSimple
public DatacenterCharacteristicsSimple(Datacenter datacenter)
Creates a DatacenterCharacteristics with default values forarchitecture
,OS
,Time Zone
andVMM
. The costs forBW
,getCostPerMem()
() RAM} andgetCostPerStorage()
() Storage} are set to zero.- Precondition:
- machineList != null
- Postcondition:
- $none
-
-
Method Detail
-
getMips
public double getMips()
Description copied from interface:DatacenterCharacteristics
Gets the total MIPS rating, which is the sum of MIPS rating of all Hosts in the Datacenter.- Specified by:
getMips
in interfaceDatacenterCharacteristics
- Returns:
- the sum of MIPS ratings
-
getNumberOfPes
public int getNumberOfPes()
Description copied from interface:DatacenterCharacteristics
Gets the total number of PEs for all PMs.- Specified by:
getNumberOfPes
in interfaceDatacenterCharacteristics
- Returns:
- number of PEs
-
getNumberOfFreePes
public int getNumberOfFreePes()
Description copied from interface:DatacenterCharacteristics
Gets the total number of FREE or non-busy PEs for all PMs.- Specified by:
getNumberOfFreePes
in interfaceDatacenterCharacteristics
- Returns:
- number of PEs
-
getNumberOfFailedHosts
public long getNumberOfFailedHosts()
Description copied from interface:DatacenterCharacteristics
Gets the current number of failed PMs.- Specified by:
getNumberOfFailedHosts
in interfaceDatacenterCharacteristics
- Returns:
- current number of failed PMs the Datacenter has.
-
isWorking
public boolean isWorking()
Description copied from interface:DatacenterCharacteristics
Checks whether all PMs of the Datacenter are working properly or not.- Specified by:
isWorking
in interfaceDatacenterCharacteristics
- Returns:
- if all PMs are working, otherwise
-
getCostPerMem
public double getCostPerMem()
Description copied from interface:DatacenterCharacteristics
Get the monetary cost to use each Megabyte of RAM in the Datacenter.- Specified by:
getCostPerMem
in interfaceDatacenterCharacteristics
- Returns:
- the cost ($) to use RAM
-
setCostPerMem
public final DatacenterCharacteristics setCostPerMem(double costPerMem)
Description copied from interface:DatacenterCharacteristics
Sets the monetary cost to use each Megabyte of RAM in the Datacenter.- Specified by:
setCostPerMem
in interfaceDatacenterCharacteristics
- Parameters:
costPerMem
- cost ($) to use RAM
-
getCostPerStorage
public double getCostPerStorage()
Description copied from interface:DatacenterCharacteristics
Get the monetary cost to use each Megabyte of storage in the Datacenter.- Specified by:
getCostPerStorage
in interfaceDatacenterCharacteristics
- Returns:
- the cost ($) to use storage
-
setCostPerStorage
public final DatacenterCharacteristics setCostPerStorage(double costPerStorage)
Description copied from interface:DatacenterCharacteristics
Sets the monetary cost to use each Megabyte of storage.- Specified by:
setCostPerStorage
in interfaceDatacenterCharacteristics
- Parameters:
costPerStorage
- cost ($) to use storage
-
getCostPerBw
public double getCostPerBw()
Description copied from interface:DatacenterCharacteristics
Get the monetary cost to use each each Megabit of bandwidth in the Datacenter.- Specified by:
getCostPerBw
in interfaceDatacenterCharacteristics
- Returns:
- the cost ($) to use bw
-
setCostPerBw
public final DatacenterCharacteristics setCostPerBw(double costPerBw)
Description copied from interface:DatacenterCharacteristics
Sets the monetary cost to use each Megabit of bandwidth.- Specified by:
setCostPerBw
in interfaceDatacenterCharacteristics
- Parameters:
costPerBw
- the cost ($) to set
-
getVmm
public String getVmm()
Description copied from interface:DatacenterCharacteristics
Gets the Virtual Machine Monitor (VMM), also called hypervisor, used in the Datacenter.- Specified by:
getVmm
in interfaceDatacenterCharacteristics
- Returns:
- the VMM name
-
getId
public long getId()
Gets the Datacenter id, setup when Datacenter is created.- Specified by:
getId
in interfaceDatacenterCharacteristics
- Specified by:
getId
in interfaceIdentifiable
- Returns:
-
getArchitecture
public String getArchitecture()
Description copied from interface:DatacenterCharacteristics
Gets the architecture of the Datacenter.- Specified by:
getArchitecture
in interfaceDatacenterCharacteristics
- Returns:
- the architecture
-
setArchitecture
public final DatacenterCharacteristics setArchitecture(String architecture)
Description copied from interface:DatacenterCharacteristics
Sets the architecture.- Specified by:
setArchitecture
in interfaceDatacenterCharacteristics
- Parameters:
architecture
- the new architecture
-
getOs
public String getOs()
Description copied from interface:DatacenterCharacteristics
Gets the Operating System (OS) used by the Hosts in the Datacenter.- Specified by:
getOs
in interfaceDatacenterCharacteristics
- Returns:
- the Operating System (OS)
-
setOs
public final DatacenterCharacteristics setOs(String os)
Description copied from interface:DatacenterCharacteristics
Sets the Operating System (OS).- Specified by:
setOs
in interfaceDatacenterCharacteristics
- Parameters:
os
- the new Operating System (OS)
-
getTimeZone
public double getTimeZone()
Description copied from interface:DatacenterCharacteristics
Gets the time zone, a value between [-12 and 13], in which the Datacenter is physically located.- Specified by:
getTimeZone
in interfaceDatacenterCharacteristics
- Returns:
- the time zone
-
setTimeZone
public final DatacenterCharacteristics setTimeZone(double timeZone)
Description copied from interface:DatacenterCharacteristics
Sets the time zone. If an invalid value is given, the timezone is set to 0.- Specified by:
setTimeZone
in interfaceDatacenterCharacteristics
- Parameters:
timeZone
- the new time zone value, between [-12 and 13].
-
getCostPerSecond
public double getCostPerSecond()
Description copied from interface:DatacenterCharacteristics
Gets the monetary cost per second of CPU for using the Hosts in the Datacenter.- Specified by:
getCostPerSecond
in interfaceDatacenterCharacteristics
- Returns:
- the cost ($) per second
-
setCostPerSecond
public final DatacenterCharacteristics setCostPerSecond(double costPerSecond)
Description copied from interface:DatacenterCharacteristics
Sets the monetary cost per second of CPU.- Specified by:
setCostPerSecond
in interfaceDatacenterCharacteristics
- Parameters:
costPerSecond
- the new cost ($) per second
-
setVmm
public final DatacenterCharacteristics setVmm(String vmm)
Description copied from interface:DatacenterCharacteristics
Sets the vmm.- Specified by:
setVmm
in interfaceDatacenterCharacteristics
- Parameters:
vmm
- the new vmm
-
getDatacenter
public Datacenter getDatacenter()
Description copied from interface:DatacenterCharacteristics
Gets theDatacenter
that owns these characteristics- Specified by:
getDatacenter
in interfaceDatacenterCharacteristics
- Returns:
- the Datacenter
-
-