resize

abstract fun resize(newSize: Int? = null, newBuffer: Int? = null)

Set new sizes of population.

NOTE!

  • Do not use it directly cause chromosomes in range: oldSize..PanmicticEvolveScope.resize operator.

  • Changing only newSize (newBuffer is null) will automatically calculate the value of buffer

Parameters

newSize

Set as new size value. If null - no change size.

  • Always must be positive

  • When decreasing the value, the array will not be copied. The freed space will be marked as buffer - the value of buffer will be increased by oldSize - newSize

  • When increasing the value AND new value less or equal to maxSize - the array will not be copied. Space will be taken from buffer - the value of buffer will be decreased by newSize - oldSize

  • When increasing the value AND new value more than maxSize - the existing population being copied to a new array, which can take a significant amount of time. buffer will be set to 0

newBuffer

Set as new buffer value. If null - no change buffer (But buffer can be changed by changing size, see above).

  • Always must be positive or zero

  • Manual changing buffer will copy the existing population to a new array, which can take a significant amount of time