|
Dip
0.92.4
|
#include <AlpsKnowledgeBrokerSerial.h>


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 AlpsKnowledge * | decoderObject (int name) |
This method returns the pointer to an empty object of the registered class | |
| virtual void | search (AlpsModel *model) |
| Search best solution for a given model. More... | |
| AlpsPhase | getPhase () |
| void | setPhase (AlpsPhase ph) |
| AlpsModel * | getModel () |
| 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... | |
| AlpsKnowledgePool * | getKnowledgePool (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 AlpsTreeNode * | getBestNode () 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... | |
| AlpsTimer & | timer () |
| Query timer. More... | |
| AlpsTimer & | subTreeTimer () |
| Query subtree timer. More... | |
| AlpsTimer & | tempTimer () |
| 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... | |
| CoinMessageHandler * | messageHandler () const |
| Return handler. More... | |
| CoinMessages | messages () |
| Return messages. More... | |
| CoinMessages * | messagesPointer () |
| 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 &) | |
| AlpsKnowledgeBrokerSerial & | operator= (const AlpsKnowledgeBrokerSerial &) |
Additional Inherited Members | |
Protected Attributes inherited from AlpsKnowledgeBroker | |
| std::string | instanceName_ |
| The instance name. More... | |
| AlpsModel * | model_ |
| 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... | |
| AlpsSubTreePool * | subTreePool_ |
| A subtree pool holding a collection of subtrees. More... | |
| AlpsSolutionPool * | solPool_ |
| A solution pool containing the solutions found. More... | |
| std::map< AlpsKnowledgeType, AlpsKnowledgePool * > * | pools_ |
| The collection of pools managed by the knowledge broker. More... | |
| AlpsSubTree * | workingSubTree_ |
| 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... | |
| CoinMessageHandler * | handler_ |
| 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... | |
Definition at line 35 of file AlpsKnowledgeBrokerSerial.h.
|
private |
|
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.
References initializeSearch().
|
inline |
Userful constructor.
Read in parameters from arguments. Also read in data.
Definition at line 58 of file AlpsKnowledgeBrokerSerial.h.
References initializeSearch().
|
inlinevirtual |
Destructor.
Definition at line 69 of file AlpsKnowledgeBrokerSerial.h.
|
private |
|
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.
References getBestQuality().
|
inlinevirtual |
The process queries the quality of the best
solution that it finds.
Implements AlpsKnowledgeBroker.
Definition at line 87 of file AlpsKnowledgeBrokerSerial.h.
References ALPS_INC_MAX, AlpsKnowledgeTypeSolution, AlpsKnowledgeBroker::getBestKnowledge(), and AlpsKnowledgeBroker::hasKnowledge().
Referenced by getIncumbentValue(), and printBestSolution().
|
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.
References AlpsExitStatusOptimal, AlpsKnowledgeTypeSolution, AlpsKnowledgeBroker::getBestKnowledge(), getBestQuality(), AlpsKnowledgeBroker::getNumKnowledges(), AlpsKnowledgeBroker::getSolStatus(), and AlpsKnowledgeBroker::msgLevel_.
|
virtual |
Reading in Alps and user parameter sets, and read in model data.
Implements AlpsKnowledgeBroker.
Referenced by AlpsKnowledgeBrokerSerial().
|
virtual |
Search for best solution.
Implements AlpsKnowledgeBroker.
1.8.5