Function evosim::mutate::mutate::sync_mutate

source ·
fn sync_mutate(
    geno_q: &mut Vec<BlobGeno>,
    bbn: &mut ResMut<'_, BevyBlockNeurons>
) -> (Vec<BlobGeno>, Vec<GenericNN>)
Expand description

mutated blob may gain or lose NN, sync it with resource.

If blob gain limbs, new NN will be append to the end of the NN vector in resource.

If blob lose limbs, unused NN will be delete, and all NN after that deleted NN will have its id changed to make sure the nn_id always match. (NN resource do not have id since their id is index, changed id are in BlobGeno)