2 #include <samchon/protocol/ExternalServerArray.hpp> 3 #include <samchon/example/interaction/MasterDriver.hpp> 5 #include <samchon/protocol/Invoke.hpp> 7 #include <samchon/example/packer/Packer.hpp> 8 #include <samchon/example/tsp/Scheduler.hpp> 20 using namespace library;
21 using namespace protocol;
63 emplace_back(
new MasterDriver(
this,
"TSP",
"127.0.0.1", 37110));
64 emplace_back(
new MasterDriver(
this,
"Reporter", ip, 37200));
65 emplace_back(
new MasterDriver(
this,
"Packer", ip, 37310));
67 virtual ~
Chief() =
default;
80 cout <<
"1. TSP Solver, 2. Packer: ";
102 virtual void replyData(shared_ptr<Invoke> invoke)
104 get(
"Reporter")->sendData(invoke);
121 productArray->emplace_back(
new packer::Product(
"Eraser", 500, 10, 70) );
122 productArray->emplace_back(
new packer::Product(
"Pencil", 400, 30, 35) );
123 productArray->emplace_back(
new packer::Product(
"Pencil", 400, 30, 35) );
124 productArray->emplace_back(
new packer::Product(
"Pencil", 400, 30, 35) );
125 productArray->emplace_back(
new packer::Product(
"Book", 8000, 150, 300) );
126 productArray->emplace_back(
new packer::Product(
"Book", 8000, 150, 300) );
127 productArray->emplace_back(
new packer::Product(
"Drink", 1000, 75, 250) );
128 productArray->emplace_back(
new packer::Product(
"Umbrella", 4000, 200, 1000) );
129 productArray->emplace_back(
new packer::Product(
"Notebook-PC", 800000, 150, 850) );
130 productArray->emplace_back(
new packer::Product(
"Tablet-PC", 600000, 120, 450) );
140 get(
"Packer")->sendData
160 shared_ptr<tsp::Travel> travel = make_shared<tsp::Travel>();
161 for(
int i = 0; i < 20; i++)
169 get(
"TSP")->sendData(make_shared<Invoke>(
"optimize", scheduler.
toXML()));
183 cout <<
"----------------------------------------------------------------------------" << endl;
184 cout <<
" CHIEF" << endl;
185 cout <<
"----------------------------------------------------------------------------" << endl;
186 cout <<
" ip: "; cin >> ip;
virtual auto toXML() const -> shared_ptr< XML > override
Get an XML object represents the Entity.
An array of wrapper with same category (name).
void callTSP()
Call tsp master system.
Parameters for Genetic-Algorithm.
A driver for each system, master.
An array of ExternalServer(s)
virtual void start()
Start interaction.
A chief system managing master systems.
void callPacker()
Call packer master system.
An array of Product objects.
A network driver for an external system.
A geometry coordinates (point)
A packer planning the best packaging.
static void main()
Main function.
virtual auto toXML() const -> shared_ptr< XML > override
Get an XML object represents the EntityGroup.
Top level namespace of products built from samchon.
Chief(const string &ip)
Construct from ip address.