Alps  2.0.2
Public Member Functions | Private Attributes | List of all members
KnapNodeDesc Class Reference

Here, we need to fill in what the node description will look like. More...

#include <KnapNodeDesc.h>

+ Inheritance diagram for KnapNodeDesc:
+ Collaboration diagram for KnapNodeDesc:

Public Member Functions

 KnapNodeDesc (KnapModel *model)
 
 KnapNodeDesc (KnapModel *model, KnapVarStatus *&st, int cap, int val)
 
virtual ~KnapNodeDesc ()
 
void setVarStatus (const int i, const KnapVarStatus status)
 
KnapVarStatus getVarStatus (const int i)
 
const KnapVarStatusgetVarStati () const
 
int getUsedCapacity () const
 
int getUsedValue () const
 
KnapModelmodel ()
 
const KnapModelmodel () const
 
- Public Member Functions inherited from AlpsNodeDesc
 AlpsNodeDesc ()
 Default constructor. More...
 
 AlpsNodeDesc (AlpsKnowledgeBroker *broker)
 
virtual ~AlpsNodeDesc ()
 Destructor. More...
 
AlpsEncodedencode () const
 Pack this into an AlpsEncoded object and return a pointer to it. More...
 
virtual AlpsReturnStatus encode (AlpsEncoded *encoded) const
 Pack this into an AlpsEncoded object and return a pointer to it. 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...
 
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...
 
AlpsEncodedencode () const
 Encode the content of this into an AlpsEncoded object and return a pointer to it. More...
 

Private Attributes

KnapModelmodel_
 
KnapVarStatusvarStatus_
 This array keeps track of which variables have been fixed by branching and which are still free. More...
 
int usedCapacity_
 The total size of the items fixed to be put into the knapsack. More...
 
int usedValue_
 

Encode/Decode inherited from #AlpsKnowledge.

virtual AlpsReturnStatus encode (AlpsEncoded *encoded) const
 Pack this node description into the given AlpsEncoded object. More...
 
virtual AlpsReturnStatus decodeToSelf (AlpsEncoded &encoded)
 Unpack fields from the given AlpsEncoded object. More...
 
virtual AlpsNodeDescdecode (AlpsEncoded &encoded) const
 Decode the given AlpsEncoded object into a new AlpsKnowledge object and return a pointer to it. More...
 
AlpsEncodedencode () const
 Grab encode function from AlpsKnowledge. More...
 
virtual AlpsReturnStatus encode (AlpsEncoded *encoded) const
 Grab encode function from AlpsKnowledge. More...
 
 KnapNodeDesc (KnapNodeDesc const &other)
 Disable copy constructor. More...
 
KnapNodeDescoperator= (KnapNodeDesc const &rhs)
 Disable copy assignment operator. More...
 

Additional Inherited Members

- Public Attributes inherited from AlpsKnowledge
AlpsKnowledgeBrokerbroker_
 

Detailed Description

Here, we need to fill in what the node description will look like.

For now, we will not use differencing – just explicitly represent it. Probably this means that we will just store the original problem data and a list of the variables that have been fixed.

Definition at line 50 of file KnapNodeDesc.h.

Constructor & Destructor Documentation

◆ KnapNodeDesc() [1/3]

KnapNodeDesc::KnapNodeDesc ( KnapModel model)

◆ KnapNodeDesc() [2/3]

KnapNodeDesc::KnapNodeDesc ( KnapModel model,
KnapVarStatus *&  st,
int  cap,
int  val 
)

◆ ~KnapNodeDesc()

virtual KnapNodeDesc::~KnapNodeDesc ( )
virtual

◆ KnapNodeDesc() [3/3]

KnapNodeDesc::KnapNodeDesc ( KnapNodeDesc const &  other)
private

Disable copy constructor.

Member Function Documentation

◆ setVarStatus()

void KnapNodeDesc::setVarStatus ( const int  i,
const KnapVarStatus  status 
)

◆ getVarStatus()

KnapVarStatus KnapNodeDesc::getVarStatus ( const int  i)

◆ getVarStati()

const KnapVarStatus* KnapNodeDesc::getVarStati ( ) const

◆ getUsedCapacity()

int KnapNodeDesc::getUsedCapacity ( ) const
inline

Definition at line 72 of file KnapNodeDesc.h.

◆ getUsedValue()

int KnapNodeDesc::getUsedValue ( ) const
inline

Definition at line 73 of file KnapNodeDesc.h.

◆ model() [1/2]

KnapModel* KnapNodeDesc::model ( )
inline

Definition at line 75 of file KnapNodeDesc.h.

◆ model() [2/2]

const KnapModel* KnapNodeDesc::model ( ) const
inline

Definition at line 76 of file KnapNodeDesc.h.

◆ encode() [1/3]

virtual AlpsReturnStatus KnapNodeDesc::encode ( AlpsEncoded encoded) const
virtual

Pack this node description into the given AlpsEncoded object.

Reimplemented from AlpsNodeDesc.

◆ decodeToSelf()

virtual AlpsReturnStatus KnapNodeDesc::decodeToSelf ( AlpsEncoded encoded)
virtual

Unpack fields from the given AlpsEncoded object.

Reimplemented from AlpsNodeDesc.

◆ decode()

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

Implements AlpsKnowledge.

◆ operator=()

KnapNodeDesc& KnapNodeDesc::operator= ( KnapNodeDesc const &  rhs)
private

Disable copy assignment operator.

◆ encode() [2/3]

AlpsEncoded* AlpsKnowledge::encode

Grab encode function from AlpsKnowledge.

◆ encode() [3/3]

virtual AlpsReturnStatus AlpsKnowledge::encode

Grab encode function from AlpsKnowledge.

Member Data Documentation

◆ model_

KnapModel* KnapNodeDesc::model_
private

Definition at line 51 of file KnapNodeDesc.h.

◆ varStatus_

KnapVarStatus* KnapNodeDesc::varStatus_
private

This array keeps track of which variables have been fixed by branching and which are still free.

Definition at line 56 of file KnapNodeDesc.h.

◆ usedCapacity_

int KnapNodeDesc::usedCapacity_
private

The total size of the items fixed to be put into the knapsack.

Definition at line 58 of file KnapNodeDesc.h.

◆ usedValue_

int KnapNodeDesc::usedValue_
private

Definition at line 59 of file KnapNodeDesc.h.


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