Description
Base class for SynChrono agents.
#include <SynAgent.h>
Public Member Functions | |
SynAgent (SynAgentID aid=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) |
SynAgentID | GetID () |
virtual void | SetID (SynAgentID aid) |
Protected Attributes | |
SynAgentID | m_aid |
std::function< void(std::shared_ptr< SynMessage >)> | m_process_message_callback |
Constructor & Destructor Documentation
◆ SynAgent()
chrono::synchrono::SynAgent::SynAgent | ( | SynAgentID | aid = 0 | ) |
Construct a agent with the specified node_id.
- Parameters
-
aid 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, and chrono::synchrono::SynWheeledVehicleAgent.
◆ 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, and chrono::synchrono::SynWheeledVehicleAgent.
◆ 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, and chrono::synchrono::SynWheeledVehicleAgent.
◆ 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, and chrono::synchrono::SynWheeledVehicleAgent.
◆ 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, and chrono::synchrono::SynWheeledVehicleAgent.
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