Description
Base class for SynChrono agents.
#include <SynAgent.h>
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_key the agent id associated with this agent (defaults to uninitialized)
Member Function Documentation
◆ GatherDescriptionMessages()
|
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::SynEnvironmentAgent, chrono::synchrono::SynSCMTerrainAgent, chrono::synchrono::SynTrackedVehicleAgent, chrono::synchrono::SynWheeledVehicleAgent, and chrono::synchrono::SynCopterAgent.
◆ GatherMessages()
|
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::SynEnvironmentAgent, chrono::synchrono::SynSCMTerrainAgent, chrono::synchrono::SynTrackedVehicleAgent, chrono::synchrono::SynWheeledVehicleAgent, and chrono::synchrono::SynCopterAgent.
◆ InitializeZombie()
|
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::SynEnvironmentAgent, chrono::synchrono::SynSCMTerrainAgent, chrono::synchrono::SynTrackedVehicleAgent, chrono::synchrono::SynWheeledVehicleAgent, and chrono::synchrono::SynCopterAgent.
◆ ProcessMessage()
|
virtual |
Process an incoming message.
- Parameters
-
msg the received message to be processed
◆ RegisterZombie()
|
inlinevirtual |
Register a new zombie.
- Parameters
-
zombie the new zombie
Reimplemented in chrono::synchrono::SynSCMTerrainAgent.
◆ SynchronizeZombie()
|
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::SynEnvironmentAgent, chrono::synchrono::SynSCMTerrainAgent, chrono::synchrono::SynTrackedVehicleAgent, chrono::synchrono::SynWheeledVehicleAgent, and chrono::synchrono::SynCopterAgent.
◆ 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