#include <GAP_Instance.h>
Public Member Functions | |
Access methods. | |
| const int | getNTasks () const |
| const int | getNMachines () const |
| const int * | getCapacity () const |
| const int * | getProfit () const |
| const int * | getWeight () const |
Helper Methods. | |
| void | readInstance (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 | |
| GAP_Instance () | |
| Default constructor. | |
| GAP_Instance (string &fileName) | |
| Default constructor. | |
| ~GAP_Instance () | |
| Default constructor. | |
Private Attributes | |
| int | m_nTasks |
| GAP_Instance problem instance data. | |
| int | m_nMachines |
| int * | m_capacity |
| int * | m_profit |
| int * | m_weight |
| bool | m_isProvenOptimal |
| GAP_Instance best known LB/UB. | |
| double | m_bestKnownLB |
| double | m_bestKnownUB |
A class to store an instance of the Generalized Assignment Problem (GAP).
Find the maximum profit assignment of n tasks to m machines such that each task is assinged to precisely one machine subject to capacity restrictions of the machine.
max sum{i in 1..m, j in 1..n} p[i,j] x[i,j] s.t. sum{ j in 1..n} w[i,j] x[i,j] <= b[i], i in 1..m sum{i in 1..m } x[i,j] = 1 , j in 1..n x[i,j] in {0,1}, i in 1..m, j in 1..n
x[i,j]=1 means assign task j to agent i
Note: DIP does min, so, we solve for min sum{ij} -p[i,j] x[i,j].
Definition at line 43 of file GAP_Instance.h.
| GAP_Instance::GAP_Instance | ( | ) | [inline] |
| GAP_Instance::GAP_Instance | ( | string & | fileName | ) | [inline] |
Default constructor.
Takes an instance of UtilParameters
Definition at line 119 of file GAP_Instance.h.
References initMembers(), and readInstance().
| GAP_Instance::~GAP_Instance | ( | ) | [inline] |
Default constructor.
Definition at line 124 of file GAP_Instance.h.
References m_capacity, m_profit, m_weight, and UTIL_DELARR.
| const int GAP_Instance::getNTasks | ( | ) | const [inline] |
Definition at line 61 of file GAP_Instance.h.
References m_nTasks.
Referenced by GAP_DecompApp::getIndexIJ(), GAP_DecompApp::getIndexInv(), and GAP_DecompApp::getOffsetI().
| const int GAP_Instance::getNMachines | ( | ) | const [inline] |
Definition at line 64 of file GAP_Instance.h.
References m_nMachines.
| const int* GAP_Instance::getCapacity | ( | ) | const [inline] |
Definition at line 67 of file GAP_Instance.h.
References m_capacity.
| const int* GAP_Instance::getProfit | ( | ) | const [inline] |
Definition at line 70 of file GAP_Instance.h.
References m_profit.
| const int* GAP_Instance::getWeight | ( | ) | const [inline] |
Definition at line 73 of file GAP_Instance.h.
References m_weight.
| void GAP_Instance::readInstance | ( | string & | filename | ) |
Referenced by GAP_Instance().
| void GAP_Instance::readBestKnown | ( | string & | fileName, | |
| string & | instanceName | |||
| ) |
| void GAP_Instance::initMembers | ( | ) | [inline] |
Definition at line 83 of file GAP_Instance.h.
References m_bestKnownLB, m_bestKnownUB, m_capacity, m_isProvenOptimal, m_nMachines, m_nTasks, m_profit, and m_weight.
Referenced by GAP_Instance().
| const int GAP_Instance::getIndexIJ | ( | const int | i, | |
| const int | j | |||
| ) | const [inline] |
Definition at line 94 of file GAP_Instance.h.
References m_nTasks.
| pair<int, int> GAP_Instance::getIndexInv | ( | const int | index | ) | const [inline] |
Definition at line 99 of file GAP_Instance.h.
References m_nTasks.
| const double GAP_Instance::getBestKnownLB | ( | ) | const [inline] |
Definition at line 103 of file GAP_Instance.h.
References m_bestKnownLB.
| const double GAP_Instance::getBestKnownUB | ( | ) | const [inline] |
Definition at line 106 of file GAP_Instance.h.
References m_bestKnownUB.
int GAP_Instance::m_nTasks [private] |
GAP_Instance problem instance data.
Definition at line 47 of file GAP_Instance.h.
Referenced by getIndexIJ(), getIndexInv(), getNTasks(), and initMembers().
int GAP_Instance::m_nMachines [private] |
Definition at line 48 of file GAP_Instance.h.
Referenced by getNMachines(), and initMembers().
int* GAP_Instance::m_capacity [private] |
Definition at line 49 of file GAP_Instance.h.
Referenced by getCapacity(), initMembers(), and ~GAP_Instance().
int* GAP_Instance::m_profit [private] |
Definition at line 50 of file GAP_Instance.h.
Referenced by getProfit(), initMembers(), and ~GAP_Instance().
int* GAP_Instance::m_weight [private] |
Definition at line 51 of file GAP_Instance.h.
Referenced by getWeight(), initMembers(), and ~GAP_Instance().
bool GAP_Instance::m_isProvenOptimal [private] |
GAP_Instance best known LB/UB.
Definition at line 54 of file GAP_Instance.h.
Referenced by initMembers().
double GAP_Instance::m_bestKnownLB [private] |
Definition at line 55 of file GAP_Instance.h.
Referenced by getBestKnownLB(), and initMembers().
double GAP_Instance::m_bestKnownUB [private] |
Definition at line 56 of file GAP_Instance.h.
Referenced by getBestKnownUB(), and initMembers().
1.6.1