1#ifndef BITSIM_COSIM_COSIM_PARTICIPANT_H
2#define BITSIM_COSIM_COSIM_PARTICIPANT_H
10#include <boost/noncopyable.hpp>
80 const std::vector<real_t> &
inputs()
const {
return state_.inputs.at(me_); }
85 const std::vector<real_t> &
inputs(
const std::string &name)
const
87 return state_.inputs.at(layout_.index(name));
98 std::vector<std::vector<real_t>> exchange_(
const std::vector<real_t> &mine);
104 std::unique_ptr<distributed::Synchroniser> sync_;
108 bool initialised_{
false};
109 uint_t total_iterations_{0};
110 uint_t n_not_converged_{0};
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
const std::vector< real_t > & inputs(const std::string &name) const
The inputs of subsystem name at the present time: every participant knows them.
Definition cosim_participant.h:85
void leave()
Tell the others that this participant stops.
Definition cosim_participant.cpp:107
uint_t n_not_converged() const noexcept
Definition cosim_participant.h:94
const std::vector< real_t > & inputs() const
The inputs of this participant's subsystem at the present time.
Definition cosim_participant.h:80
void initialise(real_t t0=0.0)
Find the inputs at time t0, with the others.
Definition cosim_participant.cpp:67
const distributed::Synchroniser & synchroniser() const noexcept
Definition cosim_participant.h:90
real_t time() const noexcept
Definition cosim_participant.h:75
uint_t total_iterations() const noexcept
Definition cosim_participant.h:92
CoSimParticipant(CouplingLayout layout, const std::string &name, CoSimSubsystem &subsystem, distributed::Transport &transport, const CouplingConfig &coupling={}, const CoSimParticipantConfig &config={})
Definition cosim_participant.cpp:11
MacroStepResult step(real_t H)
Advance by H, with the others.
Definition cosim_participant.cpp:76
A part of a coupled system that a co-simulation steps on its own: a robot, a trailer,...
Definition cosim_subsystem.h:29
The subsystems of a co-simulation, their sizes, and which output feeds which input.
Definition coupling.h:35
Keeps the participants of a distributed simulation in step.
Definition synchroniser.h:99
How the participants of a distributed simulation reach each other: everything one publishes,...
Definition transport.h:34
Definition co_simulation.cpp:9
Definition dc_motor_backend_base.h:9
std::size_t uint_t
uint_t
Definition bitsim_types.h:40
double real_t
real_t
Definition bitsim_types.h:20
The settings of CoSimParticipant.
Definition cosim_participant.h:25
real_t timeout
how long a try waits for the others [s]
Definition cosim_participant.h:26
real_t resend_period
how often a waiting try sends its outputs again [s]
Definition cosim_participant.h:27
How a co-simulation couples its subsystems.
Definition coupling.h:102
The inputs of every subsystem at the present time, and at the time before.
Definition coupling.h:118
What one macro step did.
Definition coupling.h:128