Coupling your model


With MUSCLE3 you can connect an output port to multiple input ports. When a submodel sends a message on a port that is connected to multiple input ports, the message is copied and sent to each connected port.


It is not allowed to connect multiple output ports to a single input port.


ymmsl_version: v0.1
  name: multicast
    macro: macro
    micro: micro
    macro.state_out: micro.state_in
    micro.state_out: macro.state_in

In the second tab, a new component printer is added and wired to the state_out port of the micro model. Whenever the micro model sends a message on that port, one copy is sent to the macro model to continue the simulation. Another copy is sent to the printer component, which (for example) prints a summary of the state.