Samchon Framework for CPP  1.0.0
samchon::example::tsp::Scheduler Class Reference

A scheduler. More...

#include <Scheduler.hpp>

Collaboration diagram for samchon::example::tsp::Scheduler:

Public Member Functions

 Scheduler ()
 Default Constructor. More...
 
 Scheduler (shared_ptr< Travel > travel, const struct GAParameters &gaParameteres)
 Construct from points and parameter of genetic algorithm. More...
 
auto optimize () -> shared_ptr< Travel >
 Derive optimized schedule. More...
 
virtual auto TAG () const -> string override
 A tag name when represented by XML. More...
 
virtual auto toXML () const -> shared_ptr< XML > override
 Get an XML object represents the Entity. More...
 
- Public Member Functions inherited from samchon::protocol::Entity
 Entity ()
 Default Constructor. More...
 
virtual void construct (std::shared_ptr< library::XML >)=0
 Construct data of the Entity from an XML object. More...
 
virtual auto key () const -> std::string
 Get a key that can identify the Entity uniquely. More...
 

Protected Attributes

shared_ptr< Traveltravel
 A travel to optimize or optimized. More...
 
struct GAParameters gaParameters
 Parameters for Genetic-Algorithm. More...
 

Detailed Description

A scheduler.

Scheduler deducts an optimal schdule(Travel) by genetic algorithm.

Author
Jeongho Nam http://samchon.org

Definition at line 46 of file Scheduler.hpp.

Constructor & Destructor Documentation

samchon::example::tsp::Scheduler::Scheduler ( )
inline

Default Constructor.

Definition at line 70 of file Scheduler.hpp.

samchon::example::tsp::Scheduler::Scheduler ( shared_ptr< Travel travel,
const struct GAParameters gaParameteres 
)
inline

Construct from points and parameter of genetic algorithm.

Definition at line 80 of file Scheduler.hpp.

Member Function Documentation

auto samchon::example::tsp::Scheduler::optimize ( ) -> shared_ptr<Travel>
inline

Derive optimized schedule.

Returns
An optimized travel schedule.

Definition at line 108 of file Scheduler.hpp.

References samchon::library::GeneticAlgorithm< GeneArray, Compare, Gene >::evolveGeneArray().

Referenced by samchon::example::interaction::TSPSlave::optimize(), and toXML().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual auto samchon::example::tsp::Scheduler::TAG ( ) const -> string
inlineoverridevirtual

A tag name when represented by XML.

Returns
A tag name

Implements samchon::protocol::Entity.

Definition at line 136 of file Scheduler.hpp.

virtual auto samchon::example::tsp::Scheduler::toXML ( ) const -> shared_ptr<XML>
inlineoverridevirtual

Get an XML object represents the Entity.

Returns an XML object that can represents the Entity containing member variables into properties.

A member variable (not object, but atomic value like number, string or date) is categorized as a property within the framework of entity side. Thus, when overriding a toXML() method and archiving member variables to an XML object to return, puts each variable to be a property belongs to only an XML object.

Don't archive the member variable of atomic value to XML::value causing enormouse creation of XML objects to number of member variables. An Entity must be represented by only an XML instance (tag).

Standard Usage Non-standard usage abusing value
<memberList>
     <member id='jhnam88' name='Jeongho+Nam' birthdate='1988-03-11' />
     <member id='master' name='Administartor' birthdate='2011-07-28' />
</memberList>
<member>
     <id>jhnam88</id>
     <name>Jeongho+Nam</name>
     <birthdate>1988-03-11</birthdate>
</member>
Returns
An XML object representing the Entity.

Reimplemented from samchon::protocol::Entity.

Definition at line 141 of file Scheduler.hpp.

References optimize().

Referenced by samchon::example::interaction::Chief::callTSP(), and samchon::example::interaction::TSPSlave::optimize().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

shared_ptr<Travel> samchon::example::tsp::Scheduler::travel
protected

A travel to optimize or optimized.

Definition at line 56 of file Scheduler.hpp.

struct GAParameters samchon::example::tsp::Scheduler::gaParameters
protected

Parameters for Genetic-Algorithm.

Definition at line 61 of file Scheduler.hpp.


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