Alps  2.0.2
Protected Attributes | Private Member Functions | List of all members
AlpsModel Class Referenceabstract

AlpsModel is a base class for user application problem data. More...

#include <AlpsModel.h>

+ Inheritance diagram for AlpsModel:
+ Collaboration diagram for AlpsModel:

Public Member Functions

Constructor and Destructor
 AlpsModel ()
 Default construtor. More...
 
virtual ~AlpsModel ()
 Destructor. More...
 
Get methods
std::string getDataFile () const
 Get the input file. More...
 
AlpsParamsAlpsPar ()
 Access Alps Parameters. More...
 
Set methods
void setDataFile (std::string infile)
 Set the data file. More...
 
Virtual functions required to be implemented by sub-class.
virtual void readInstance (const char *dateFile)
 Read in the instance data. More...
 
virtual void readParameters (const int argnum, const char *const *arglist)
 Read in Alps parameters. More...
 
void writeParameters (std::ostream &outstream) const
 Write out parameters. More...
 
virtual bool setupSelf ()
 Do necessary work to make model ready for use, such as classify variable and constraint types. More...
 
virtual void preprocess ()
 Preprocessing the model. More...
 
virtual void postprocess ()
 Postprocessing results. More...
 
virtual AlpsTreeNodecreateRoot ()=0
 Create the root node. More...
 
virtual void modelLog ()
 Problem specific log. More...
 
virtual void nodeLog (AlpsTreeNode *node, bool force)
 Node log. More...
 
virtual bool fathomAllNodes ()
 Return true if all nodes on this process can be fathomed. More...
 
Parallel execution related virtual functions
virtual AlpsReturnStatus encode (AlpsEncoded *encoded) const
 Pack AlpsPar_ into a given encode object. More...
 
virtual AlpsReturnStatus decodeToSelf (AlpsEncoded &encoded)
 Decode the given AlpsEncoded object into this. More...
 
virtual void registerKnowledge ()
 Register knowledge class. More...
 
virtual void sendGeneratedKnowledge ()
 Send generated knowledge. More...
 
virtual void receiveGeneratedKnowledge ()
 Receive generated knowledge. More...
 
virtual AlpsEncodedpackSharedKnowlege ()
 Pack knowledge to be shared with others into an encoded object. More...
 
virtual void unpackSharedKnowledge (AlpsEncoded &)
 Unpack and store shared knowledge from an encoded object. More...
 
AlpsEncodedencode () const
 Get encode function defined in AlpsKnowledge. More...
 
virtual AlpsReturnStatus encode (AlpsEncoded *encoded) const
 Get encode function 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...
 
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...
 
virtual AlpsKnowledgedecode (AlpsEncoded &encoded) const =0
 Decode the given AlpsEncoded object into a new AlpsKnowledge object and return a pointer to it. More...
 

Protected Attributes

std::string dataFile_
 Data file. More...
 
AlpsParamsAlpsPar_
 The parameter set that is used in Alps. More...
 

Private Member Functions

 AlpsModel (const AlpsModel &)
 
AlpsModeloperator= (const AlpsModel &)
 

Additional Inherited Members

- Public Attributes inherited from AlpsKnowledge
AlpsKnowledgeBrokerbroker_
 

Detailed Description

AlpsModel is a base class for user application problem data.

For an optimization problem problem parameters, constraint matrix, objective coeefficients, variable bounds are problem data.

User application is required to inherit this for its own model.

AlpsModel has three private data fields only, these are ::broker_, ::dataFile_ and ::AlpsPar_. Some important virtual functions defined in AlpsModel are following.

Definition at line 132 of file AlpsModel.h.

Constructor & Destructor Documentation

◆ AlpsModel() [1/2]

AlpsModel::AlpsModel ( const AlpsModel )
private

◆ AlpsModel() [2/2]

AlpsModel::AlpsModel ( )
inline

Default construtor.

Definition at line 150 of file AlpsModel.h.

◆ ~AlpsModel()

virtual AlpsModel::~AlpsModel ( )
inlinevirtual

Destructor.

Definition at line 154 of file AlpsModel.h.

Member Function Documentation

◆ operator=()

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

◆ getDataFile()

std::string AlpsModel::getDataFile ( ) const
inline

Get the input file.

Definition at line 160 of file AlpsModel.h.

◆ AlpsPar()

AlpsParams* AlpsModel::AlpsPar ( )
inline

Access Alps Parameters.

Definition at line 162 of file AlpsModel.h.

◆ setDataFile()

void AlpsModel::setDataFile ( std::string  infile)
inline

Set the data file.

Definition at line 168 of file AlpsModel.h.

◆ readInstance()

virtual void AlpsModel::readInstance ( const char *  dateFile)
inlinevirtual

Read in the instance data.

At Alps level, nothing to do.

Reimplemented in AbcModel, AbcModel, AbcModel, and KnapModel.

Definition at line 174 of file AlpsModel.h.

◆ readParameters()

virtual void AlpsModel::readParameters ( const int  argnum,
const char *const *  arglist 
)
virtual

Read in Alps parameters.

Reimplemented in AbcModel, AbcModel, AbcModel, and KnapModel.

◆ writeParameters()

void AlpsModel::writeParameters ( std::ostream &  outstream) const

Write out parameters.

◆ setupSelf()

virtual bool AlpsModel::setupSelf ( )
inlinevirtual

Do necessary work to make model ready for use, such as classify variable and constraint types.

Reimplemented in AbcModel, AbcModel, and AbcModel.

Definition at line 184 of file AlpsModel.h.

◆ preprocess()

virtual void AlpsModel::preprocess ( )
inlinevirtual

Preprocessing the model.

Definition at line 186 of file AlpsModel.h.

◆ postprocess()

virtual void AlpsModel::postprocess ( )
inlinevirtual

Postprocessing results.

Definition at line 188 of file AlpsModel.h.

◆ createRoot()

virtual AlpsTreeNode* AlpsModel::createRoot ( )
pure virtual

Create the root node.

Default: do nothing

Implemented in AbcModel, AbcModel, AbcModel, and KnapModel.

◆ modelLog()

virtual void AlpsModel::modelLog ( )
inlinevirtual

Problem specific log.

Definition at line 192 of file AlpsModel.h.

◆ nodeLog()

virtual void AlpsModel::nodeLog ( AlpsTreeNode node,
bool  force 
)
virtual

Node log.

◆ fathomAllNodes()

virtual bool AlpsModel::fathomAllNodes ( )
inlinevirtual

Return true if all nodes on this process can be fathomed.

Definition at line 196 of file AlpsModel.h.

◆ encode() [1/3]

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

Pack AlpsPar_ into a given encode object.

Reimplemented from AlpsKnowledge.

Reimplemented in AbcModel, AbcModel, AbcModel, and KnapModel.

◆ decodeToSelf()

virtual AlpsReturnStatus AlpsModel::decodeToSelf ( AlpsEncoded encoded)
virtual

Decode the given AlpsEncoded object into this.

Reimplemented from AlpsKnowledge.

Reimplemented in AbcModel, AbcModel, AbcModel, and KnapModel.

◆ registerKnowledge()

virtual void AlpsModel::registerKnowledge ( )
inlinevirtual

Register knowledge class.

Definition at line 208 of file AlpsModel.h.

◆ sendGeneratedKnowledge()

virtual void AlpsModel::sendGeneratedKnowledge ( )
inlinevirtual

Send generated knowledge.

Definition at line 210 of file AlpsModel.h.

◆ receiveGeneratedKnowledge()

virtual void AlpsModel::receiveGeneratedKnowledge ( )
inlinevirtual

Receive generated knowledge.

Definition at line 212 of file AlpsModel.h.

◆ packSharedKnowlege()

virtual AlpsEncoded* AlpsModel::packSharedKnowlege ( )
inlinevirtual

Pack knowledge to be shared with others into an encoded object.

Return NULL means that no knowledge can be shared.

Definition at line 215 of file AlpsModel.h.

◆ unpackSharedKnowledge()

virtual void AlpsModel::unpackSharedKnowledge ( AlpsEncoded )
inlinevirtual

Unpack and store shared knowledge from an encoded object.

Definition at line 221 of file AlpsModel.h.

◆ encode() [2/3]

AlpsEncoded* AlpsKnowledge::encode

Get encode function defined in AlpsKnowledge.

◆ encode() [3/3]

virtual AlpsReturnStatus AlpsKnowledge::encode

Get encode function defined in AlpsKnowledge.

Member Data Documentation

◆ dataFile_

std::string AlpsModel::dataFile_
protected

Data file.

Definition at line 141 of file AlpsModel.h.

◆ AlpsPar_

AlpsParams* AlpsModel::AlpsPar_
protected

The parameter set that is used in Alps.

Definition at line 143 of file AlpsModel.h.


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