- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# AlpsKnowledgeBroker Class Reference

The base class of knowledge broker class. More...

`#include <AlpsKnowledgeBroker.h>`

Inheritance diagram for AlpsKnowledgeBroker:

[legend]
Collaboration diagram for AlpsKnowledgeBroker:

[legend]
List of all members.

## Public Member Functions
| AlpsKnowledgeBroker ()
| Default constructor.
virtual | ~AlpsKnowledgeBroker ()
| Destructor.
int | getTreeDepth ()
| Get tree depth.
int | getBestSolDepth ()
| Get best solution depth.
void | setBestSolDepth (int depth)
| Set best solution depth.
void | setPeakMemory (double size)
| Set peak memory usage.
double | getPeakMemory ()
| Get peak memory usage.
int | getLargeSize () const
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.
Funcitons related to register knowledge.
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`.
Funcitons related to exploring subtree.
virtual void | initializeSearch (int argc, char *argv[], AlpsModel &model)=0
| Do some initialization for search.
virtual void | rootSearch (AlpsTreeNode *root)=0
| Explore the tree rooted as the given root.
virtual void | search (AlpsModel *model)
| Search best solution for a given model.
Get/set phase.
AlpsPhase | getPhase ()
void | setPhase (AlpsPhase ph)
Get/set phase.
AlpsModel * | getModel ()
void | setModel (AlpsModel *m)
Interface with the knowledge pools
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.
Querty and set statistics
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 | 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.
virtual void | searchLog ()=0
| Search statistics log.
Query and set the approximate memory size of a tree node
int | getNodeMemSize ()
void | setNodeMemSize (int ms)
Query and set the approximate node processing time
double | getNodeProcessingTime ()
void | setNodeProcessingTime (double npTime)
Report the best result
virtual double | getIncumbentValue () const =0
| The process queries the objective value of the incumbent that it stores.
virtual double | getBestQuality () const =0
| The process (serial) / the master (parallel) queries the quality of the best solution that it knows.
virtual double | getBestEstimateQuality ()
| Get best estimalted quality in system.
virtual int | getNumNodeLeftSystem ()
| The process queries the objective value of the incumbent that it stores.
virtual void | printBestSolution (char *outputFile=0) const =0
| The process (serial) / the master (parallel) outputs the best solution that it knows to a file or std::out.
Query and set node index
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.
Query and set comparision
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)
Message and log file handling
void | passInMessageHandler (CoinMessageHandler *handler)
| Pass in Message handler (not deleted at end).
void | newLanguage (CoinMessages::Language language)
| Set language.
void | setLanguage (CoinMessages::Language language)
| Pass in Message handler (not deleted at end).
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.
## Protected Attributes
std::string | instanceName_
| The instance name.
AlpsModel * | model_
| Pointer to model.
AlpsPhase | phase_
| Alps phase.
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.
knowledge pools
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.
Exploring subtree
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.
Statistics
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 | 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 | bestSolDepth_
| The depth of the node that with best solution.
int | bestSolNode_
| The number of nodes pocessed to find the solution.
double | peakMemory_
| Peak memory usage.
AlpsExitStatus | exitStatus_
| The status of search when terminated.
Search strategy
AlpsSearchStrategy< AlpsSubTree * > * | treeSelection_
| Tree selection criterion.
AlpsSearchStrategy< AlpsTreeNode * > * | nodeSelection_
| Node selection criterion.
AlpsSearchStrategy< AlpsTreeNode * > * | rampUpNodeSelection_
| Node selection criterion.
message handling
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.
## Private Member Functions
| AlpsKnowledgeBroker (const AlpsKnowledgeBroker &)
AlpsKnowledgeBroker & | operator= (const AlpsKnowledgeBroker &)
## Private Attributes
std::map< int, AlpsKnowledge * > | decodeMap_
| Stores registered knowledge.

## Detailed Description

The base class of knowledge broker class.

Definition at line 48 of file AlpsKnowledgeBroker.h.

## Constructor & Destructor Documentation

AlpsKnowledgeBroker::AlpsKnowledgeBroker | ( | const AlpsKnowledgeBroker & |  | ) | `[private]`

AlpsKnowledgeBroker::AlpsKnowledgeBroker | ( |  | ) |

Default constructor.

virtual AlpsKnowledgeBroker::~AlpsKnowledgeBroker | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

AlpsKnowledgeBroker& AlpsKnowledgeBroker::operator= | ( | const AlpsKnowledgeBroker & |  | ) | `[private]`

void AlpsKnowledgeBroker::registerClass | ( | int | name,
|  | AlpsKnowledge * | userKnowledge |
| ) |  |  | `[inline]`

Every user derived knowledge class must register.

The register methods register the decode method of the class so that later on we can decode objects from buffers. Invoking this registration for class `foo` is a single line:
`foo().registerClass(name, userKnowledge)`. NOTE: take over user knowledge's memory ownership, user doesn't need free memory.

Definition at line 230 of file AlpsKnowledgeBroker.h.

References decodeMap_.

const AlpsKnowledge* AlpsKnowledgeBroker::decoderObject | ( | int | name | ) | `[inline]`

This method returns the pointer to an empty object of the registered class `name`.

Then the `decode()` method of that object can be used to decode a new object of the same type from the buffer. This method will be invoked as follows to decode an object whose type is `name`:
`obj = AlpsKnowledge::decoderObject(name)->decode(buf)`

Definition at line 253 of file AlpsKnowledgeBroker.h.

References decodeMap_.

virtual void AlpsKnowledgeBroker::initializeSearch | ( | int | argc,
|  | char * | argv[],
|  | AlpsModel & | model |
| ) |  |  | `[pure virtual]`

Do some initialization for search.

Implemented in AlpsKnowledgeBrokerMPI, and AlpsKnowledgeBrokerSerial.

virtual void AlpsKnowledgeBroker::rootSearch | ( | AlpsTreeNode * | root | ) | `[pure virtual]`

Explore the tree rooted as the given root.

Implemented in AlpsKnowledgeBrokerMPI, and AlpsKnowledgeBrokerSerial.

Referenced by search().

virtual void AlpsKnowledgeBroker::search | ( | AlpsModel * | model | ) | `[inline, virtual]`

Search best solution for a given model.

Reimplemented in AlpsKnowledgeBrokerMPI.

Definition at line 273 of file AlpsKnowledgeBroker.h.

References AlpsModel::createRoot(), and rootSearch().

AlpsPhase AlpsKnowledgeBroker::getPhase | ( |  | ) | `[inline]`

Definition at line 285 of file AlpsKnowledgeBroker.h.

References phase_.

void AlpsKnowledgeBroker::setPhase | ( | AlpsPhase | ph | ) | `[inline]`

Definition at line 286 of file AlpsKnowledgeBroker.h.

References phase_.

AlpsModel* AlpsKnowledgeBroker::getModel | ( |  | ) | `[inline]`

Definition at line 290 of file AlpsKnowledgeBroker.h.

References model_.

void AlpsKnowledgeBroker::setModel | ( | AlpsModel * | m | ) | `[inline]`

Definition at line 291 of file AlpsKnowledgeBroker.h.

References model_.

int AlpsKnowledgeBroker::getTreeDepth | ( |  | ) | `[inline]`

Get tree depth.

Definition at line 295 of file AlpsKnowledgeBroker.h.

References treeDepth_.

int AlpsKnowledgeBroker::getBestSolDepth | ( |  | ) | `[inline]`

Get best solution depth.

Definition at line 298 of file AlpsKnowledgeBroker.h.

References bestSolDepth_.

void AlpsKnowledgeBroker::setBestSolDepth | ( | int | depth | ) | `[inline]`

Set best solution depth.

Definition at line 301 of file AlpsKnowledgeBroker.h.

References bestSolDepth_.

void AlpsKnowledgeBroker::setPeakMemory | ( | double | size | ) | `[inline]`

Set peak memory usage.

Definition at line 304 of file AlpsKnowledgeBroker.h.

References peakMemory_.

double AlpsKnowledgeBroker::getPeakMemory | ( |  | ) | `[inline]`

Get peak memory usage.

Definition at line 307 of file AlpsKnowledgeBroker.h.

References peakMemory_.

void AlpsKnowledgeBroker::setupKnowledgePools | ( |  | ) |

Set up knowledge pools for this broker.

void AlpsKnowledgeBroker::addKnowledgePool | ( | AlpsKnowledgeType | kt,
|  | AlpsKnowledgePool * | kp |
| ) |  |  | `[inline]`

Add a knowledge pool into the Knowledge pools.

Definition at line 317 of file AlpsKnowledgeBroker.h.

References AlpsKnowledgeTypeSolution, AlpsKnowledgeTypeSubTree, and pools_.

AlpsKnowledgePool* AlpsKnowledgeBroker::getKnowledgePool | ( | AlpsKnowledgeType | kt | ) | const`[inline]`

Retrieve a knowledge pool in the Knowledge base.

Definition at line 330 of file AlpsKnowledgeBroker.h.

References AlpsKnowledgeTypeSolution, AlpsKnowledgeTypeSubTree, and pools_.

Referenced by addKnowledge(), getAllKnowledges(), getKnowledge(), getMaxNumKnowledges(), hasKnowledge(), popKnowledge(), and setMaxNumKnowledges().

virtual int AlpsKnowledgeBroker::getNumKnowledges | ( | AlpsKnowledgeType | kt | ) | const`[virtual]`

Query the number of knowledge in the given type of a knowledge pool.

Referenced by AlpsKnowledgeBrokerMPI::getBestQuality(), and AlpsKnowledgeBrokerSerial::printBestSolution().

virtual int AlpsKnowledgeBroker::getMaxNumKnowledges | ( | AlpsKnowledgeType | kt | ) | const`[inline, virtual]`

Query the max number of knowledge can be stored in a given type of knowledge pools.

Definition at line 345 of file AlpsKnowledgeBroker.h.

References AlpsKnowledgeTypeSolution, AlpsKnowledgeTypeSubTree, getKnowledgePool(), and AlpsKnowledgePool::getMaxNumKnowledges().

virtual void AlpsKnowledgeBroker::setMaxNumKnowledges | ( | AlpsKnowledgeType | kt,
|  | int | num |
| ) |  |  | `[inline, virtual]`

Set the max number of knowledge can be stored in a given type o fknowledge pools.

Definition at line 357 of file AlpsKnowledgeBroker.h.

References AlpsKnowledgeTypeSolution, AlpsKnowledgeTypeSubTree, getKnowledgePool(), and AlpsKnowledgePool::setMaxNumKnowledges().

virtual bool AlpsKnowledgeBroker::hasKnowledge | ( | AlpsKnowledgeType | kt | ) | const`[inline, virtual]`

Query whether there are knowledges in the given type of knowledge pools.

Definition at line 369 of file AlpsKnowledgeBroker.h.

References AlpsKnowledgeTypeSolution, AlpsKnowledgeTypeSubTree, getKnowledgePool(), and AlpsKnowledgePool::hasKnowledge().

Referenced by AlpsKnowledgeBrokerSerial::getBestQuality(), and AlpsKnowledgeBrokerMPI::getIncumbentValue().

virtual std::pair<AlpsKnowledge*, double> AlpsKnowledgeBroker::getKnowledge | ( | AlpsKnowledgeType | kt | ) | const`[inline, virtual]`

Get a knowledge, but doesn't remove it from the pool.

Definition at line 379 of file AlpsKnowledgeBroker.h.

References AlpsKnowledgeTypeSolution, AlpsKnowledgeTypeSubTree, AlpsKnowledgePool::getKnowledge(), and getKnowledgePool().

virtual void AlpsKnowledgeBroker::popKnowledge | ( | AlpsKnowledgeType | kt | ) | `[inline, virtual]`

Remove the a knowledge from the given type of knowledge pools.

Definition at line 390 of file AlpsKnowledgeBroker.h.

References AlpsKnowledgeTypeSolution, AlpsKnowledgeTypeSubTree, getKnowledgePool(), and AlpsKnowledgePool::popKnowledge().

virtual std::pair<AlpsKnowledge*, double> AlpsKnowledgeBroker::getBestKnowledge | ( | AlpsKnowledgeType | kt | ) | const`[virtual]`

Get the best knowledge in the given type of knowledge pools.

Referenced by AlpsKnowledgeBrokerSerial::getBestQuality(), AlpsKnowledgeBrokerMPI::getBestQuality(), AlpsKnowledgeBrokerMPI::getIncumbentValue(), and AlpsKnowledgeBrokerSerial::printBestSolution().

virtual void AlpsKnowledgeBroker::getAllKnowledges | ( | AlpsKnowledgeType | kt,
|  | std::vector< std::pair< AlpsKnowledge *, double > > & | kls |
| ) |  |  | const`[inline, virtual]`

Get all knowledges in the given type of knowledge pools.

Definition at line 405 of file AlpsKnowledgeBroker.h.

References AlpsKnowledgeTypeSolution, AlpsKnowledgeTypeSubTree, AlpsKnowledgePool::getAllKnowledges(), and getKnowledgePool().

virtual void AlpsKnowledgeBroker::addKnowledge | ( | AlpsKnowledgeType | kt,
|  | AlpsKnowledge * | kl,
|  | double | value |
| ) |  |  | `[inline, virtual]`

Add a knowledge in the given type of knowledge pools.

Definition at line 418 of file AlpsKnowledgeBroker.h.

References AlpsKnowledgePool::addKnowledge(), AlpsKnowledgeTypeSolution, AlpsKnowledgeTypeSubTree, and getKnowledgePool().

int AlpsKnowledgeBroker::getNumNodesProcessed | ( |  | ) | const`[inline]`

Query the number of node processed by this process.

Definition at line 435 of file AlpsKnowledgeBroker.h.

References nodeProcessedNum_.

int AlpsKnowledgeBroker::getNumNodesBranched | ( |  | ) | const`[inline]`

Query the number of node processed by this process.

Definition at line 440 of file AlpsKnowledgeBroker.h.

References nodeBranchedNum_.

int AlpsKnowledgeBroker::getNumNodesDiscarded | ( |  | ) | const`[inline]`

Query the number of node processed by this process.

Definition at line 445 of file AlpsKnowledgeBroker.h.

References nodeDiscardedNum_.

int AlpsKnowledgeBroker::getNumNodesProcessedSystem | ( |  | ) | const`[inline]`

Query the number of node processed by the system.

Definition at line 450 of file AlpsKnowledgeBroker.h.

References systemNodeProcessed_.

virtual int AlpsKnowledgeBroker::updateNumNodesLeft | ( |  | ) | `[virtual]`

Update the number of left nodes on this process.

virtual AlpsTreeNode* AlpsKnowledgeBroker::getBestNode | ( |  | ) | const`[virtual]`

Query the best node in the subtree pool.

Return NULL if no node exits.

AlpsExitStatus AlpsKnowledgeBroker::getSolStatus | ( |  | ) | const`[inline]`

Query search termination status.

Definition at line 461 of file AlpsKnowledgeBroker.h.

References exitStatus_.

Referenced by AlpsKnowledgeBrokerSerial::printBestSolution().

void AlpsKnowledgeBroker::setExitStatus | ( | AlpsExitStatus | status | ) | `[inline]`

Set terminate status.

Definition at line 466 of file AlpsKnowledgeBroker.h.

References exitStatus_.

AlpsTimer& AlpsKnowledgeBroker::timer | ( |  | ) | `[inline]`

Query timer.

Definition at line 471 of file AlpsKnowledgeBroker.h.

References timer_.

AlpsTimer& AlpsKnowledgeBroker::subTreeTimer | ( |  | ) | `[inline]`

Query subtree timer.

Definition at line 476 of file AlpsKnowledgeBroker.h.

References subTreeTimer_.

AlpsTimer& AlpsKnowledgeBroker::tempTimer | ( |  | ) | `[inline]`

Query secondary timer.

Definition at line 481 of file AlpsKnowledgeBroker.h.

References tempTimer_.

virtual void AlpsKnowledgeBroker::searchLog | ( |  | ) | `[pure virtual]`

Search statistics log.

Implemented in AlpsKnowledgeBrokerMPI, and AlpsKnowledgeBrokerSerial.

int AlpsKnowledgeBroker::getNodeMemSize | ( |  | ) | `[inline]`

Definition at line 493 of file AlpsKnowledgeBroker.h.

References nodeMemSize_.

void AlpsKnowledgeBroker::setNodeMemSize | ( | int | ms | ) | `[inline]`

Definition at line 494 of file AlpsKnowledgeBroker.h.

References nodeMemSize_.

double AlpsKnowledgeBroker::getNodeProcessingTime | ( |  | ) | `[inline]`

Definition at line 501 of file AlpsKnowledgeBroker.h.

References nodeProcessingTime_.

void AlpsKnowledgeBroker::setNodeProcessingTime | ( | double | npTime | ) | `[inline]`

Definition at line 502 of file AlpsKnowledgeBroker.h.

References nodeProcessingTime_.

int AlpsKnowledgeBroker::getLargeSize | ( |  | ) | const`[inline]`

Definition at line 505 of file AlpsKnowledgeBroker.h.

References largeSize_.

virtual double AlpsKnowledgeBroker::getIncumbentValue | ( |  | ) | const`[pure virtual]`

The process queries the objective value of the incumbent that it stores.

Implemented in AlpsKnowledgeBrokerMPI, and AlpsKnowledgeBrokerSerial.

virtual double AlpsKnowledgeBroker::getBestQuality | ( |  | ) | const`[pure virtual]`

The process (serial) / the master (parallel) queries the quality of the best solution that it knows.

Implemented in AlpsKnowledgeBrokerMPI, and AlpsKnowledgeBrokerSerial.

virtual double AlpsKnowledgeBroker::getBestEstimateQuality | ( |  | ) | `[inline, virtual]`

Get best estimalted quality in system.

Reimplemented in AlpsKnowledgeBrokerMPI.

Definition at line 520 of file AlpsKnowledgeBroker.h.

References ALPS_OBJ_MAX.

virtual int AlpsKnowledgeBroker::getNumNodeLeftSystem | ( |  | ) | `[inline, virtual]`

The process queries the objective value of the incumbent that it stores.

Reimplemented in AlpsKnowledgeBrokerMPI.

Definition at line 522 of file AlpsKnowledgeBroker.h.

References nodeLeftNum_.

virtual void AlpsKnowledgeBroker::printBestSolution | ( | char * | outputFile = `0` | ) | const`[pure virtual]`

The process (serial) / the master (parallel) outputs the best solution that it knows to a file or std::out.

Implemented in AlpsKnowledgeBrokerMPI, and AlpsKnowledgeBrokerSerial.

virtual int AlpsKnowledgeBroker::getProcRank | ( |  | ) | const`[inline, virtual]`

Qeury the global rank of process.

Note: not useful for serial code.

Reimplemented in AlpsKnowledgeBrokerMPI.

Definition at line 530 of file AlpsKnowledgeBroker.h.

virtual int AlpsKnowledgeBroker::getMasterRank | ( |  | ) | const`[inline, virtual]`

Query the global rank of the Master.

Reimplemented in AlpsKnowledgeBrokerMPI.

Definition at line 533 of file AlpsKnowledgeBroker.h.

virtual AlpsProcessType AlpsKnowledgeBroker::getProcType | ( |  | ) | const`[inline, virtual]`

Query the type (master, hub, or worker) of the process.

Reimplemented in AlpsKnowledgeBrokerMPI.

Definition at line 536 of file AlpsKnowledgeBroker.h.

References AlpsProcessTypeSerial.

AlpsNodeIndex_t AlpsKnowledgeBroker::nextNodeIndex | ( |  | ) | `[inline]`

Query the next index assigned to a newly created node, and then increment the nextIndex_ by 1.

Definition at line 545 of file AlpsKnowledgeBroker.h.

References nextIndex_.

AlpsNodeIndex_t AlpsKnowledgeBroker::getNextNodeIndex | ( |  | ) | const`[inline]`

Query the next index assigned to a newly created node.

Definition at line 548 of file AlpsKnowledgeBroker.h.

References nextIndex_.

void AlpsKnowledgeBroker::setNextNodeIndex | ( | AlpsNodeIndex_t | s | ) | `[inline]`

Set nextIndex_.

Definition at line 551 of file AlpsKnowledgeBroker.h.

References nextIndex_.

AlpsNodeIndex_t AlpsKnowledgeBroker::getMaxNodeIndex | ( |  | ) | const`[inline]`

Queriy the upper bound of node indices.

Definition at line 554 of file AlpsKnowledgeBroker.h.

References maxIndex_.

void AlpsKnowledgeBroker::setMaxNodeIndex | ( | AlpsNodeIndex_t | s | ) | `[inline]`

Set the upper bound of node indices.

Definition at line 557 of file AlpsKnowledgeBroker.h.

References maxIndex_.

AlpsSearchStrategy<AlpsSubTree*>* AlpsKnowledgeBroker::getSubTreeSelection | ( |  | ) | const`[inline]`

Definition at line 564 of file AlpsKnowledgeBroker.h.

References treeSelection_.

void AlpsKnowledgeBroker::setSubTreeSelection | ( | AlpsSearchStrategy< AlpsSubTree * > * | tc | ) | `[inline]`

Definition at line 567 of file AlpsKnowledgeBroker.h.

References AlpsSubTreePool::setComparison(), subTreePool_, and treeSelection_.

AlpsSearchStrategy<AlpsTreeNode*>* AlpsKnowledgeBroker::getNodeSelection | ( |  | ) | const`[inline]`

Definition at line 572 of file AlpsKnowledgeBroker.h.

References nodeSelection_.

void AlpsKnowledgeBroker::setNodeSelection | ( | AlpsSearchStrategy< AlpsTreeNode * > * | nc | ) | `[inline]`

Definition at line 575 of file AlpsKnowledgeBroker.h.

References nodeSelection_.

AlpsSearchStrategy<AlpsTreeNode*>* AlpsKnowledgeBroker::getRampUpNodeSelection | ( |  | ) | const`[inline]`

Definition at line 579 of file AlpsKnowledgeBroker.h.

References rampUpNodeSelection_.

void AlpsKnowledgeBroker::setRampUpNodeSelection | ( | AlpsSearchStrategy< AlpsTreeNode * > * | nc | ) | `[inline]`

Definition at line 582 of file AlpsKnowledgeBroker.h.

References rampUpNodeSelection_.

void AlpsKnowledgeBroker::passInMessageHandler | ( | CoinMessageHandler * | handler | ) |

Pass in Message handler (not deleted at end).

void AlpsKnowledgeBroker::newLanguage | ( | CoinMessages::Language | language | ) |

Set language.

Referenced by setLanguage().

void AlpsKnowledgeBroker::setLanguage | ( | CoinMessages::Language | language | ) | `[inline]`

Pass in Message handler (not deleted at end).

Definition at line 595 of file AlpsKnowledgeBroker.h.

References newLanguage().

CoinMessageHandler* AlpsKnowledgeBroker::messageHandler | ( |  | ) | const`[inline]`

Return handler.

Definition at line 599 of file AlpsKnowledgeBroker.h.

References handler_.

CoinMessages AlpsKnowledgeBroker::messages | ( |  | ) | `[inline]`

Return messages.

Definition at line 602 of file AlpsKnowledgeBroker.h.

References messages_.

CoinMessages* AlpsKnowledgeBroker::messagesPointer | ( |  | ) | `[inline]`

Return pointer to messages.

Definition at line 605 of file AlpsKnowledgeBroker.h.

References messages_.

int AlpsKnowledgeBroker::getMsgLevel | ( |  | ) | `[inline]`

Return msg level.

Definition at line 608 of file AlpsKnowledgeBroker.h.

References msgLevel_.

int AlpsKnowledgeBroker::getHubMsgLevel | ( |  | ) | `[inline]`

Return msg level.

Definition at line 611 of file AlpsKnowledgeBroker.h.

References hubMsgLevel_.

int AlpsKnowledgeBroker::getMasterMsgLevel | ( |  | ) | `[inline]`

Return msg level.

Definition at line 614 of file AlpsKnowledgeBroker.h.

References workerMsgLevel_.

int AlpsKnowledgeBroker::getlogFileLevel | ( |  | ) | `[inline]`

Return log file level.

Definition at line 617 of file AlpsKnowledgeBroker.h.

References logFileLevel_.

int AlpsKnowledgeBroker::getNumNodeLog | ( |  | ) | const`[inline]`

Get times that node log has been printed.

Definition at line 620 of file AlpsKnowledgeBroker.h.

References numNodeLog_.

void AlpsKnowledgeBroker::setNumNodeLog | ( | int | num | ) | `[inline]`

Get times that node log has been printed.

Definition at line 623 of file AlpsKnowledgeBroker.h.

References numNodeLog_.

## Member Data Documentation

std::map<int, AlpsKnowledge*> AlpsKnowledgeBroker::decodeMap_`[private]`

Stores registered knowledge.

Definition at line 56 of file AlpsKnowledgeBroker.h.

Referenced by decoderObject(), and registerClass().

std::string AlpsKnowledgeBroker::instanceName_`[protected]`

The instance name.

Definition at line 61 of file AlpsKnowledgeBroker.h.

AlpsModel* AlpsKnowledgeBroker::model_`[protected]`

Pointer to model.

Definition at line 64 of file AlpsKnowledgeBroker.h.

Referenced by getModel(), and setModel().

AlpsPhase AlpsKnowledgeBroker::phase_`[protected]`

Alps phase.

(RAMPUP, SEARCH, RAMPDOWN)

Definition at line 67 of file AlpsKnowledgeBroker.h.

Referenced by getPhase(), and setPhase().

AlpsSubTreePool* AlpsKnowledgeBroker::subTreePool_`[protected]`

A subtree pool holding a collection of subtrees.

For serial version, there is only one subtree in the pool.

Definition at line 75 of file AlpsKnowledgeBroker.h.

Referenced by setSubTreeSelection().

AlpsSolutionPool* AlpsKnowledgeBroker::solPool_`[protected]`

A solution pool containing the solutions found.

Definition at line 78 of file AlpsKnowledgeBroker.h.

std::map<AlpsKnowledgeType, AlpsKnowledgePool*>* AlpsKnowledgeBroker::pools_`[protected]`

The collection of pools managed by the knowledge broker.

Definition at line 81 of file AlpsKnowledgeBroker.h.

Referenced by addKnowledgePool(), and getKnowledgePool().

AlpsSubTree* AlpsKnowledgeBroker::workingSubTree_`[protected]`

Point to the subtree that being explored.

Definition at line 89 of file AlpsKnowledgeBroker.h.

bool AlpsKnowledgeBroker::needWorkingSubTree_`[protected]`

Indicate whether need a new subtree.

Definition at line 92 of file AlpsKnowledgeBroker.h.

AlpsNodeIndex_t AlpsKnowledgeBroker::nextIndex_`[protected]`

The index to be assigned to a new search tree node.

Definition at line 95 of file AlpsKnowledgeBroker.h.

Referenced by getNextNodeIndex(), nextNodeIndex(), and setNextNodeIndex().

AlpsNodeIndex_t AlpsKnowledgeBroker::maxIndex_`[protected]`

The maximum index can been assigned on this process.

Definition at line 98 of file AlpsKnowledgeBroker.h.

Referenced by getMaxNodeIndex(), and setMaxNodeIndex().

AlpsTimer AlpsKnowledgeBroker::timer_`[protected]`

Main timer.

Do not touch.

Definition at line 107 of file AlpsKnowledgeBroker.h.

Referenced by timer().

AlpsTimer AlpsKnowledgeBroker::subTreeTimer_`[protected]`

Subtree timer.

Do not touch.

Definition at line 110 of file AlpsKnowledgeBroker.h.

Referenced by subTreeTimer().

AlpsTimer AlpsKnowledgeBroker::tempTimer_`[protected]`

Secondary timer.

Definition at line 113 of file AlpsKnowledgeBroker.h.

Referenced by tempTimer().

int AlpsKnowledgeBroker::solNum_`[protected]`

The number of solutions found.

Definition at line 116 of file AlpsKnowledgeBroker.h.

int AlpsKnowledgeBroker::nodeProcessedNum_`[protected]`

The number of nodes that have been processed.

Definition at line 119 of file AlpsKnowledgeBroker.h.

Referenced by getNumNodesProcessed().

int AlpsKnowledgeBroker::nodeBranchedNum_`[protected]`

The number of nodes that have been branched.

Definition at line 122 of file AlpsKnowledgeBroker.h.

Referenced by getNumNodesBranched().

int AlpsKnowledgeBroker::nodeDiscardedNum_`[protected]`

The number of nodes that have been discarded before processing.

Definition at line 125 of file AlpsKnowledgeBroker.h.

Referenced by getNumNodesDiscarded().

int AlpsKnowledgeBroker::systemNodeProcessed_`[protected]`

To record how many nodes processed by the system (used in parallel code).

Definition at line 129 of file AlpsKnowledgeBroker.h.

Referenced by getNumNodesProcessedSystem().

int AlpsKnowledgeBroker::nodeLeftNum_`[protected]`

The number of nodes left.

Definition at line 132 of file AlpsKnowledgeBroker.h.

Referenced by getNumNodeLeftSystem().

int AlpsKnowledgeBroker::treeDepth_`[protected]`

The depth of the tree.

Definition at line 135 of file AlpsKnowledgeBroker.h.

Referenced by getTreeDepth().

int AlpsKnowledgeBroker::bestSolDepth_`[protected]`

The depth of the node that with best solution.

Definition at line 138 of file AlpsKnowledgeBroker.h.

Referenced by getBestSolDepth(), and setBestSolDepth().

int AlpsKnowledgeBroker::bestSolNode_`[protected]`

The number of nodes pocessed to find the solution.

Definition at line 141 of file AlpsKnowledgeBroker.h.

double AlpsKnowledgeBroker::peakMemory_`[protected]`

Peak memory usage.

Definition at line 144 of file AlpsKnowledgeBroker.h.

Referenced by getPeakMemory(), and setPeakMemory().

AlpsExitStatus AlpsKnowledgeBroker::exitStatus_`[protected]`

The status of search when terminated.

Definition at line 147 of file AlpsKnowledgeBroker.h.

Referenced by getSolStatus(), and setExitStatus().

AlpsSearchStrategy<AlpsSubTree*>* AlpsKnowledgeBroker::treeSelection_`[protected]`

Tree selection criterion.

Definition at line 155 of file AlpsKnowledgeBroker.h.

Referenced by getSubTreeSelection(), and setSubTreeSelection().

AlpsSearchStrategy<AlpsTreeNode*>* AlpsKnowledgeBroker::nodeSelection_`[protected]`

Node selection criterion.

Definition at line 158 of file AlpsKnowledgeBroker.h.

Referenced by getNodeSelection(), and setNodeSelection().

AlpsSearchStrategy<AlpsTreeNode*>* AlpsKnowledgeBroker::rampUpNodeSelection_`[protected]`

Node selection criterion.

Definition at line 161 of file AlpsKnowledgeBroker.h.

Referenced by getRampUpNodeSelection(), and setRampUpNodeSelection().

CoinMessageHandler* AlpsKnowledgeBroker::handler_`[protected]`

Message handler.

Definition at line 169 of file AlpsKnowledgeBroker.h.

Referenced by messageHandler().

CoinMessages AlpsKnowledgeBroker::messages_`[protected]`

Alps messages.

Definition at line 172 of file AlpsKnowledgeBroker.h.

Referenced by messages(), and messagesPointer().

int AlpsKnowledgeBroker::msgLevel_`[protected]`

The leve of printing message to screen of the master and general message.

(0: no; 1: basic; 2: moderate, 3: verbose)

Definition at line 176 of file AlpsKnowledgeBroker.h.

Referenced by getMsgLevel(), and AlpsKnowledgeBrokerSerial::printBestSolution().

int AlpsKnowledgeBroker::hubMsgLevel_`[protected]`

The leve of printing message to screen of hubs.

(0: no; 1: basic; 2: moderate, 3: verbose)

Definition at line 180 of file AlpsKnowledgeBroker.h.

Referenced by getHubMsgLevel().

int AlpsKnowledgeBroker::workerMsgLevel_`[protected]`

The leve of printing message to screen of workers.

(0: no; 1: basic; 2: moderate, 3: verbose)

Definition at line 184 of file AlpsKnowledgeBroker.h.

Referenced by getMasterMsgLevel().

int AlpsKnowledgeBroker::logFileLevel_`[protected]`

The degree of log file.

(0: no; 1: basic; 2: moderate, 3: verbose)

Definition at line 188 of file AlpsKnowledgeBroker.h.

Referenced by getlogFileLevel().

std::string AlpsKnowledgeBroker::logfile_`[protected]`

The log file.

Definition at line 191 of file AlpsKnowledgeBroker.h.

int AlpsKnowledgeBroker::nodeMemSize_`[protected]`

The approximate memory size (bytes) of a node with full description.

Definition at line 195 of file AlpsKnowledgeBroker.h.

Referenced by getNodeMemSize(), and setNodeMemSize().

double AlpsKnowledgeBroker::nodeProcessingTime_`[protected]`

The approximately CPU time to process a node.

Definition at line 198 of file AlpsKnowledgeBroker.h.

Referenced by getNodeProcessingTime(), and setNodeProcessingTime().

int AlpsKnowledgeBroker::largeSize_`[protected]`

The size of largest message buffer can be sent or received.

Definition at line 201 of file AlpsKnowledgeBroker.h.

Referenced by getLargeSize().

bool AlpsKnowledgeBroker::userBalancePeriod_`[protected]`

Has user input balance period.

Definition at line 204 of file AlpsKnowledgeBroker.h.

int AlpsKnowledgeBroker::numNodeLog_`[protected]`

Times that node log is printed.

Definition at line 207 of file AlpsKnowledgeBroker.h.

Referenced by getNumNodeLog(), and setNumNodeLog().

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

- /home/coin/SVN-release/Blis-0.92.0/Alps/src/AlpsKnowledgeBroker.h