copy method

CollectiveCellProperties<E, I> copy({
  1. Cell? bind,
  2. ContainerType? container,
  3. CollectiveReceptor<dynamic, Signal, Signal>? receptor,
  4. TestCollective<dynamic, Collective>? test,
  5. MapObject? mapObject,
  6. Synapses<Signal, Cell>? synapses,
})

Creates a copy of these properties with optional modifications.

Parameters:

Implementation

CollectiveCellProperties<E,I> copy({
  Cell? bind,
  ContainerType? container,
  CollectiveReceptor? receptor,
  TestCollective? test,
  MapObject? mapObject,
  Synapses? synapses
}) {

  try {
    synapses ??= record.synapses;
  } catch(_) {
    synapses = Synapses.enabled;
  }

  return CollectiveCellProperties<E,I>(
    bind: bind ?? this.bind,
    container: container ?? this.containerType,
    receptor: receptor ?? this.receptor,
    test: test ?? this.test,
    mapObject: mapObject ?? this.mapObject,
    synapses: synapses!
  );
}