bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::cosim::CouplingLayout Class Reference

The subsystems of a co-simulation, their sizes, and which output feeds which input. More...

#include <coupling.h>

Public Member Functions

uint_t add (const std::string &name, uint_t n_inputs, uint_t n_outputs)
 Add a subsystem; its index is the number of subsystems before it.
void connect (const std::string &from, uint_t output, const std::string &to, uint_t input)
void validate () const
uint_t size () const noexcept
uint_t index (const std::string &name) const
const std::string & name (uint_t i) const
uint_t n_inputs (uint_t i) const
uint_t n_outputs (uint_t i) const
const std::vector< Connection > & connections () const noexcept
std::vector< std::vector< real_t > > inputs_from (const std::vector< std::vector< real_t > > &outputs) const
 The inputs of every subsystem that the outputs of every subsystem give.
std::vector< std::vector< real_t > > zero_inputs () const
 Every subsystem's inputs, all 0.

Detailed Description

The subsystems of a co-simulation, their sizes, and which output feeds which input.

Every input must be fed by exactly one output. The subsystems are numbered in the order they were added; that order is the order of Gauss-Seidel. Every participant of a distributed co-simulation builds the same layout.

Member Function Documentation

◆ add()

uint_t bitsim::cosim::CouplingLayout::add ( const std::string & name,
uint_t n_inputs,
uint_t n_outputs )

Add a subsystem; its index is the number of subsystems before it.

◆ connect()

void bitsim::cosim::CouplingLayout::connect ( const std::string & from,
uint_t output,
const std::string & to,
uint_t input )

◆ connections()

const std::vector< Connection > & bitsim::cosim::CouplingLayout::connections ( ) const
inlinenoexcept

◆ index()

uint_t bitsim::cosim::CouplingLayout::index ( const std::string & name) const

◆ inputs_from()

std::vector< std::vector< real_t > > bitsim::cosim::CouplingLayout::inputs_from ( const std::vector< std::vector< real_t > > & outputs) const

The inputs of every subsystem that the outputs of every subsystem give.

◆ n_inputs()

uint_t bitsim::cosim::CouplingLayout::n_inputs ( uint_t i) const
inline

◆ n_outputs()

uint_t bitsim::cosim::CouplingLayout::n_outputs ( uint_t i) const
inline

◆ name()

const std::string & bitsim::cosim::CouplingLayout::name ( uint_t i) const
inline

◆ size()

uint_t bitsim::cosim::CouplingLayout::size ( ) const
inlinenoexcept

◆ validate()

void bitsim::cosim::CouplingLayout::validate ( ) const
Exceptions
std::logic_errorif an input is fed by no output, or by more than one

◆ zero_inputs()

std::vector< std::vector< real_t > > bitsim::cosim::CouplingLayout::zero_inputs ( ) const

Every subsystem's inputs, all 0.


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