#include <linearpmodel.h>
Definition at line 13 of file linearpmodel.h.
LinearPModel::LinearPModel |
( |
| ) |
|
LinearPModel::~LinearPModel |
( |
| ) |
|
|
virtual |
void LinearPModel::addComponent |
( |
DcResource * |
component | ) |
|
|
virtual |
int LinearPModel::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
virtual |
Reimplemented from PowerModel.
Definition at line 128 of file linearpmodel.cc.
132 if (strcmp(argv[1],
"print") == 0) {
138 if (strcmp(argv[1],
"set-name") == 0) {
141 }
else if (strcmp(argv[1],
"set-coef-number") == 0) {
148 else if (argc == 4) {
149 if (strcmp(argv[1],
"set-coefficient") == 0) {
152 }
else if (strcmp(argv[1],
"set-coefficient-numeric") == 0) {
void setCoefficientNumeric(const char *coef, double value)
void setCoefficient(const char *coef, double value)
void setName(const char *name)
void setCoefNumber(int number)
double LinearPModel::estimate |
( |
int |
size, |
|
|
double * |
predictors |
|
) |
| |
|
virtual |
Implements PowerModel.
Definition at line 57 of file linearpmodel.cc.
60 std::cerr <<
"Incorrect size of predictors array!\n";
63 for(
int i = 0; i < size; i++){
68 std::cerr <<
"The model is not correctly initalized.\n" ;
70 std::cerr <<
"Aborting simulation";
double LinearPModel::getMaxPower |
( |
| ) |
|
|
virtual |
void LinearPModel::print |
( |
| ) |
|
|
virtual |
Reimplemented from PowerModel.
Definition at line 85 of file linearpmodel.cc.
86 std::cout <<
"Linear model: "<<
name_ <<
"\n";
88 std::cout <<
"Coefficients:\n";
93 std::cout <<
"Model not initalized properly\n";
void LinearPModel::setCoefficient |
( |
const char * |
coef, |
|
|
double |
value |
|
) |
| |
|
private |
Definition at line 97 of file linearpmodel.cc.
98 if(strcmp(coef,
"Intercept") != 0){
static res_type translateType(const char *t)
void LinearPModel::setCoefficientNumeric |
( |
const char * |
coef, |
|
|
double |
value |
|
) |
| |
|
private |
void LinearPModel::setCoefNumber |
( |
int |
number | ) |
|
|
private |
void LinearPModel::updateInit |
( |
| ) |
|
|
private |
int LinearPModel::coef_number |
|
private |
double* LinearPModel::coefficients |
|
private |
Slopes as the resource types. The last element is the intercept
Definition at line 23 of file linearpmodel.h.
bool* LinearPModel::initialized |
|
private |
Model initialized and ready for usage
Definition at line 25 of file linearpmodel.h.
The documentation for this class was generated from the following files: