Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connections and showmsg inconsistency #488

Open
subhacom opened this issue Sep 15, 2024 · 0 comments
Open

Connections and showmsg inconsistency #488

subhacom opened this issue Sep 15, 2024 · 0 comments

Comments

@subhacom
Copy link
Collaborator

While src and dest fields are unambiguous in the directionality of connections, that via shared message is bidirectional. If MOOSE is automatically ordering the subfields (dest and src) in a shared messaged, the outcomes should be identical irrespective of the order of the arguments to moose.connect. But in the example below, where I create two HHChannels, x and y and connect them a to a compartment comp, this is not the case:

In [1]: comp = moose.Compartment('comp')

In [2]: ch = moose.HHChannel('x')

In [3]: moose.connect(ch, 'channel', comp, 'channel')
Out[3]: <moose.SingleMsg id=5 dataIndex=6 path=/Msgs[0]/singleMsg[6]>

In [4]: moose.showmsg(ch)
INCOMING:
  /x, [parentMsg] <-- /, [childOut]
  /x, [process,reinit] <-- /clock, [process4,reinit4]

OUTGOING:
  /x, [childOut] --> /x[0]/gateX, [parentMsg]
  /x, [childOut] --> /x[0]/gateY, [parentMsg]
  /x, [childOut] --> /x[0]/gateZ, [parentMsg]
  /x, [channelOut] --> /comp, [handleChannel]


In [5]: moose.showmsg(comp)
INCOMING:
  /comp, [parentMsg] <-- /, [childOut]
  /comp, [initProc,initReinit] <-- /clock, [process2,reinit2]
  /comp, [process,reinit] <-- /clock, [process3,reinit3]
  /comp, [handleChannel] <-- /x, [channelOut]

OUTGOING:
  /x, [channelOut] --> /comp, [handleChannel]


In [6]: ch2 = moose.HHChannel('y')

In [7]: moose.connect(comp, 'channel', ch2, 'channel')
Out[7]: <moose.SingleMsg id=5 dataIndex=7 path=/Msgs[0]/singleMsg[7]>

In [8]: moose.showmsg(ch2)
INCOMING:
  /y, [parentMsg] <-- /, [childOut]
  /y, [process,reinit] <-- /clock, [process4,reinit4]
  /y, [Vm] <-- /comp, [VmOut]

OUTGOING:
  /y, [childOut] --> /y[0]/gateX, [parentMsg]
  /y, [childOut] --> /y[0]/gateY, [parentMsg]
  /y, [childOut] --> /y[0]/gateZ, [parentMsg]
  /comp, [VmOut] --> /y, [Vm]

In [9]: moose.showmsg(comp)
INCOMING:
  /comp, [parentMsg] <-- /, [childOut]
  /comp, [initProc,initReinit] <-- /clock, [process2,reinit2]
  /comp, [process,reinit] <-- /clock, [process3,reinit3]
  /comp, [handleChannel] <-- /x, [channelOut]

OUTGOING:
  /x, [channelOut] --> /comp, [handleChannel]
  /comp, [VmOut] --> /y, [Vm]

Also, the incoming and outgoing message listings seem confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant