Project Chrono: chrono::synchrono::SynAgent Class Reference

Public Member Functions | Protected Attributes | List of all members
chrono::synchrono::SynAgent Class Referenceabstract
SYNCHRONO module » Agents

## Description

Base class for SynChrono agents.

`#include <SynAgent.h>`

Inheritance diagram for chrono::synchrono::SynAgent:
[legend]

## Public Member Functions
| SynAgent (AgentKey agent_key={0, 0})
| Construct a agent with the specified node_id.
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.
virtual void | SynchronizeZombie (std::shared_ptr< SynMessage > message)=0
| Synchronize this agents zombie with the rest of the simulation.
virtual void | Update ()=0
| Update this agent Typically used to update the state representation of the agent to be distributed to other agents.
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.
virtual void | GatherDescriptionMessages (SynMessageList &messages)=0
| Get the description messages for this agent A single agent may have multiple description messages.
virtual void | ProcessMessage (std::shared_ptr< SynMessage > msg)
| Process an incoming message.
virtual void | RegisterZombie (std::shared_ptr< SynAgent > zombie)
| Register a new zombie.
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_key | the 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

  messages | a referenced vector containing messages to be distributed from this rank

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

## ◆ 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

  messages | a referenced vector containing messages to be distributed from this rank

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

## ◆ 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

  system | the ChSystem used to initialize the zombie

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

## ◆ ProcessMessage()

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

Process an incoming message.

Parameters

  msg | the received message to be processed

## ◆ RegisterZombie()

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

Register a new zombie.

Parameters

  zombie | the new zombie

Reimplemented in chrono::synchrono::SynSCMTerrainAgent.

## ◆ SetKey()

virtual void chrono::synchrono::SynAgent::SetKey | ( | AgentKey | agent_key | ) |
| inlinevirtual

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

## ◆ 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

  message | the message to process and is used to update the position of the zombie

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

## ◆ 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::SynCopterAgent, chrono::synchrono::SynEnvironmentAgent, chrono::synchrono::SynSCMTerrainAgent, chrono::synchrono::SynTrackedVehicleAgent, and chrono::synchrono::SynWheeledVehicleAgent.

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

- D:/W/B/src/chrono-9.0.1/src/chrono_synchrono/agent/SynAgent.h
- D:/W/B/src/chrono-9.0.1/src/chrono_synchrono/agent/SynAgent.cpp