Samchon Framework for CPP
1.0.0
|
Represent a travel containning Point(s) More...
#include <Travel.hpp>
Public Member Functions | |
Travel () | |
Default Constructor. More... | |
Travel (const Travel &travel) | |
Copy Constructor. More... | |
Travel (Travel &&travel) | |
Move Constructor. More... | |
auto | calcDistance () const -> double |
Calculate distance to move. More... | |
auto | operator< (const Travel &travel) const -> bool |
Compare which object is less. More... | |
virtual auto | CHILD_TAG () const -> string override |
A tag name of children. More... | |
virtual auto | toXML () const -> shared_ptr< XML > override |
Get an XML object represents the EntityGroup. More... | |
auto | toString () const -> string |
Convert the Travel to String. More... | |
Public Member Functions inherited from samchon::protocol::EntityGroup< Container, T, Key > | |
virtual void | construct (std::shared_ptr< library::XML > xml) |
Construct data of the Entity from an XML object. More... | |
auto | find (const typename child_type::key_type &key) -> typename container_type::iterator |
Get iterator to element. More... | |
auto | find (const typename child_type::key_type &key) const -> typename container_type::const_iterator |
Get const iterator to element. More... | |
auto | has (const typename child_type::key_type &key) const -> bool |
Indicates whether a container has an object having the specified identifier. More... | |
auto | count (const typename child_type::key_type &key) const -> size_t |
Count elements with a specific key. More... | |
auto | get (const typename child_type::key_type &key) -> typename container_type::value_type & |
Access the element by specified identifier(key). More... | |
auto | get (const typename child_type::key_type &key) const -> const typename container_type::value_type & |
Access the const element by specified identifier(key). More... | |
Public Member Functions inherited from samchon::protocol::Entity< Key > | |
virtual auto | key () const -> Key |
Get a key that can identify the Entity uniquely. More... | |
Protected Attributes | |
double | distance |
Estimated hours to move. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from samchon::protocol::EntityGroup< Container, T, Key > | |
virtual auto | createChild (std::shared_ptr< library::XML >) -> child_type *=0 |
Factory method of a child Entity. More... | |
Represent a travel containning Point(s)
Travel class is not only an array containing Point(s) but also a sequence listing of the Point(s).
Definition at line 27 of file Travel.hpp.
|
inline |
Default Constructor.
Definition at line 49 of file Travel.hpp.
|
inline |
Copy Constructor.
Travel is an array of Point(s) as gene(s). The copy constructor of Travel doesn't copy member variables which are related to G.A. because the sequence of gene(Point)s can be shuffled by process of evolution of genetic algorithm.
Definition at line 63 of file Travel.hpp.
|
inline |
Move Constructor.
Definition at line 72 of file Travel.hpp.
|
inline |
Calculate distance to move.
Definition at line 103 of file Travel.hpp.
|
inline |
Compare which object is less.
Compares distances to move. The result is used to optimize and evolve genes by G.A.
Target | object to compare |
Definition at line 124 of file Travel.hpp.
|
inlineoverridevirtual |
A tag name of children.
< TAG>
<CHILD_TAG />
<CHILD_TAG />
</TAG>
Implements samchon::protocol::EntityGroupBase.
Definition at line 136 of file Travel.hpp.
|
inlineoverridevirtual |
Get an XML object represents the EntityGroup.
Archives the EntityGroup's own member variables only to the returned XML object.
Do not consider about archiving children Entity objects' data in EntityGroup::toXML(). Those children Entity objects will converted to XML object by their own toXML() method. The insertion of XML objects representing children are done by abstract method of EntityGroup::toXML().
Archives only data of EntityGroup's own.
Reimplemented from samchon::protocol::EntityGroup< Container, T, Key >.
Definition at line 141 of file Travel.hpp.
|
inline |
Convert the Travel to String.
Have of form of tab and enter delimeters for Excel.
{$uid1} {$x} {$y}
{$uid2} {$x} {$y}
{$uid3} {$x} {$y}
...
Definition at line 162 of file Travel.hpp.
References samchon::library::StringUtil::numberFormat().
|
protected |
Estimated hours to move.
A variable for avoiding duplicated calculation
Definition at line 40 of file Travel.hpp.