Alps 1.5.7
|
#include <AlpsKnowledgeBrokerSerial.h>
Public Member Functions | |
AlpsKnowledgeBrokerSerial () | |
Default constructor. | |
AlpsKnowledgeBrokerSerial (AlpsModel &model) | |
Useful constructor. | |
AlpsKnowledgeBrokerSerial (int argc, char *argv[], AlpsModel &model) | |
Userful constructor. | |
virtual | ~AlpsKnowledgeBrokerSerial () |
Destructor. | |
Report the search results. | |
virtual void | searchLog () |
Search log. | |
virtual double | getIncumbentValue () const |
The process queries the quality of the incumbent that it stores. | |
virtual double | getBestQuality () const |
The process queries the quality of the best solution that it finds. | |
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. | |
virtual void | initializeSearch (int argc, char *argv[], AlpsModel &model) |
Reading in Alps and user parameter sets, and read in model data. | |
virtual void | rootSearch (AlpsTreeNode *root) |
Search for best solution. | |
![]() | |
void | registerClass (int name, AlpsKnowledge *userKnowledge) |
Every user derived knowledge class must register. | |
const AlpsKnowledge * | decoderObject (int name) |
This method returns the pointer to an empty object of the registered class name . | |
virtual void | search (AlpsModel *model) |
Search best solution for a given model. | |
AlpsPhase | getPhase () |
void | setPhase (AlpsPhase ph) |
AlpsModel * | getModel () |
void | setModel (AlpsModel *m) |
int | getTreeDepth () |
Get tree depth. | |
void | setPeakMemory (double size) |
Set peak memory usage. | |
double | getPeakMemory () |
Get peak memory usage. | |
void | setupKnowledgePools () |
Set up knowledge pools for this broker. | |
void | addKnowledgePool (AlpsKnowledgeType kt, AlpsKnowledgePool *kp) |
Add a knowledge pool into the Knowledge pools. | |
AlpsKnowledgePool * | getKnowledgePool (AlpsKnowledgeType kt) const |
Retrieve a knowledge pool in the Knowledge base. | |
virtual int | getNumKnowledges (AlpsKnowledgeType kt) const |
Query the number of knowledge in the given type of a knowledge pool. | |
virtual int | getMaxNumKnowledges (AlpsKnowledgeType kt) const |
Query the max number of knowledge can be stored in a given type of knowledge pools. | |
virtual void | setMaxNumKnowledges (AlpsKnowledgeType kt, int num) |
Set the max number of knowledge can be stored in a given type o fknowledge pools. | |
virtual bool | hasKnowledge (AlpsKnowledgeType kt) const |
Query whether there are knowledges in the given type of knowledge pools. | |
virtual std::pair< AlpsKnowledge *, double > | getKnowledge (AlpsKnowledgeType kt) const |
Get a knowledge, but doesn't remove it from the pool. | |
virtual void | popKnowledge (AlpsKnowledgeType kt) |
Remove the a knowledge from the given type of knowledge pools. | |
virtual std::pair< AlpsKnowledge *, double > | getBestKnowledge (AlpsKnowledgeType kt) const |
Get the best knowledge in the given type of knowledge pools. | |
virtual void | getAllKnowledges (AlpsKnowledgeType kt, std::vector< std::pair< AlpsKnowledge *, double > > &kls) const |
Get all knowledges in the given type of knowledge pools. | |
virtual void | addKnowledge (AlpsKnowledgeType kt, AlpsKnowledge *kl, double value) |
Add a knowledge in the given type of knowledge pools. | |
int | getNumNodesProcessed () const |
Query the number of node processed by this process. | |
int | getNumNodesBranched () const |
Query the number of node processed by this process. | |
int | getNumNodesDiscarded () const |
Query the number of node processed by this process. | |
int | getNumNodesPartial () const |
Query the number of node in the queue that are pregnant. | |
int | getNumNodesProcessedSystem () const |
Query the number of node processed by the system. | |
virtual int | updateNumNodesLeft () |
Update the number of left nodes on this process. | |
virtual AlpsTreeNode * | getBestNode () const |
Query the best node in the subtree pool. | |
AlpsExitStatus | getSolStatus () const |
Query search termination status. | |
void | setExitStatus (AlpsExitStatus status) |
Set terminate status. | |
AlpsTimer & | timer () |
Query timer. | |
AlpsTimer & | subTreeTimer () |
Query subtree timer. | |
AlpsTimer & | tempTimer () |
Query secondary timer. | |
int | getNodeMemSize () |
void | setNodeMemSize (int ms) |
double | getNodeProcessingTime () |
void | setNodeProcessingTime (double npTime) |
int | getLargeSize () const |
virtual double | getBestEstimateQuality () |
Get best estimalted quality in system. | |
virtual int | getNumNodeLeftSystem () |
virtual int | getProcRank () const |
Qeury the global rank of process. | |
virtual int | getMasterRank () const |
Query the global rank of the Master. | |
virtual AlpsProcessType | getProcType () const |
Query the type (master, hub, or worker) of the process. | |
AlpsNodeIndex_t | nextNodeIndex () |
Query the next index assigned to a newly created node, and then increment the nextIndex_ by 1. | |
AlpsNodeIndex_t | getNextNodeIndex () const |
Query the next index assigned to a newly created node. | |
void | setNextNodeIndex (AlpsNodeIndex_t s) |
Set nextIndex_. | |
AlpsNodeIndex_t | getMaxNodeIndex () const |
Queriy the upper bound of node indices. | |
void | setMaxNodeIndex (AlpsNodeIndex_t s) |
Set the upper bound of node indices. | |
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). | |
void | newLanguage (CoinMessages::Language language) |
Set language. | |
void | setLanguage (CoinMessages::Language language) |
CoinMessageHandler * | messageHandler () const |
Return handler. | |
CoinMessages | messages () |
Return messages. | |
CoinMessages * | messagesPointer () |
Return pointer to messages. | |
int | getMsgLevel () |
Return msg level. | |
int | getHubMsgLevel () |
Return msg level. | |
int | getMasterMsgLevel () |
Return msg level. | |
int | getlogFileLevel () |
Return log file level. | |
int | getNumNodeLog () const |
Get times that node log has been printed. | |
void | setNumNodeLog (int num) |
Get times that node log has been printed. | |
AlpsKnowledgeBroker () | |
Default constructor. | |
AlpsKnowledgeBroker (AlpsModel &model) | |
Constructor passing in model. | |
virtual | ~AlpsKnowledgeBroker () |
Destructor. | |
Additional Inherited Members | |
![]() | |
std::string | instanceName_ |
The instance name. | |
AlpsModel * | model_ |
Pointer to model. | |
AlpsPhase | phase_ |
Alps phase. | |
AlpsSubTreePool * | subTreePool_ |
A subtree pool holding a collection of subtrees. | |
AlpsSolutionPool * | solPool_ |
A solution pool containing the solutions found. | |
std::map< AlpsKnowledgeType, AlpsKnowledgePool * > * | pools_ |
The collection of pools managed by the knowledge broker. | |
AlpsSubTree * | workingSubTree_ |
Point to the subtree that being explored. | |
bool | needWorkingSubTree_ |
Indicate whether need a new subtree. | |
AlpsNodeIndex_t | nextIndex_ |
The index to be assigned to a new search tree node. | |
AlpsNodeIndex_t | maxIndex_ |
The maximum index can been assigned on this process. | |
AlpsTimer | timer_ |
Main timer. | |
AlpsTimer | subTreeTimer_ |
Subtree timer. | |
AlpsTimer | tempTimer_ |
Secondary timer. | |
int | solNum_ |
The number of solutions found. | |
int | nodeProcessedNum_ |
The number of nodes that have been processed. | |
int | nodeBranchedNum_ |
The number of nodes that have been branched. | |
int | nodeDiscardedNum_ |
The number of nodes that have been discarded before processing. | |
int | nodePartialNum_ |
The number of nodes that are pregnant. | |
int | systemNodeProcessed_ |
To record how many nodes processed by the system (used in parallel code). | |
int | nodeLeftNum_ |
The number of nodes left. | |
int | treeDepth_ |
The depth of the tree. | |
int | bestSolNode_ |
The number of nodes pocessed to find the solution. | |
double | peakMemory_ |
Peak memory usage. | |
AlpsExitStatus | exitStatus_ |
The status of search when terminated. | |
AlpsSearchStrategy< AlpsSubTree * > * | treeSelection_ |
Tree selection criterion. | |
AlpsSearchStrategy< AlpsTreeNode * > * | nodeSelection_ |
Node selection criterion. | |
AlpsSearchStrategy< AlpsTreeNode * > * | rampUpNodeSelection_ |
Node selection criterion. | |
CoinMessageHandler * | handler_ |
Message handler. | |
CoinMessages | messages_ |
Alps messages. | |
int | msgLevel_ |
The leve of printing message to screen of the master and general message. | |
int | hubMsgLevel_ |
The leve of printing message to screen of hubs. | |
int | workerMsgLevel_ |
The leve of printing message to screen of workers. | |
int | logFileLevel_ |
The degree of log file. | |
std::string | logfile_ |
The log file. | |
int | nodeMemSize_ |
The approximate memory size (bytes) of a node with full description. | |
double | nodeProcessingTime_ |
The approximately CPU time to process a node. | |
int | largeSize_ |
The size of largest message buffer can be sent or received. | |
bool | userBalancePeriod_ |
Has user input balance period. | |
int | numNodeLog_ |
Times that node log is printed. | |
Definition at line 35 of file AlpsKnowledgeBrokerSerial.h.
|
inline |
Default constructor.
Definition at line 42 of file AlpsKnowledgeBrokerSerial.h.
|
inline |
Useful constructor.
Note need read in parameters and data seperately.
Definition at line 49 of file AlpsKnowledgeBrokerSerial.h.
|
inline |
Userful constructor.
Read in parameters from arguments. Also read in data.
Definition at line 58 of file AlpsKnowledgeBrokerSerial.h.
|
inlinevirtual |
Destructor.
Definition at line 69 of file AlpsKnowledgeBrokerSerial.h.
|
virtual |
Search log.
Implements AlpsKnowledgeBroker.
|
inlinevirtual |
The process queries the quality of the incumbent that it stores.
Implements AlpsKnowledgeBroker.
Definition at line 81 of file AlpsKnowledgeBrokerSerial.h.
|
inlinevirtual |
The process queries the quality of the best solution that it finds.
Implements AlpsKnowledgeBroker.
Definition at line 87 of file AlpsKnowledgeBrokerSerial.h.
|
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 |
Reading in Alps and user parameter sets, and read in model data.
Implements AlpsKnowledgeBroker.
|
virtual |
Search for best solution.
Implements AlpsKnowledgeBroker.