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

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

#include <PackerMaster.hpp>

Collaboration diagram for samchon::example::interaction::PackerMaster:

Public Member Functions

 PackerMaster ()
 Default Constructor. More...
- Public Member Functions inherited from samchon::example::interaction::Master
 Master (int port)
 Construct from a port number to listen. More...

Static Public Member Functions

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

Protected Member Functions

virtual void optimize (shared_ptr< XML > xml) override
 Optimize something. More...
virtual void replyOptimization (shared_ptr< XML > xml) override
 Handle (replied) optimized value from a slave system. More...

Protected Attributes

shared_ptr< packer::Packer > packer
 A packer solver. More...
- Protected Attributes inherited from samchon::example::interaction::Master
unique_ptr< ChiefDriverchiefDriver
 A boundary object interacting with a Cheif. More...
mutex mtx
 A mutex for optimization. More...
size_t optimized
 Number of slaves who'd completed an optimization. More...

Detailed Description

A master of parallel system solving packaging problem.


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.

See also
Jeongho Nam
Jeongho Nam

Definition at line 31 of file PackerMaster.hpp.

Constructor & Destructor Documentation

samchon::example::interaction::PackerMaster::PackerMaster ( )

Default Constructor.

Definition at line 50 of file PackerMaster.hpp.

Member Function Documentation

virtual void samchon::example::interaction::PackerMaster::optimize ( shared_ptr< XML xml)

Optimize something.

Master gets an XML object representing parametric value and basic data used for optimzation are came from Cheif. Master constructs some object to optimize and distributes the optimization order to master's slave systems by segmentation.

xmlXML object representing parametric value and basic data used for optimization.

Reimplemented from samchon::example::interaction::Master.

Definition at line 61 of file PackerMaster.hpp.

virtual void samchon::example::interaction::PackerMaster::replyOptimization ( shared_ptr< XML xml)

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.

xmlXML object representing the optimized value.

Implements samchon::example::interaction::Master.

Definition at line 79 of file PackerMaster.hpp.

static void samchon::example::interaction::PackerMaster::main ( )

Main functino.

Definition at line 109 of file PackerMaster.hpp.

Member Data Documentation

shared_ptr<packer::Packer> samchon::example::interaction::PackerMaster::packer

A packer solver.

Definition at line 41 of file PackerMaster.hpp.

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