The idea of a Network class is a great one. I think with some tweaking, this should be our next step further.
I was thinking however, what if we kept it at the Cortix level, and modeled modules as nodes in this network. This would look like, for example,
c = Cortix(use_mpi=False)
# Create one network
net1 = Network()
net1.module(Vortex())
for i in range(n_droplets):
net1.module(Droplet())
net1.connect("Droplet", "Vortex")
# Create another network
net2 = Network()
net2.module(Vortex())
for i in range(n_droplets):
net2.module(Droplet())
net2.module(DataPlot())
net2.connect(Droplet, DataPlot)
net2.connect(Droplet, Vortex)
# Add both networks to the simulation
c.add_network(net1)
c.add_network(net2)
# Run the networks simultaneously
c.run()
The networks look expressive enough to eventually take the place of ports. Thoughts?
The idea of a Network class is a great one. I think with some tweaking, this should be our next step further.
I was thinking however, what if we kept it at the Cortix level, and modeled modules as nodes in this network. This would look like, for example,
The networks look expressive enough to eventually take the place of ports. Thoughts?