|
bitsim
Model, simulate, estimate and control robots in C++
|
One subsystem of a co-simulation, in a process or on a machine of its own. More...
#include <cosim_participant.h>


Public Member Functions | |
| CoSimParticipant (CouplingLayout layout, const std::string &name, CoSimSubsystem &subsystem, distributed::Transport &transport, const CouplingConfig &coupling={}, const CoSimParticipantConfig &config={}) | |
| ~CoSimParticipant () | |
| void | initialise (real_t t0=0.0) |
| Find the inputs at time t0, with the others. | |
| MacroStepResult | step (real_t H) |
| Advance by H, with the others. | |
| void | leave () |
| Tell the others that this participant stops. | |
| real_t | time () const noexcept |
| const std::vector< real_t > & | inputs () const |
| The inputs of this participant's subsystem at the present time. | |
| const std::vector< real_t > & | inputs (const std::string &name) const |
| The inputs of subsystem name at the present time: every participant knows them. | |
| const distributed::Synchroniser & | synchroniser () const noexcept |
| uint_t | total_iterations () const noexcept |
| uint_t | n_not_converged () const noexcept |
One subsystem of a co-simulation, in a process or on a machine of its own.
Every subsystem of the layout is a participant, named after it, with its own CoSimParticipant; they meet through a bitsim::distributed::Transport. Every try of a macro step, a participant steps its subsystem, sends its outputs, and waits for those of the others, with bitsim::distributed::Synchroniser in lockstep. Every participant then has the outputs of every subsystem, and, from the layout that all share, works out the inputs of every subsystem, the residual, and whether to try again, so all agree without another message. The result is that of CoSimulation with the Jacobi scheme in one process, to the last bit.
Gauss-Seidel would make every participant wait for the ones before it, so it is not offered.
| bitsim::cosim::CoSimParticipant::CoSimParticipant | ( | CouplingLayout | layout, |
| const std::string & | name, | ||
| CoSimSubsystem & | subsystem, | ||
| distributed::Transport & | transport, | ||
| const CouplingConfig & | coupling = {}, | ||
| const CoSimParticipantConfig & | config = {} ) |
| layout | the layout of the whole co-simulation, the same on every participant |
| name | the subsystem this participant is |
| subsystem | it; it must outlive this |
| transport | where the participants meet; it must outlive this |
| coupling | how the subsystems couple, the same on every participant; Jacobi only |
| config | how long to wait for the others, and how often to send again |
|
default |
| void bitsim::cosim::CoSimParticipant::initialise | ( | real_t | t0 = 0.0 | ) |
Find the inputs at time t0, with the others.
|
inline |
The inputs of this participant's subsystem at the present time.
|
inline |
The inputs of subsystem name at the present time: every participant knows them.
| void bitsim::cosim::CoSimParticipant::leave | ( | ) |
Tell the others that this participant stops.
|
inlinenoexcept |
| MacroStepResult bitsim::cosim::CoSimParticipant::step | ( | real_t | H | ) |
Advance by H, with the others.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |