1#ifndef BITSIM_COSIM_CO_SIMULATION_H
2#define BITSIM_COSIM_CO_SIMULATION_H
9#include <boost/noncopyable.hpp>
48 layout_.connect(from, output, to, input);
76 const std::vector<real_t> &
inputs(
const std::string &name)
const;
93 std::vector<CoSimSubsystem *> subsystems_;
97 bool initialised_{
false};
98 uint_t total_iterations_{0};
99 uint_t n_not_converged_{0};
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
A part of a coupled system that a co-simulation steps on its own: a robot, a trailer,...
Definition cosim_subsystem.h:29
void set_pool(utils::concurrency::ThreadPool *pool) noexcept
Step the subsystems of a try on the threads of pool; nullptr steps them one after the other on this t...
Definition co_simulation.h:65
CoSimulation(const CouplingConfig &config=CouplingConfig())
Definition co_simulation.h:39
const CouplingConfig & config() const noexcept
Definition co_simulation.h:71
const std::vector< real_t > & inputs(const std::string &name) const
The inputs of subsystem name at the present time.
Definition co_simulation.cpp:43
uint_t n_not_converged() const noexcept
The macro steps that ended without converging.
Definition co_simulation.h:86
const CouplingLayout & layout() const noexcept
Definition co_simulation.h:69
void connect(const std::string &from, uint_t output, const std::string &to, uint_t input)
Definition co_simulation.h:46
real_t time() const noexcept
Definition co_simulation.h:67
void initialise(real_t t0=0.0)
Check the layout and find the inputs at time t0.
Definition co_simulation.cpp:21
uint_t total_iterations() const noexcept
The tries of all the macro steps so far.
Definition co_simulation.h:81
MacroStepResult step(real_t H)
Advance every subsystem by H.
Definition co_simulation.cpp:48
void add(const std::string &name, CoSimSubsystem &subsystem)
Add a subsystem; it must outlive this.
Definition co_simulation.cpp:11
The subsystems of a co-simulation, their sizes, and which output feeds which input.
Definition coupling.h:35
A fixed number of threads that run the tasks given to them, in the order given.
Definition thread_pool.h:33
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
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