#include <MMKP_Instance.h>
Public Member Functions | |
Access methods. | |
| const int | getNKnapRows () const |
| const int | getNGroupRows () const |
| const int | getNGroupCols () const |
| const double * | getCapacity () const |
| const double * | getValue () const |
| const double *const * | getWeight () const |
Helper Methods. | |
| void | readInstance (string &fileName, string &dataFormat) |
| void | readInstanceSimon (string &fileName) |
| void | readBestKnown (string &fileName, string &instanceName) |
| void | initMembers () |
| const int | getIndexIJ (const int i, const int j) const |
| pair< int, int > | getIndexInv (const int index) const |
| const double | getBestKnownLB () const |
| const double | getBestKnownUB () const |
Constructor and Destructor | |
| MMKP_Instance () | |
| Default constructor. | |
| MMKP_Instance (string &fileName) | |
| Default constructor. | |
| ~MMKP_Instance () | |
| Default destructor. | |
Private Attributes | |
| int | m_nKnapRows |
| MMKP_Instance problem instance data. | |
| int | m_nGroupRows |
| int | m_nGroupCols |
| double * | m_capacity |
| double * | m_value |
| double ** | m_weight |
| bool | m_isProvenOptimal |
| MMKP_Instance best known LB/UB. | |
| double | m_bestKnownLB |
| double | m_bestKnownUB |
A class to store an instance of the Multi-Dimensional Mulit-Choice Knapsack Problem (MMKP).
max sum{i in 1..n, j in 1..l[i]} v[i,j] x[i,j] s.t. sum{i in 1..n, j in 1..l[i]} r[k,i,j] x[i,j] <= b[k], k in 1..m sum{j in 1..l[i]} x[i,j] = 1 , i in 1..n x[i,j] in {0,1}, i in 1..n, j in 1..l[i]
Definition at line 37 of file MMKP_Instance.h.
| MMKP_Instance::MMKP_Instance | ( | ) | [inline] |
| MMKP_Instance::MMKP_Instance | ( | string & | fileName | ) | [inline] |
Default constructor.
Takes an instance of UtilParameters
Definition at line 103 of file MMKP_Instance.h.
References initMembers(), and readInstance().
| MMKP_Instance::~MMKP_Instance | ( | ) | [inline] |
Default destructor.
Definition at line 110 of file MMKP_Instance.h.
References m_capacity, m_nKnapRows, m_value, m_weight, and UTIL_DELARR.
| const int MMKP_Instance::getNKnapRows | ( | ) | const [inline] |
Definition at line 55 of file MMKP_Instance.h.
References m_nKnapRows.
| const int MMKP_Instance::getNGroupRows | ( | ) | const [inline] |
Definition at line 56 of file MMKP_Instance.h.
References m_nGroupRows.
| const int MMKP_Instance::getNGroupCols | ( | ) | const [inline] |
Definition at line 57 of file MMKP_Instance.h.
References m_nGroupCols.
| const double* MMKP_Instance::getCapacity | ( | ) | const [inline] |
Definition at line 58 of file MMKP_Instance.h.
References m_capacity.
| const double* MMKP_Instance::getValue | ( | ) | const [inline] |
Definition at line 59 of file MMKP_Instance.h.
References m_value.
| const double* const* MMKP_Instance::getWeight | ( | ) | const [inline] |
Definition at line 60 of file MMKP_Instance.h.
References m_weight.
| void MMKP_Instance::readInstance | ( | string & | fileName, | |
| string & | dataFormat | |||
| ) |
Referenced by MMKP_Instance().
| void MMKP_Instance::readInstanceSimon | ( | string & | fileName | ) |
| void MMKP_Instance::readBestKnown | ( | string & | fileName, | |
| string & | instanceName | |||
| ) |
| void MMKP_Instance::initMembers | ( | ) | [inline] |
Definition at line 70 of file MMKP_Instance.h.
References m_bestKnownLB, m_bestKnownUB, m_capacity, m_isProvenOptimal, m_nGroupCols, m_nGroupRows, m_nKnapRows, m_value, and m_weight.
Referenced by MMKP_Instance().
| const int MMKP_Instance::getIndexIJ | ( | const int | i, | |
| const int | j | |||
| ) | const [inline] |
Definition at line 82 of file MMKP_Instance.h.
References m_nGroupCols.
| pair<int,int> MMKP_Instance::getIndexInv | ( | const int | index | ) | const [inline] |
Definition at line 87 of file MMKP_Instance.h.
References m_nGroupCols.
| const double MMKP_Instance::getBestKnownLB | ( | ) | const [inline] |
Definition at line 91 of file MMKP_Instance.h.
References m_bestKnownLB.
| const double MMKP_Instance::getBestKnownUB | ( | ) | const [inline] |
Definition at line 92 of file MMKP_Instance.h.
References m_bestKnownUB.
int MMKP_Instance::m_nKnapRows [private] |
MMKP_Instance problem instance data.
Definition at line 40 of file MMKP_Instance.h.
Referenced by getNKnapRows(), initMembers(), and ~MMKP_Instance().
int MMKP_Instance::m_nGroupRows [private] |
Definition at line 41 of file MMKP_Instance.h.
Referenced by getNGroupRows(), and initMembers().
int MMKP_Instance::m_nGroupCols [private] |
Definition at line 42 of file MMKP_Instance.h.
Referenced by getIndexIJ(), getIndexInv(), getNGroupCols(), and initMembers().
double* MMKP_Instance::m_capacity [private] |
Definition at line 43 of file MMKP_Instance.h.
Referenced by getCapacity(), initMembers(), and ~MMKP_Instance().
double* MMKP_Instance::m_value [private] |
Definition at line 44 of file MMKP_Instance.h.
Referenced by getValue(), initMembers(), and ~MMKP_Instance().
double** MMKP_Instance::m_weight [private] |
Definition at line 45 of file MMKP_Instance.h.
Referenced by getWeight(), initMembers(), and ~MMKP_Instance().
bool MMKP_Instance::m_isProvenOptimal [private] |
MMKP_Instance best known LB/UB.
Definition at line 48 of file MMKP_Instance.h.
Referenced by initMembers().
double MMKP_Instance::m_bestKnownLB [private] |
Definition at line 49 of file MMKP_Instance.h.
Referenced by getBestKnownLB(), and initMembers().
double MMKP_Instance::m_bestKnownUB [private] |
Definition at line 50 of file MMKP_Instance.h.
Referenced by getBestKnownUB(), and initMembers().
1.6.1