Alps  2.0.2
Public Attributes | Private Attributes | List of all members
AlpsKnowledge Class Referenceabstract

The abstract base class of Alps knowledges generated during the search. More...

#include <AlpsKnowledge.h>

+ Inheritance diagram for AlpsKnowledge:
+ Collaboration diagram for AlpsKnowledge:

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...
 
AlpsKnowledgeBrokerbroker ()
 Get pointer to the knowledge broker. More...
 
const AlpsKnowledgeBrokerbroker () const
 Get pointer to the knowledge broker. More...
 
void setBroker (AlpsKnowledgeBroker *broker)
 Set knowledge broker. More...
 

Public Attributes

AlpsKnowledgeBrokerbroker_
 

Private Attributes

AlpsKnowledgeType type_
 

Encoding and Decoding functions

AlpsEncodedencode () 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 AlpsKnowledgedecode (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...
 
AlpsKnowledgeoperator= (AlpsKnowledge const &)
 Disable copy assignment operator. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AlpsKnowledge() [1/4]

AlpsKnowledge::AlpsKnowledge ( )
inline

Default constructor.

Definition at line 72 of file AlpsKnowledge.h.

◆ AlpsKnowledge() [2/4]

AlpsKnowledge::AlpsKnowledge ( AlpsKnowledgeType  type)
inline

Definition at line 73 of file AlpsKnowledge.h.

◆ AlpsKnowledge() [3/4]

AlpsKnowledge::AlpsKnowledge ( AlpsKnowledgeType  type,
AlpsKnowledgeBroker broker 
)

◆ ~AlpsKnowledge()

virtual AlpsKnowledge::~AlpsKnowledge ( )
inlinevirtual

Destructor.

Definition at line 76 of file AlpsKnowledge.h.

◆ AlpsKnowledge() [4/4]

AlpsKnowledge::AlpsKnowledge ( AlpsKnowledge const &  )
private

Disable copy constructor.

Member Function Documentation

◆ getType()

AlpsKnowledgeType AlpsKnowledge::getType ( ) const
inline

Get knowledge type.

Definition at line 82 of file AlpsKnowledge.h.

◆ setType()

void AlpsKnowledge::setType ( AlpsKnowledgeType  t)
inline

Set knowledge type.

Definition at line 84 of file AlpsKnowledge.h.

◆ broker() [1/2]

AlpsKnowledgeBroker* AlpsKnowledge::broker ( )
inline

Get pointer to the knowledge broker.

Definition at line 86 of file AlpsKnowledge.h.

◆ broker() [2/2]

const AlpsKnowledgeBroker* AlpsKnowledge::broker ( ) const
inline

Get pointer to the knowledge broker.

Definition at line 88 of file AlpsKnowledge.h.

◆ setBroker()

void AlpsKnowledge::setBroker ( AlpsKnowledgeBroker broker)
inline

Set knowledge broker.

Definition at line 90 of file AlpsKnowledge.h.

◆ encode() [1/2]

AlpsEncoded* AlpsKnowledge::encode ( ) const

Encode the content of this into an AlpsEncoded object and return a pointer to it.

◆ encode() [2/2]

virtual AlpsReturnStatus AlpsKnowledge::encode ( AlpsEncoded encoded) const
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.

◆ decode()

virtual AlpsKnowledge* AlpsKnowledge::decode ( AlpsEncoded encoded) const
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.

◆ decodeToSelf()

virtual AlpsReturnStatus AlpsKnowledge::decodeToSelf ( AlpsEncoded encoded)
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.

◆ operator=()

AlpsKnowledge& AlpsKnowledge::operator= ( AlpsKnowledge const &  )
private

Disable copy assignment operator.

Member Data Documentation

◆ type_

AlpsKnowledgeType AlpsKnowledge::type_
private

Definition at line 64 of file AlpsKnowledge.h.

◆ broker_

AlpsKnowledgeBroker* AlpsKnowledge::broker_

Definition at line 66 of file AlpsKnowledge.h.


The documentation for this class was generated from the following file: