Connecting Cells#
- connect(pre, post, synapse_type)[source]#
Connect two compartments with a chemical synapse.
The pre- and postsynaptic compartments must be different compartments of the same network.
- Parameters:
pre (View) – View of the presynaptic compartment.
post (View) – View of the postsynaptic compartment.
synapse_type (Synapse) – The synapse to append
- connectivity_matrix_connect(pre_cell_view, post_cell_view, synapse_type, connectivity_matrix, random_post_comp=False)[source]#
Appends multiple connections according to a custom connectivity matrix.
Entries > 0 in the matrix indicate a connection between the corresponding cells. Connections are from branch 0 location 0 of the pre-synaptic cell to branch 0 location 0 of the post-synaptic cell unless random_post_comp=True.
- Parameters:
pre_cell_view (View) – View of the presynaptic cell.
post_cell_view (View) – View of the postsynaptic cell.
synapse_type (Synapse) – The synapse to append.
connectivity_matrix (ndarray[bool]) – A boolean matrix indicating the connections between cells.
random_post_comp (bool) – If True, randomly samples the postsynaptic compartments.
- fully_connect(pre_cell_view, post_cell_view, synapse_type, random_post_comp=False)[source]#
Appends multiple connections which build a fully connected layer.
Connections are from branch 0 location 0 of the pre-synaptic cell to branch 0 location 0 of the post-synaptic cell unless random_post_comp=True.
- sparse_connect(pre_cell_view, post_cell_view, synapse_type, p, random_post_comp=False)[source]#
Appends multiple connections which build a sparse, randomly connected layer.
Connections are from branch 0 location 0 of the pre-synaptic cell to branch 0 location 0 of the post-synaptic cell unless random_post_comp=True.
NOTE: This function does not generate sparse random connectivity with random graph generation methodology, cells may be connected multiple times and p=1.0 does not fully connect.