Public Member Functions | Private Member Functions | List of all members
AlpsKnowledgeBrokerSerial Class Reference

#include <AlpsKnowledgeBrokerSerial.h>

Inheritance diagram for AlpsKnowledgeBrokerSerial:
Inheritance graph
[legend]
Collaboration diagram for AlpsKnowledgeBrokerSerial:
Collaboration graph
[legend]

Public Member Functions

 AlpsKnowledgeBrokerSerial ()
 Default constructor. More...
 
 AlpsKnowledgeBrokerSerial (AlpsModel &model)
 Useful constructor. More...
 
 AlpsKnowledgeBrokerSerial (int argc, char *argv[], AlpsModel &model)
 Userful constructor. More...
 
virtual ~AlpsKnowledgeBrokerSerial ()
 Destructor. More...
 
virtual void initializeSearch (int argc, char *argv[], AlpsModel &model)
 Reading in Alps and user parameter sets, and read in model data. More...
 
virtual void rootSearch (AlpsTreeNode *root)
 Search for best solution. More...
 
Report the search results.
virtual void searchLog ()
 Search log. More...
 
virtual double getIncumbentValue () const
 The process queries the quality of the incumbent that it stores. More...
 
virtual double getBestQuality () const
 The process queries the quality of the best solution that it finds. More...
 
virtual void printBestSolution (char *outputFile=0) const
 The process outputs the best solution and the quality that it finds to a file or std::out. More...
 
- Public Member Functions inherited from AlpsKnowledgeBroker
 AlpsKnowledgeBroker ()
 Default constructor. More...
 
virtual ~AlpsKnowledgeBroker ()
 Destructor. More...
 
int getTreeDepth ()
 Get tree depth. More...
 
void setPeakMemory (double size)
 Set peak memory usage. More...
 
double getPeakMemory ()
 Get peak memory usage. More...
 
int getLargeSize () const
 
virtual int getProcRank () const
 Qeury the global rank of process. More...
 
virtual int getMasterRank () const
 Query the global rank of the Master. More...
 
virtual AlpsProcessType getProcType () const
 Query the type (master, hub, or worker) of the process. More...
 
void registerClass (int name, AlpsKnowledge *userKnowledge)
 Every user derived knowledge class must register. More...
 
const AlpsKnowledgedecoderObject (int name)
 This method returns the pointer to an empty object of the registered class name. More...
 
virtual void search (AlpsModel *model)
 Search best solution for a given model. More...
 
AlpsPhase getPhase ()
 
void setPhase (AlpsPhase ph)
 
AlpsModelgetModel ()
 
void setModel (AlpsModel *m)
 
void setupKnowledgePools ()
 Set up knowledge pools for this broker. More...
 
void addKnowledgePool (AlpsKnowledgeType kt, AlpsKnowledgePool *kp)
 Add a knowledge pool into the Knowledge pools. More...
 
AlpsKnowledgePoolgetKnowledgePool (AlpsKnowledgeType kt) const
 Retrieve a knowledge pool in the Knowledge base. More...
 
virtual int getNumKnowledges (AlpsKnowledgeType kt) const
 Query the number of knowledge in the given type of a knowledge pool. More...
 
virtual int getMaxNumKnowledges (AlpsKnowledgeType kt) const
 Query the max number of knowledge can be stored in a given type of knowledge pools. More...
 
virtual void setMaxNumKnowledges (AlpsKnowledgeType kt, int num)
 Set the max number of knowledge can be stored in a given type o fknowledge pools. More...
 
virtual bool hasKnowledge (AlpsKnowledgeType kt) const
 Query whether there are knowledges in the given type of knowledge pools. More...
 
virtual std::pair
< AlpsKnowledge *, double > 
getKnowledge (AlpsKnowledgeType kt) const
 Get a knowledge, but doesn't remove it from the pool. More...
 
virtual void popKnowledge (AlpsKnowledgeType kt)
 Remove the a knowledge from the given type of knowledge pools. More...
 
virtual std::pair
< AlpsKnowledge *, double > 
getBestKnowledge (AlpsKnowledgeType kt) const
 Get the best knowledge in the given type of knowledge pools. More...
 
virtual void getAllKnowledges (AlpsKnowledgeType kt, std::vector< std::pair< AlpsKnowledge *, double > > &kls) const
 Get all knowledges in the given type of knowledge pools. More...
 
virtual void addKnowledge (AlpsKnowledgeType kt, AlpsKnowledge *kl, double value)
 Add a knowledge in the given type of knowledge pools. More...
 
int getNumNodesProcessed () const
 Query the number of node processed by this process. More...
 
int getNumNodesBranched () const
 Query the number of node processed by this process. More...
 
int getNumNodesDiscarded () const
 Query the number of node processed by this process. More...
 
int getNumNodesPartial () const
 Query the number of node in the queue that are pregnant. More...
 
int getNumNodesProcessedSystem () const
 Query the number of node processed by the system. More...
 
virtual int updateNumNodesLeft ()
 Update the number of left nodes on this process. More...
 
virtual AlpsTreeNodegetBestNode () const
 Query the best node in the subtree pool. More...
 
AlpsExitStatus getSolStatus () const
 Query search termination status. More...
 
void setExitStatus (AlpsExitStatus status)
 Set terminate status. More...
 
AlpsTimertimer ()
 Query timer. More...
 
AlpsTimersubTreeTimer ()
 Query subtree timer. More...
 
AlpsTimertempTimer ()
 Query secondary timer. More...
 
int getNodeMemSize ()
 
void setNodeMemSize (int ms)
 
double getNodeProcessingTime ()
 
void setNodeProcessingTime (double npTime)
 
virtual double getBestEstimateQuality ()
 Get best estimalted quality in system. More...
 
virtual int getNumNodeLeftSystem ()
 The process queries the objective value of the incumbent that it stores. More...
 
AlpsNodeIndex_t nextNodeIndex ()
 Query the next index assigned to a newly created node, and then increment the nextIndex_ by 1. More...
 
AlpsNodeIndex_t getNextNodeIndex () const
 Query the next index assigned to a newly created node. More...
 
void setNextNodeIndex (AlpsNodeIndex_t s)
 Set nextIndex_. More...
 
AlpsNodeIndex_t getMaxNodeIndex () const
 Queriy the upper bound of node indices. More...
 
void setMaxNodeIndex (AlpsNodeIndex_t s)
 Set the upper bound of node indices. More...
 
AlpsSearchStrategy
< AlpsSubTree * > * 
getSubTreeSelection () const
 
void setSubTreeSelection (AlpsSearchStrategy< AlpsSubTree * > *tc)
 
AlpsSearchStrategy
< AlpsTreeNode * > * 
getNodeSelection () const
 
void setNodeSelection (AlpsSearchStrategy< AlpsTreeNode * > *nc)
 
AlpsSearchStrategy
< AlpsTreeNode * > * 
getRampUpNodeSelection () const
 
void setRampUpNodeSelection (AlpsSearchStrategy< AlpsTreeNode * > *nc)
 
void passInMessageHandler (CoinMessageHandler *handler)
 Pass in Message handler (not deleted at end). More...
 
void newLanguage (CoinMessages::Language language)
 Set language. More...
 
void setLanguage (CoinMessages::Language language)
 Pass in Message handler (not deleted at end). More...
 
CoinMessageHandlermessageHandler () const
 Return handler. More...
 
CoinMessages messages ()
 Return messages. More...
 
CoinMessagesmessagesPointer ()
 Return pointer to messages. More...
 
int getMsgLevel ()
 Return msg level. More...
 
int getHubMsgLevel ()
 Return msg level. More...
 
int getMasterMsgLevel ()
 Return msg level. More...
 
int getlogFileLevel ()
 Return log file level. More...
 
int getNumNodeLog () const
 Get times that node log has been printed. More...
 
void setNumNodeLog (int num)
 Get times that node log has been printed. More...
 

Private Member Functions

 AlpsKnowledgeBrokerSerial (const AlpsKnowledgeBrokerSerial &)
 
AlpsKnowledgeBrokerSerialoperator= (const AlpsKnowledgeBrokerSerial &)
 

Additional Inherited Members

- Protected Attributes inherited from AlpsKnowledgeBroker
std::string instanceName_
 The instance name. More...
 
AlpsModelmodel_
 Pointer to model. More...
 
AlpsPhase phase_
 Alps phase. More...
 
int nodeMemSize_
 The approximate memory size (bytes) of a node with full description. More...
 
double nodeProcessingTime_
 The approximately CPU time to process a node. More...
 
int largeSize_
 The size of largest message buffer can be sent or received. More...
 
bool userBalancePeriod_
 Has user input balance period. More...
 
int numNodeLog_
 Times that node log is printed. More...
 
AlpsSubTreePoolsubTreePool_
 A subtree pool holding a collection of subtrees. More...
 
AlpsSolutionPoolsolPool_
 A solution pool containing the solutions found. More...
 
std::map< AlpsKnowledgeType,
AlpsKnowledgePool * > * 
pools_
 The collection of pools managed by the knowledge broker. More...
 
AlpsSubTreeworkingSubTree_
 Point to the subtree that being explored. More...
 
bool needWorkingSubTree_
 Indicate whether need a new subtree. More...
 
AlpsNodeIndex_t nextIndex_
 The index to be assigned to a new search tree node. More...
 
AlpsNodeIndex_t maxIndex_
 The maximum index can been assigned on this process. More...
 
AlpsTimer timer_
 Main timer. More...
 
AlpsTimer subTreeTimer_
 Subtree timer. More...
 
AlpsTimer tempTimer_
 Secondary timer. More...
 
int solNum_
 The number of solutions found. More...
 
int nodeProcessedNum_
 The number of nodes that have been processed. More...
 
int nodeBranchedNum_
 The number of nodes that have been branched. More...
 
int nodeDiscardedNum_
 The number of nodes that have been discarded before processing. More...
 
int nodePartialNum_
 The number of nodes that are pregnant. More...
 
int systemNodeProcessed_
 To record how many nodes processed by the system (used in parallel code). More...
 
int nodeLeftNum_
 The number of nodes left. More...
 
int treeDepth_
 The depth of the tree. More...
 
int bestSolNode_
 The number of nodes pocessed to find the solution. More...
 
double peakMemory_
 Peak memory usage. More...
 
AlpsExitStatus exitStatus_
 The status of search when terminated. More...
 
AlpsSearchStrategy
< AlpsSubTree * > * 
treeSelection_
 Tree selection criterion. More...
 
AlpsSearchStrategy
< AlpsTreeNode * > * 
nodeSelection_
 Node selection criterion. More...
 
AlpsSearchStrategy
< AlpsTreeNode * > * 
rampUpNodeSelection_
 Node selection criterion. More...
 
CoinMessageHandlerhandler_
 Message handler. More...
 
CoinMessages messages_
 Alps messages. More...
 
int msgLevel_
 The leve of printing message to screen of the master and general message. More...
 
int hubMsgLevel_
 The leve of printing message to screen of hubs. More...
 
int workerMsgLevel_
 The leve of printing message to screen of workers. More...
 
int logFileLevel_
 The degree of log file. More...
 
std::string logfile_
 The log file. More...
 

Detailed Description

Definition at line 35 of file AlpsKnowledgeBrokerSerial.h.

Constructor & Destructor Documentation

AlpsKnowledgeBrokerSerial::AlpsKnowledgeBrokerSerial ( const AlpsKnowledgeBrokerSerial )
private
AlpsKnowledgeBrokerSerial::AlpsKnowledgeBrokerSerial ( )
inline

Default constructor.

Definition at line 42 of file AlpsKnowledgeBrokerSerial.h.

AlpsKnowledgeBrokerSerial::AlpsKnowledgeBrokerSerial ( AlpsModel model)
inline

Useful constructor.

Note need read in parameters and data seperately.

Definition at line 49 of file AlpsKnowledgeBrokerSerial.h.

AlpsKnowledgeBrokerSerial::AlpsKnowledgeBrokerSerial ( int  argc,
char *  argv[],
AlpsModel model 
)
inline

Userful constructor.

Read in parameters from arguments. Also read in data.

Definition at line 58 of file AlpsKnowledgeBrokerSerial.h.

virtual AlpsKnowledgeBrokerSerial::~AlpsKnowledgeBrokerSerial ( )
inlinevirtual

Destructor.

Definition at line 69 of file AlpsKnowledgeBrokerSerial.h.

Member Function Documentation

AlpsKnowledgeBrokerSerial& AlpsKnowledgeBrokerSerial::operator= ( const AlpsKnowledgeBrokerSerial )
private
virtual void AlpsKnowledgeBrokerSerial::searchLog ( )
virtual

Search log.

Implements AlpsKnowledgeBroker.

virtual double AlpsKnowledgeBrokerSerial::getIncumbentValue ( ) const
inlinevirtual

The process queries the quality of the incumbent that it stores.

Implements AlpsKnowledgeBroker.

Definition at line 81 of file AlpsKnowledgeBrokerSerial.h.

virtual double AlpsKnowledgeBrokerSerial::getBestQuality ( ) const
inlinevirtual

The process queries the quality of the best solution that it finds.

Implements AlpsKnowledgeBroker.

Definition at line 87 of file AlpsKnowledgeBrokerSerial.h.

virtual void AlpsKnowledgeBrokerSerial::printBestSolution ( char *  outputFile = 0) const
inlinevirtual

The process outputs the best solution and the quality that it finds to a file or std::out.

Implements AlpsKnowledgeBroker.

Definition at line 98 of file AlpsKnowledgeBrokerSerial.h.

virtual void AlpsKnowledgeBrokerSerial::initializeSearch ( int  argc,
char *  argv[],
AlpsModel model 
)
virtual

Reading in Alps and user parameter sets, and read in model data.

Implements AlpsKnowledgeBroker.

virtual void AlpsKnowledgeBrokerSerial::rootSearch ( AlpsTreeNode root)
virtual

Search for best solution.

Implements AlpsKnowledgeBroker.


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