2 #include <samchon/example/interaction/Slave.hpp> 4 #include <samchon/example/packer/Packer.hpp> 5 #include <samchon/protocol/Invoke.hpp> 15 using namespace library;
16 using namespace protocol;
60 virtual void optimize(shared_ptr<XML> xml,
size_t index,
size_t size)
override 62 super::optimize(xml, index, size);
65 packer.construct(xml);
68 cout << packer.
toString() << endl << endl;
69 sendOptimization(packer.
toXML());
84 cout <<
"----------------------------------------------------------------------------" << endl;
85 cout <<
" PACKER SLAVE" << endl;
86 cout <<
"----------------------------------------------------------------------------" << endl;
87 cout <<
" ip: "; cin >> ip;
88 cout <<
" port: "; cin >> port;
PackerSlave(const string &ip, int port)
Construct from ip and port of the master.
A slave system for solving Packer.
virtual void optimize(shared_ptr< XML > xml, size_t index, size_t size) override
Optimize TSP and report the result.
virtual void start() override
Start interaction.
static void main()
Main function.
auto toString() const -> string
Return a string represents an packaging method.
A packer planning the best packaging.
A slave system for optimizing something.
virtual auto toXML() const -> shared_ptr< XML > override
Get an XML object represents the EntityGroup.
Top level namespace of products built from samchon.
void optimize(size_t start=0, size_t size=-1)
Find the best packaging method.