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

Cortix Network Class #227

Open
ghost opened this issue Aug 12, 2019 · 1 comment
Open

Cortix Network Class #227

ghost opened this issue Aug 12, 2019 · 1 comment
Assignees

Comments

@ghost
Copy link

ghost commented Aug 12, 2019

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?

@ghost ghost assigned dealmeidavf Aug 12, 2019
@dealmeidavf
Copy link
Member

I am working on a nested network example and I will post. Then it should provide food for thought on a realistic test of how to go forward.

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

No branches or pull requests

1 participant