vivarium-collective / vivarium-core

Core Interface and Engine for Vivarium
https://vivarium-core.readthedocs.io/
Apache License 2.0
23 stars 2 forks source link

More flexible topology rewiring for glob schemas #168

Open U8NWXD opened 2 years ago

U8NWXD commented 2 years ago

Consider a process (e.g. multibody physics) with a ports schema like this:

{
    'agents': {
        '*': {
            'a': {...},
            'b': {...},
        },
    },
}

Now imagine that we want to use this process with an agent with a store hierarchy like this:

{
    'a': {...}
    'boundary': {
        'b': {...},
    },
}

We don't currently have a way to wire the environment process to this agent.

U8NWXD commented 2 years ago

Proposed topology syntax for this situation:

{
    'agents': {
        '_path': ('agents',),
        ('*', 'b'): ('agents', '*', 'boundary', 'b'),
    }
}
eagmon commented 2 years ago

I'll work on this!

eagmon commented 2 years ago

'agents' is that root path, so I think it should be more like this. 'agents' is removed from the rewired path.:

{
    'agents': {
        '_path': ('agents',),
        ('*', 'b'): ('*', 'boundary', 'b'),
    }
}
prismofeverything commented 2 years ago

I'm not sure this is a feature we want to support.... I think for various reasons this could end up being a problem. Star schemas are different in a number of ways, conceptually and implementation wise, and are really meant to stand as a unified group of related things. I think if you want functionality like this you are better off just modeling the different elements directly and avoiding the star schema altogether. Happy to go into this further.... star schemas are really a convenience that are not strictly required (anything modeled as a star schema could have just been a regular schema with a little more explicit handling), sometimes I wonder if the added complexity is really worth it. A feature like this really crosses that threshold for me, but like I say, happy to discuss.

On Sat, Mar 19, 2022, 4:59 PM Eran Agmon @.***> wrote:

'agents' is that root path, so I think it should be more like this. 'agents' is removed from the rewired path.:

{ 'agents': { '_path': ('agents',), ('', 'b'): ('', 'boundary', 'b'), } }

— Reply to this email directly, view it on GitHub https://github.com/vivarium-collective/vivarium-core/issues/168#issuecomment-1073132373, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACG5YEZYEPYHVR4BGW7Q3VAZS7LANCNFSM5PIS2BPQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

eagmon commented 2 years ago

The reason for this would be to rewire one process's glob ports schema to match another's. The * glob does something that can't be done otherwise -- it can access n substore simultaneously as the simulation grows. You can't do that with a fixed topology in advance.