Alps
2.0.2
|
The abstract base class of Alps knowledges generated during the search. More...
#include <AlpsKnowledge.h>
Public Member Functions | |
Constructor and Destructor | |
AlpsKnowledge () | |
Default constructor. More... | |
AlpsKnowledge (AlpsKnowledgeType type) | |
AlpsKnowledge (AlpsKnowledgeType type, AlpsKnowledgeBroker *broker) | |
virtual | ~AlpsKnowledge () |
Destructor. More... | |
Get type and set type functions | |
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... | |
Public Attributes | |
AlpsKnowledgeBroker * | broker_ |
Private Attributes | |
AlpsKnowledgeType | type_ |
Encoding and Decoding functions | |
AlpsEncoded * | encode () const |
Encode the content of this into an AlpsEncoded object and return a pointer to it. More... | |
virtual AlpsReturnStatus | encode (AlpsEncoded *encoded) const |
Encode the content of this into the given AlpsEncoded object. More... | |
virtual AlpsKnowledge * | decode (AlpsEncoded &encoded) const =0 |
Decode the given AlpsEncoded object into a new AlpsKnowledge object and return a pointer to it. More... | |
virtual AlpsReturnStatus | decodeToSelf (AlpsEncoded &encoded) |
Decode the given AlpsEncoded object into this. More... | |
AlpsKnowledge (AlpsKnowledge const &) | |
Disable copy constructor. More... | |
AlpsKnowledge & | operator= (AlpsKnowledge const &) |
Disable copy assignment operator. More... | |
The abstract base class of Alps knowledges generated during the search.
It is inherited by AlpsModel, AlpsTreeNode, AlpsSolution and AlpsSubTree.
It provides the API for encoding and decoding functions. ::encode/::decode functions implemented here will work on simple classes (stored in contigious memory), that does not have pointers or STL containers. Complicated classes are required to implement their versions of encode/decode functions.
Definition at line 63 of file AlpsKnowledge.h.
|
inline |
Default constructor.
Definition at line 72 of file AlpsKnowledge.h.
|
inline |
Definition at line 73 of file AlpsKnowledge.h.
AlpsKnowledge::AlpsKnowledge | ( | AlpsKnowledgeType | type, |
AlpsKnowledgeBroker * | broker | ||
) |
|
inlinevirtual |
Destructor.
Definition at line 76 of file AlpsKnowledge.h.
|
private |
Disable copy constructor.
|
inline |
Get knowledge type.
Definition at line 82 of file AlpsKnowledge.h.
|
inline |
Set knowledge type.
Definition at line 84 of file AlpsKnowledge.h.
|
inline |
Get pointer to the knowledge broker.
Definition at line 86 of file AlpsKnowledge.h.
|
inline |
Get pointer to the knowledge broker.
Definition at line 88 of file AlpsKnowledge.h.
|
inline |
Set knowledge broker.
Definition at line 90 of file AlpsKnowledge.h.
AlpsEncoded* AlpsKnowledge::encode | ( | ) | const |
Encode the content of this into an AlpsEncoded object and return a pointer to it.
|
virtual |
Encode the content of this into the given AlpsEncoded object.
Implementation given in this class can not be used when the memory of data members is not contiguous, i.e., some data members are pointers to heap locations, STL set, map, etc. These type of user application sub-classes should implement their own version of this.
Reimplemented in AbcModel, AbcModel, AbcModel, AlpsSubTree, AlpsModel, AbcNodeDesc, AbcNodeDesc, AbcNodeDesc, AbcTreeNode, AbcTreeNode, AbcTreeNode, KnapModel, AbcSolution, AbcSolution, AbcSolution, AlpsSolution, KnapNodeDesc, KnapTreeNode, AlpsNodeDesc, and KnapSolution.
|
pure virtual |
Decode the given AlpsEncoded object into a new AlpsKnowledge object and return a pointer to it.
User application sub-classes should implement this since the returned pointer will point to user sub-class instances.
Implemented in AbcModel, AbcModel, AbcModel, AlpsSubTree, AbcNodeDesc, AbcNodeDesc, AbcNodeDesc, AbcTreeNode, AbcTreeNode, AbcTreeNode, KnapModel, KnapNodeDesc, KnapSolution, KnapTreeNode, AbcSolution, AbcSolution, and AbcSolution.
|
virtual |
Decode the given AlpsEncoded object into this.
Implementation given in this class can not be used when the memory of data members is not contiguous, i.e., some data members are pointers to heap locations, STL set, map, etc. These type of user application sub-classes should implement their own version of this.
Reimplemented in AbcModel, AbcModel, AbcModel, AlpsSubTree, AlpsModel, AbcNodeDesc, AbcNodeDesc, AbcNodeDesc, AbcTreeNode, AbcTreeNode, AbcTreeNode, KnapModel, AbcSolution, AbcSolution, AbcSolution, AlpsSolution, KnapNodeDesc, AlpsNodeDesc, KnapTreeNode, and KnapSolution.
|
private |
Disable copy assignment operator.
|
private |
Definition at line 64 of file AlpsKnowledge.h.
AlpsKnowledgeBroker* AlpsKnowledge::broker_ |
Definition at line 66 of file AlpsKnowledge.h.