Alps
2.0.2
|
#include <KnapSolution.h>
Public Member Functions | |
KnapSolution (KnapModel *model) | |
KnapSolution (KnapModel *model, int s, int *&sol, int v) | |
virtual | ~KnapSolution () |
double | getObjValue () const |
Get the best solution value. More... | |
virtual double | getQuality () const |
int | getSize () const |
Get the size of the solution. More... | |
int | getSolution (int i) const |
Get item i in the solution vector. More... | |
virtual void | print (std::ostream &os) const |
Print out the solution. More... | |
virtual AlpsReturnStatus | encode (AlpsEncoded *encoded) const |
Encode this into the given AlpsEncoded object. More... | |
virtual AlpsReturnStatus | decodeToSelf (AlpsEncoded &encoded) |
Decode the given AlpsEncoded object into this. More... | |
virtual AlpsKnowledge * | decode (AlpsEncoded &encoded) const |
Decode the given AlpsEncoded object into a new KnapSolution and return a pointer to it. More... | |
virtual AlpsReturnStatus | encode (AlpsEncoded *encoded) const |
Encode this into the given AlpsEncoded object. More... | |
Public Member Functions inherited from AlpsSolution | |
AlpsSolution () | |
Default constructor. More... | |
AlpsSolution (const AlpsNodeIndex_t i, const int d) | |
Constructor to set index and depth. More... | |
virtual | ~AlpsSolution () |
Destructor. More... | |
AlpsNodeIndex_t | getIndex () |
Get index where solution was found. More... | |
void | setIndex (const AlpsNodeIndex_t i) |
Set index where solution was found. More... | |
int | getDepth () |
Get depth where solution was found. More... | |
void | setDepth (const int d) |
Set depth where solution was found. More... | |
AlpsEncoded * | encode () const |
Get encode defined in AlpsKnowledge. More... | |
virtual AlpsReturnStatus | encode (AlpsEncoded *encoded) const |
Get encode defined in AlpsKnowledge. More... | |
Public Member Functions inherited from AlpsKnowledge | |
AlpsKnowledge () | |
Default constructor. More... | |
AlpsKnowledge (AlpsKnowledgeType type) | |
AlpsKnowledge (AlpsKnowledgeType type, AlpsKnowledgeBroker *broker) | |
virtual | ~AlpsKnowledge () |
Destructor. More... | |
AlpsKnowledgeType | getType () const |
Get knowledge type. More... | |
void | setType (AlpsKnowledgeType t) |
Set knowledge type. More... | |
AlpsKnowledgeBroker * | broker () |
Get pointer to the knowledge broker. More... | |
const AlpsKnowledgeBroker * | broker () const |
Get pointer to the knowledge broker. More... | |
void | setBroker (AlpsKnowledgeBroker *broker) |
Set knowledge broker. More... | |
AlpsEncoded * | encode () const |
Encode the content of this into an AlpsEncoded object and return a pointer to it. More... | |
Private Member Functions | |
KnapSolution (KnapSolution const &other) | |
Disable copy constructor. More... | |
KnapSolution & | operator= (KnapSolution const &rhs) |
Disable copy assignment operator. More... | |
Private Attributes | |
KnapModel * | model_ |
int | size_ |
The solution (indicator vector for the items) and its value. More... | |
int * | solution_ |
int | value_ |
Additional Inherited Members | |
Public Attributes inherited from AlpsKnowledge | |
AlpsKnowledgeBroker * | broker_ |
Definition at line 32 of file KnapSolution.h.
KnapSolution::KnapSolution | ( | KnapModel * | model | ) |
KnapSolution::KnapSolution | ( | KnapModel * | model, |
int | s, | ||
int *& | sol, | ||
int | v | ||
) |
|
virtual |
|
private |
Disable copy constructor.
|
inline |
Get the best solution value.
Definition at line 45 of file KnapSolution.h.
|
inlinevirtual |
Definition at line 47 of file KnapSolution.h.
|
inline |
Get the size of the solution.
Definition at line 50 of file KnapSolution.h.
|
inline |
Get item i in the solution vector.
Definition at line 53 of file KnapSolution.h.
|
virtual |
Print out the solution.
Reimplemented from AlpsSolution.
|
virtual |
Encode this into the given AlpsEncoded object.
Reimplemented from AlpsSolution.
|
inlinevirtual |
Decode the given AlpsEncoded object into this.
Reimplemented from AlpsSolution.
Definition at line 62 of file KnapSolution.h.
|
virtual |
Decode the given AlpsEncoded object into a new KnapSolution and return a pointer to it.
Implements AlpsKnowledge.
|
private |
Disable copy assignment operator.
|
inline |
Encode this into the given AlpsEncoded object.
Definition at line 88 of file AlpsSolution.h.
|
private |
Definition at line 33 of file KnapSolution.h.
|
private |
The solution (indicator vector for the items) and its value.
Definition at line 35 of file KnapSolution.h.
|
private |
Definition at line 36 of file KnapSolution.h.
|
private |
Definition at line 37 of file KnapSolution.h.