Samchon Framework for CPP  1.0.0
samchon::example::interaction::PackerMediator Class Reference

A mediator of parallel system solving packaging problem. More...

#include <PackerMediator.hpp>

Public Member Functions

 PackerMediator ()
 Default Constructor. More...
 

Static Public Member Functions

static void main ()
 Main functino. More...
 

Protected Member Functions

void replyOptimization (std::shared_ptr< library::XML > xml)
 Handle (replied) optimized value from a slave system. More...
 

Protected Attributes

std::shared_ptr< packer::Packer > packer
 A packer solver. More...
 
std::mutex mtx
 A mutex for optimization. More...
 
size_t optimized
 Number of slaves who'd completed an optimization. More...
 

Detailed Description

A mediator of parallel system solving packaging problem.

PackerMediator is a class representing mediator class of tree-structured parallel processing system solving packaging problem.

Packer mediator system is placed on between master and slave systems. It can be a slave system for its master, and also can be a master system for its own slave systems. Mediator is a class representing mediator class of parallel processing system.

The PackerMediator is built for providing a guidance of building a mediator system in a tree-structured parallel processing system. You can also learn how to utilize master module in protocol by following the example.

[Inherited] PackerMaster
[Inherited]

Master is an abstract and example class, for providing guidance of realizing parallel processing system for users, within framework of master. The Master class represents a master of parallel processing system in the master side.

A master system (represented by Master and MasterDriver) is associated with a chief system (represented by Cheif and CheifDriver) and slave systems (Slave and SlaveDriver). The master system gets optimization order from chief system and shifts and distributes orders to its slave systems. When slave systems report optimization result, the master system aggregates those results and reports the aggregated results to chief system.

example_interaction.png
example_interaction_network_diagram.png
[Inherited]
See also
master
Author
Jeongho Nam http://samchon.org
Jeongho Nam http://samchon.org
[Inherited] ParallelClientArrayMediator
Author
Jeongho Nam http://samchon.org

Definition at line 44 of file PackerMediator.hpp.

Constructor & Destructor Documentation

samchon::example::interaction::PackerMediator::PackerMediator ( )
inline

Default Constructor.

Definition at line 76 of file PackerMediator.hpp.

References replyOptimization().

Here is the call graph for this function:

Member Function Documentation

void samchon::example::interaction::PackerMediator::replyOptimization ( std::shared_ptr< library::XML xml)
inlineprotected

Handle (replied) optimized value from a slave system.

When gets optimization result from Slave systems, Master aggregates them and derives the best solution between those results and reports the best solution to the Cheif system.

Parameters
xmlXML object representing the optimized value.

Definition at line 132 of file PackerMediator.hpp.

References packer.

Referenced by PackerMediator().

Here is the caller graph for this function:

static void samchon::example::interaction::PackerMediator::main ( )
inlinestatic

Main functino.

Definition at line 162 of file PackerMediator.hpp.

Member Data Documentation

std::shared_ptr<packer::Packer> samchon::example::interaction::PackerMediator::packer
protected

A packer solver.

Definition at line 54 of file PackerMediator.hpp.

Referenced by replyOptimization().

std::mutex samchon::example::interaction::PackerMediator::mtx
protected

A mutex for optimization.

The mutex exists for ensuring concurrency of aggregation of optimization reported from slave systems.

Definition at line 62 of file PackerMediator.hpp.

size_t samchon::example::interaction::PackerMediator::optimized
protected

Number of slaves who'd completed an optimization.

Definition at line 67 of file PackerMediator.hpp.


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