Thunderbots Project
Loading...
Searching...
No Matches
Tactic Class Referenceabstract

#include <tactic.h>

Inheritance diagram for Tactic:

Public Member Functions

 Tactic (const std::set< RobotCapability > &capability_reqs_)
 
virtual bool done () const =0
 
virtual std::string getFSMState () const =0
 
const std::set< RobotCapability > & robotCapabilityRequirements () const
 
std::set< RobotCapability > & mutableRobotCapabilityRequirements ()
 
void setLastExecutionRobot (std::optional< RobotId > last_execution_robot)
 
std::map< RobotId, std::shared_ptr< Primitive > > get (const WorldPtr &world_ptr)
 
virtual void accept (TacticVisitor &visitor) const =0
 

Protected Attributes

std::optional< RobotId > last_execution_robot
 

Detailed Description

In the STP framework, a Tactic represents a role or objective for a single robot. This can be thought of as a "position" on a typical soccer team. Some examples are:

  • The goalie
  • A "striker" that tries to get the ball and shoot on the enemy goal
  • A defender that shadows enemy robots
  • A passer
  • A receiver (for a pass)

Tactics are stateful, and use Primitives to implement their behaviour. They also make heavy use of our Evaluation functions in order to help them make decisions.

Constructor & Destructor Documentation

◆ Tactic()

Tactic ( const std::set< RobotCapability > &  capability_reqs_)
explicit

Creates a new Tactic. The Tactic will initially have no Robot assigned to it.

Parameters
capability_reqs_The capability requirements for running this tactic

Member Function Documentation

◆ accept()

virtual void accept ( TacticVisitor visitor) const
pure virtual

◆ done()

virtual bool done ( ) const
pure virtual

Returns true if the Tactic is done and false otherwise.

Returns
true if the Tactic is done and false otherwise

◆ get()

std::map< RobotId, std::shared_ptr< Primitive > > get ( const WorldPtr &  world_ptr)

Updates and returns a set of primitives for all friendly robots from this tactic

Parameters
worldThe updated world
Returns
the next primitive

◆ getFSMState()

virtual std::string getFSMState ( ) const
pure virtual

Gets the FSM state of the tactic

Returns
the FSM state

◆ mutableRobotCapabilityRequirements()

std::set< RobotCapability > & mutableRobotCapabilityRequirements ( )

Mutable robot hardware capability requirements of the tactic.

Returns
the Mutable robot hardware capability requirements of the tactic

◆ robotCapabilityRequirements()

const std::set< RobotCapability > & robotCapabilityRequirements ( ) const

robot hardware capability requirements of the tactic.

Returns
the robot capability requirements

◆ setLastExecutionRobot()

void setLastExecutionRobot ( std::optional< RobotId >  last_execution_robot)

Updates the last execution robot

Parameters
last_execution_robotThe robot id of the robot that last executed the primitive for this tactic

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