GreenCloud Simulator
Public Member Functions | Public Attributes | List of all members
ResDemand Class Reference

#include <resdemand.h>

Inheritance diagram for ResDemand:
Inheritance graph
[legend]
Collaboration diagram for ResDemand:
Collaboration graph
[legend]

Public Member Functions

 ResDemand (Resource &res)
 
 ResDemand (Resource &res, DcResource *svr)
 
- Public Member Functions inherited from Resource
 Resource (res_type t, double a, std::vector< Capacity > cap)
 
void print ()
 
virtual ~Resource ()
 
res_type getType ()
 
double getArch ()
 

Public Attributes

std::vector< Capacity * > capacity_location
 
std::vector< double > current_performance
 
DcResourcesupported_virtual_resource
 
- Public Attributes inherited from Resource
std::vector< Capacitycapacity
 

Additional Inherited Members

- Static Public Member Functions inherited from Resource
static res_type translateType (const char *t)
 
- Protected Member Functions inherited from Resource
 Resource ()
 
Resourceoperator= (const Resource &r)
 
int setType (const char *t)
 
int setCapacity (std::vector< Capacity > cap)
 
void sortCapacity ()
 
- Protected Attributes inherited from Resource
res_type type
 
double arch
 

Detailed Description

Used to represent the status of execution. (Where, how fast, and how much left )

Definition at line 18 of file resdemand.h.

Constructor & Destructor Documentation

ResDemand::ResDemand ( Resource res)

Definition at line 11 of file resdemand.cc.

11  : Resource( res){
12  capacity_location = std::vector <Capacity *>(res.capacity.size(),NULL) ;
13  current_performance = std::vector <double>(res.capacity.size(),0);
15 
16 }
Resource()
Definition: resource.cc:70
std::vector< Capacity > capacity
Definition: resource.h:87
DcResource * supported_virtual_resource
Definition: resdemand.h:28
std::vector< double > current_performance
Definition: resdemand.h:23
std::vector< Capacity * > capacity_location
Definition: resdemand.h:21
ResDemand::ResDemand ( Resource res,
DcResource svr 
)

Definition at line 18 of file resdemand.cc.

18  : Resource( res){
19  capacity_location = std::vector <Capacity *>(res.capacity.size(),NULL) ;
20  current_performance = std::vector <double>(res.capacity.size(),0);
21  if(svr != NULL){
22  std::vector<Capacity>::iterator i_res;
23  std::vector<Capacity>::iterator i_dem;
24  for(i_res = svr->capacity.begin(), i_dem = this->capacity.begin();
25  i_res != svr->capacity.end();
26  i_res++, i_dem++){
27  i_dem->virtual_capacities.push_back(&(*i_res));
28  }
29  }
31 }
Resource()
Definition: resource.cc:70
std::vector< Capacity > capacity
Definition: resource.h:87
DcResource * supported_virtual_resource
Definition: resdemand.h:28
std::vector< double > current_performance
Definition: resdemand.h:23
std::vector< Capacity * > capacity_location
Definition: resdemand.h:21

Member Data Documentation

std::vector<Capacity *> ResDemand::capacity_location

Currently used capacities for "static" resources (other than CPU and Networking)

Definition at line 21 of file resdemand.h.

std::vector<double> ResDemand::current_performance

Current allocation (i.e. processing rate) rate for each of the resources

Definition at line 23 of file resdemand.h.

DcResource* ResDemand::supported_virtual_resource

Definition at line 28 of file resdemand.h.


The documentation for this class was generated from the following files: