71 virtual void print(std::ostream& os)
const;
This data structure is to contain the packed form of an encodable knowledge.
The abstract base class of any user-defined class that Alps has to know about in order to encode/deco...
virtual void print(std::ostream &os) const
Print out the solution.
virtual double getQuality() const
const KnapModel * model_
To access model data.
virtual AlpsKnowledge * decode(AlpsEncoded &) const
The method that decodes the node from a encoded object.
int getSolution(int i) const
Get item i in the solution vector.
virtual AlpsEncoded * encode() const
The method that encodes the node into a encoded object.
int getSize() const
Get the size of the solution.
KnapSolution(int s, int *&sol, int v, const KnapModel *m)
double getObjValue() const
Get the best solution value.
int size_
The solution (indicator vector for the items) and its value.
const KnapModel * getModel() const
Get model data.
KnapSolution(const KnapModel *m)