chrono::synchrono::SynAgent Class Referenceabstract

Description

Base class for SynChrono agents.

#include <SynAgent.h>

Inheritance diagram for chrono::synchrono::SynAgent:

Public Member Functions

 SynAgent (AgentKey agent_key={0, 0})
 Construct a agent with the specified node_id. More...
 
virtual ~SynAgent ()
 Destructor.
 
virtual void InitializeZombie (ChSystem *system)=0
 Initialize this agents zombie representation Bodies are added and represented in the lead agent's world. More...
 
virtual void SynchronizeZombie (std::shared_ptr< SynMessage > message)=0
 Synchronize this agents zombie with the rest of the simulation. More...
 
virtual void Update ()=0
 Update this agent Typically used to update the state representation of the agent to be distributed to other agents. More...
 
virtual void GatherMessages (SynMessageList &messages)=0
 Generates messages to be sent to other nodes Should create or get messages and pass them into the referenced message vector. More...
 
virtual void GatherDescriptionMessages (SynMessageList &messages)=0
 Get the description messages for this agent A single agent may have multiple description messages. More...
 
virtual void ProcessMessage (std::shared_ptr< SynMessage > msg)
 Process an incoming message. More...
 
virtual void RegisterZombie (std::shared_ptr< SynAgent > zombie)
 Register a new zombie. More...
 
void SetProcessMessageCallback (std::function< void(std::shared_ptr< SynMessage >)> callback)
 
int GetID ()
 
AgentKey GetKey ()
 
virtual void SetKey (AgentKey agent_key)
 

Protected Attributes

AgentKey m_agent_key
 
std::function< void(std::shared_ptr< SynMessage >)> m_process_message_callback
 

Constructor & Destructor Documentation

◆ SynAgent()

chrono::synchrono::SynAgent::SynAgent ( AgentKey  agent_key = {0, 0})

Construct a agent with the specified node_id.

Parameters
agent_keythe agent id associated with this agent (defaults to uninitialized)

Member Function Documentation

◆ GatherDescriptionMessages()

virtual void chrono::synchrono::SynAgent::GatherDescriptionMessages ( SynMessageList &  messages)
pure virtual

Get the description messages for this agent A single agent may have multiple description messages.

Parameters
messagesa referenced vector containing messages to be distributed from this rank

Implemented in chrono::synchrono::SynEnvironmentAgent, chrono::synchrono::SynSCMTerrainAgent, chrono::synchrono::SynTrackedVehicleAgent, chrono::synchrono::SynWheeledVehicleAgent, and chrono::synchrono::SynCopterAgent.

◆ GatherMessages()

virtual void chrono::synchrono::SynAgent::GatherMessages ( SynMessageList &  messages)
pure virtual

Generates messages to be sent to other nodes Should create or get messages and pass them into the referenced message vector.

Parameters
messagesa referenced vector containing messages to be distributed from this rank

Implemented in chrono::synchrono::SynEnvironmentAgent, chrono::synchrono::SynSCMTerrainAgent, chrono::synchrono::SynTrackedVehicleAgent, chrono::synchrono::SynWheeledVehicleAgent, and chrono::synchrono::SynCopterAgent.

◆ InitializeZombie()

virtual void chrono::synchrono::SynAgent::InitializeZombie ( ChSystem system)
pure virtual

Initialize this agents zombie representation Bodies are added and represented in the lead agent's world.

Parameters
systemthe ChSystem used to initialize the zombie

Implemented in chrono::synchrono::SynEnvironmentAgent, chrono::synchrono::SynSCMTerrainAgent, chrono::synchrono::SynTrackedVehicleAgent, chrono::synchrono::SynWheeledVehicleAgent, and chrono::synchrono::SynCopterAgent.

◆ ProcessMessage()

void chrono::synchrono::SynAgent::ProcessMessage ( std::shared_ptr< SynMessage msg)
virtual

Process an incoming message.

Parameters
msgthe received message to be processed

◆ RegisterZombie()

virtual void chrono::synchrono::SynAgent::RegisterZombie ( std::shared_ptr< SynAgent zombie)
inlinevirtual

Register a new zombie.

Parameters
zombiethe new zombie

Reimplemented in chrono::synchrono::SynSCMTerrainAgent.

◆ SynchronizeZombie()

virtual void chrono::synchrono::SynAgent::SynchronizeZombie ( std::shared_ptr< SynMessage message)
pure virtual

Synchronize this agents zombie with the rest of the simulation.

Updates agent based on the passed message. Any message can be passed, so a check should be done to ensure this message was intended for this agent.

Parameters
messagethe message to process and is used to update the position of the zombie

Implemented in chrono::synchrono::SynEnvironmentAgent, chrono::synchrono::SynSCMTerrainAgent, chrono::synchrono::SynTrackedVehicleAgent, chrono::synchrono::SynWheeledVehicleAgent, and chrono::synchrono::SynCopterAgent.

◆ Update()

virtual void chrono::synchrono::SynAgent::Update ( )
pure virtual

Update this agent Typically used to update the state representation of the agent to be distributed to other agents.

Implemented in chrono::synchrono::SynEnvironmentAgent, chrono::synchrono::SynSCMTerrainAgent, chrono::synchrono::SynTrackedVehicleAgent, chrono::synchrono::SynWheeledVehicleAgent, and chrono::synchrono::SynCopterAgent.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_synchrono/agent/SynAgent.h
  • /builds/uwsbel/chrono/src/chrono_synchrono/agent/SynAgent.cpp