LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
rcsc::FormationDT Class Reference

formation which utilizes Delaunay Triangulation More...

#include <formation_dt.h>

Inheritance diagram for rcsc::FormationDT:
Inheritance graph
[legend]
Collaboration diagram for rcsc::FormationDT:
Collaboration graph
[legend]

Public Member Functions

 FormationDT ()
 just call the base class constructor to initialize formation method name
 
const std::vector< FormationData::Data > & points () const
 get the sample data array More...
 
const DelaunayTriangulationtriangulation () const
 get the delaunay triangulation More...
 
virtual std::string methodName () const override
 get the method name of the formation model More...
 
virtual Vector2D getPosition (const int num, const Vector2D &focus_point) const override
 get position for the current focus point More...
 
virtual void getPositions (const Vector2D &focus_point, std::vector< Vector2D > &positions) const override
 get all positions for the current focus point More...
 
virtual bool train (const FormationData &data) override
 update formation paramter using training data set More...
 
virtual FormationData::Ptr toData () const override
 create data for the editor More...
 
- Public Member Functions inherited from rcsc::Formation
virtual ~Formation ()
 destructor.
 
const std::string & version () const
 get the version string More...
 
const std::array< std::string, 11 > & roleNames () const
 get the role name array More...
 
const std::array< RoleType, 11 > & roleTypes () const
 get the role type array More...
 
const std::array< int, 11 > & positionPairs () const
 get the position pair array More...
 
std::string roleName (const int num) const
 get role name value More...
 
RoleType roleType (const int num) const
 get role type value More...
 
int pairedNumber (const int num) const
 get paired position number More...
 
bool setVersion (const std::string &ver)
 set the version string More...
 
bool setRoleName (const int num, const std::string &name)
 set the role name More...
 
bool setRoleType (const int num, const RoleType &type)
 set the role type More...
 
bool setPositionPair (const int num, const int paired_num)
 set the position pair More...
 
bool setRole (const int num, const std::string &name, const RoleType &type, const int paired_num)
 set role data More...
 
virtual std::string methodName () const =0
 get the method name of the formation model More...
 
virtual Vector2D getPosition (const int num, const Vector2D &focus_point) const =0
 get position for the current focus point More...
 
virtual void getPositions (const Vector2D &focus_point, std::vector< Vector2D > &positions) const =0
 get all positions for the current focus point More...
 
virtual bool train (const FormationData &data)=0
 update formation paramter using training data set More...
 
virtual FormationData::Ptr toData () const =0
 create data for the editor More...
 
bool print (std::ostream &os) const
 print formation model to the output stream More...
 

Static Public Member Functions

static Formation::Ptr create ()
 static factory method. create new object More...
 
- Static Public Member Functions inherited from rcsc::Formation
static Ptr create (const std::string &name)
 create a formation instance based on the input name. More...
 

Static Public Attributes

static const std::string NAME
 type name
 

Protected Member Functions

virtual bool printData (std::ostream &os) const override
 print model data More...
 
- Protected Member Functions inherited from rcsc::Formation
 Formation ()
 initialize paired position number array with 0
 
bool printVersion (std::ostream &os) const
 print version string More...
 
bool printMethodName (std::ostream &os) const
 print method name More...
 
bool printRoles (std::ostream &os) const
 print role array More...
 
virtual bool printData (std::ostream &os) const =0
 print model data More...
 

Additional Inherited Members

- Public Types inherited from rcsc::Formation
typedef std::shared_ptr< FormationPtr
 
typedef std::shared_ptr< const FormationConstPtr
 
- Protected Attributes inherited from rcsc::Formation
std::string M_version
 version string
 
std::array< std::string, 11 > M_role_names
 role name array
 
std::array< RoleType, 11 > M_role_types
 role type array
 
std::array< int, 11 > M_position_pairs
 the paired position number array. 0 means no pair.
 

Detailed Description

formation which utilizes Delaunay Triangulation

Member Function Documentation

◆ create()

static Formation::Ptr rcsc::FormationDT::create ( )
inlinestatic

static factory method. create new object

Returns
new object

◆ getPosition()

virtual Vector2D rcsc::FormationDT::getPosition ( const int  num,
const Vector2D focus_point 
) const
overridevirtual

get position for the current focus point

Parameters
numposition number
focus_pointcurrent focus point, usually ball position.

Implements rcsc::Formation.

◆ getPositions()

virtual void rcsc::FormationDT::getPositions ( const Vector2D focus_point,
std::vector< Vector2D > &  positions 
) const
overridevirtual

get all positions for the current focus point

Parameters
focus_pointcurrent focus point, usually ball position
positionscontaner to store the result

Implements rcsc::Formation.

◆ methodName()

virtual std::string rcsc::FormationDT::methodName ( ) const
overridevirtual

get the method name of the formation model

Returns
name string

Implements rcsc::Formation.

◆ points()

const std::vector< FormationData::Data > & rcsc::FormationDT::points ( ) const
inline

get the sample data array

Returns
sample data array

◆ printData()

virtual bool rcsc::FormationDT::printData ( std::ostream &  os) const
overrideprotectedvirtual

print model data

Parameters
osoutput stream
Returns
true if success

Implements rcsc::Formation.

◆ toData()

virtual FormationData::Ptr rcsc::FormationDT::toData ( ) const
overridevirtual

create data for the editor

Returns
formation data

Implements rcsc::Formation.

◆ train()

virtual bool rcsc::FormationDT::train ( const FormationData data)
overridevirtual

update formation paramter using training data set

Parameters
datatraining data
Returns
true if success

Implements rcsc::Formation.

◆ triangulation()

const DelaunayTriangulation & rcsc::FormationDT::triangulation ( ) const
inline

get the delaunay triangulation

Returns
const reference to the triangulation instance

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