Thunderbots Project
Loading...
Searching...
No Matches
ThreadedAi Class Reference

#include <threaded_ai.h>

Inheritance diagram for ThreadedAi:
Collaboration diagram for ThreadedAi:

Public Member Functions

 ThreadedAi (const TbotsProto::AiConfig &ai_config)
 
void overridePlay (TbotsProto::Play play_proto)
 
void overrideTactics (TbotsProto::AssignedTacticPlayControlParams assigned_tactic_play_control_params)
 
- Public Member Functions inherited from FirstInFirstOutThreadedObserver< World >
 FirstInFirstOutThreadedObserver (size_t buffer_size, bool log_buffer_full=true)
 
std::optional< WorldgetNextValue (const Duration &max_wait_time) final override
 
- Public Member Functions inherited from ThreadedObserver< T >
 ThreadedObserver (size_t buffer_size=Observer< T >::DEFAULT_BUFFER_SIZE, bool log_buffer_full=true)
 
ThreadedObserveroperator= (const ThreadedObserver &)=delete
 
 ThreadedObserver (const ThreadedObserver &)=delete
 
- Public Member Functions inherited from Observer< T, Clock >
 Observer (size_t buffer_size=DEFAULT_BUFFER_SIZE, bool log_buffer_full=true)
 
virtual void receiveValue (T val)
 
virtual double getDataReceivedPerSecond () final
 
- Public Member Functions inherited from FirstInFirstOutThreadedObserver< TbotsProto::ThunderbotsConfig >
 FirstInFirstOutThreadedObserver (size_t buffer_size, bool log_buffer_full=true)
 
std::optional< TbotsProto::ThunderbotsConfig > getNextValue (const Duration &max_wait_time) final override
 
- Public Member Functions inherited from Subject< TbotsProto::PrimitiveSet >
void registerObserver (std::shared_ptr< Observer< TbotsProto::PrimitiveSet > > observer)
 
- Public Member Functions inherited from Subject< TbotsProto::PlayInfo >
void registerObserver (std::shared_ptr< Observer< TbotsProto::PlayInfo > > observer)
 

Additional Inherited Members

- Static Public Attributes inherited from Observer< T, Clock >
static constexpr size_t TIME_BUFFER_SIZE = 5
 
- Protected Member Functions inherited from Observer< T, Clock >
virtual std::optional< T > popMostRecentlyReceivedValue (Duration max_wait_time) final
 
virtual std::optional< T > popLeastRecentlyReceivedValue (Duration max_wait_time) final
 
- Protected Member Functions inherited from Subject< TbotsProto::PrimitiveSet >
virtual void sendValueToObservers (TbotsProto::PrimitiveSet val) final
 
- Protected Member Functions inherited from Subject< TbotsProto::PlayInfo >
virtual void sendValueToObservers (TbotsProto::PlayInfo val) final
 
- Static Protected Attributes inherited from Observer< T, Clock >
static constexpr size_t DEFAULT_BUFFER_SIZE = 1
 

Detailed Description

This class wraps an AI object, performing all the work of receiving World objects, passing them to the AI, getting the primitives to send to the robots based on the World state, and sending them out.

Constructor & Destructor Documentation

◆ ThreadedAi()

ThreadedAi ( const TbotsProto::AiConfig &  ai_config)
explicit

Constructs a new ThreadedAi object.

Parameters
tbots_protoThe AI configuration

Member Function Documentation

◆ overridePlay()

void overridePlay ( TbotsProto::Play  play_proto)

Override the AI play

Parameters
play_protoThe play proto to use to override

◆ overrideTactics()

void overrideTactics ( TbotsProto::AssignedTacticPlayControlParams  assigned_tactic_play_control_params)

Override Tactics

Parameters
assigned_tactic_play_control_params

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