dbbs-lab / bsb-core

The Brain Scaffold Builder
https://bsb.readthedocs.io
GNU General Public License v3.0
22 stars 16 forks source link

Simulation phase design issue restricts ConnModel one-to-one to ConnSet #693

Closed Helveg closed 1 year ago

Helveg commented 1 year ago

Each connection type is allowed to place cells into as many connection sets as it wants, just like the PlacementStrategies can place into as many PlacementSets; a core difference is that placement sets will still map one-to-one to their cell type counterparts. This allows the simulation counterparts, the CellModels, to map one to one to a cell type, and this maps one to one to a PlacementSet.

The design issue is that this doesn't work for ConnectionModels: the ConnectionSets are stored on an arbitrary tags, and they map many-to-one to the presynaptic and postsynaptic cell type pairs. This means that rather than mapping a ConnectionModel to a ConnectionType we should map it to the ConnectionSet.

Currently this is hacked together by:

            cs = simulation.scaffold.get_connectivity_set(connection_model.name)

in the adapters, but this should be improved. The connection_type configuration attribute (probably) doesn't need to exist, since it offers no information that the connection set doesn't offer, and can be replaced by a configuration attribute that on a new hook like "pre prepare", or on "sim usage", checks if this is a valid connection set tag.

Helveg commented 1 year ago

Another similar design issue is that we're planning to allow multiple different cell models for different subgroups of the same cell type, which would break the bidirectional one-to-one chain of PS-CT-CM, there would only be to-one relations in the direction of CM-CT-PS, but no longer PS-CT-CM. This would break for example the Simulation.get_model_of function.