Project Chrono: chrono::synchrono::SynChronoManager Class Reference

Public Member Functions | List of all members
chrono::synchrono::SynChronoManager Class Reference
SYNCHRONO module » Core SynChrono

## Description

Base class responsible for handling agents and synchronizing states between nodes.

`#include <SynChronoManager.h>`

## Public Member Functions
| SynChronoManager (int node_id, int num_nodes, std::shared_ptr< SynCommunicator > communicator=nullptr)
| Class constructor.
| ~SynChronoManager ()
| Class destructor.
bool | AddAgent (std::shared_ptr< SynAgent > agent)
| Add an agent to the SynChrono manager Cannot be called after Initialize is called.
bool | AddZombie (std::shared_ptr< SynAgent > zombie, AgentKey agent_key)
| Add a zombie to the SynChrono manager with the passed id Cannot be called after Initialize is called.
bool | SetCommunicator (std::shared_ptr< SynCommunicator > communicator)
| Sets the underlying communicator.
bool | Initialize (ChSystem *system)
| Initialize all the added agents.
void | Synchronize (double time)
| Synchronize data across nodes.
void | UpdateAgents ()
| Update the underlying agents Agents typically will update their state messages.
void | QuitSimulation ()
| If our simulation is still running, sends a quit message to everyone else to exit as well Needed specifically for MPI where we don't wait for timeouts.
std::map< AgentKey, std::shared_ptr< SynAgent > > & | GetAgents ()
| Get the agents list.
std::map< AgentKey, std::shared_ptr< SynAgent > > & | GetZombies ()
| Get the zombies list.
void | SetHeartbeat (double heartbeat)
| Set the heartbeat for the rate at which SynChrono synchronization occurs.
bool | IsOk ()
| Should the simulation still be running?
void | PrintStepStatistics (std::ostream &os) const
| Print timing information (over last step and cumulative).

## Member Function Documentation

## ◆ AddAgent()

bool chrono::synchrono::SynChronoManager::AddAgent | ( | std::shared_ptr< SynAgent > | agent | ) |

Add an agent to the SynChrono manager Cannot be called after Initialize is called.

Parameters

  agent | The agent that should be added to the SynChrono world

## ◆ AddZombie()

bool chrono::synchrono::SynChronoManager::AddZombie | ( | std::shared_ptr< SynAgent > | zombie,
|  | AgentKey | agent_key )

Add a zombie to the SynChrono manager with the passed id Cannot be called after Initialize is called.

Parameters

  zombie | The zombie that should be added to the SynChrono world
  agent_key | The id of the added zombie

## ◆ Initialize()

bool chrono::synchrono::SynChronoManager::Initialize | ( | ChSystem * | system | ) |

Initialize all the added agents.

Communicator must be added before calling this function. Locks the agent list so new agents cannot be added.

Parameters

  system | The chrono system with which the sensor manager is associated. Used for zombie initialization.

## ◆ SetCommunicator()

bool chrono::synchrono::SynChronoManager::SetCommunicator | ( | std::shared_ptr< SynCommunicator > | communicator | ) |

Sets the underlying communicator.

Parameters

  communicator | the communicator to use for internode communication

## ◆ Synchronize()

void chrono::synchrono::SynChronoManager::Synchronize | ( | double | time | ) |

Synchronize data across nodes.

This method essentially calls the underlying communicator to perform the work. The communicator will send and block until all messages are received. The manager is then responsible for distributing messages to each agent.

A manager is responsible for maintaining time and space coherence, so each node and it's agent should be at the same time within the simulation

Parameters

  time | timestamp to synchronize each node at

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

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