myogen.simulator.Muscle.assign_mfs2mns#
- Muscle.assign_mfs2mns( ) None[source]#
Assign muscle fibers to motor neurons using biologically realistic principles.
This method implements an assignment algorithm that balances multiple biological constraints:
Proximity: Fibers closer to innervation centers are more likely to be assigned
Territory size: Each motor unit has a target number of fibers based on its size
Self-avoidance: Neighboring fibers avoid belonging to the same motor unit
Gaussian territories: Fiber territories follow roughly Gaussian distributions
The assignment uses a probabilistic approach where each fiber is assigned based on the posterior probability computed from prior probabilities (target fiber numbers) and likelihoods (spatial clustering with Gaussian territories).
- Parameters:
n_neighbours (int, default 3) – Number of neighboring fibers to consider for self-avoiding phenomena. Higher values increase intermingling between motor units but may slow computation. Typical range: 2-5.
conf (float, default 0.999) – Confidence interval that defines the relationship between innervation area and Gaussian distribution variance. Higher values create tighter, more compact territories. Should be between 0.9 and 0.999.
n_jobs (int, default -2) –
Number of parallel workers for out-of-circle coefficient computation.
n_jobs=-1: Use all CPU cores
n_jobs=-2: Use all cores except one (recommended, keeps system responsive)
n_jobs=-3: Use all cores except two
n_jobs=1: No parallelization
n_jobs=N: Use exactly N cores
execution. (Results are stored in the assignment property after)
- Raises:
ValueError – If innervation_center_positions is None. Call distribute_innervation_centers() first, or if muscle fiber centers are not available.
- Return type:
None
Notes
The algorithm compensates for out-of-muscle effects by calculating how much of each motor unit’s Gaussian distribution falls outside the circular muscle boundary and adjusting the in-muscle probabilities accordingly.
The self-avoidance mechanism promotes realistic intermingling by reducing the probability of assigning a fiber to a motor unit if its neighbors are already assigned to that unit.