BitstreamIndividual.py#
Individual representation for evolutionary bitstream experiments.
Each individual wraps a boolean bitstream that maps to an FPGA circuit configuration. Provides mutation, crossover, and randomization operators used by the population initialization and reproduction strategies.
- class Individual.BitstreamIndividual.BitstreamIndividual(bitstream_sz: int, rand: Random, mutation_probability: float)[source]#
A genetic individual whose genome is a list of boolean bits.
Used by
GenerateBitstreamPopulationto create populations, and by reproducers to generate offspring.- __init__(bitstream_sz: int, rand: Random, mutation_probability: float)[source]#
Create an individual with a zeroed bitstream of the given size.
- copy_from(other: BitstreamIndividual)[source]#
Deep-copy the bitstream from other into this individual.
- crossover(parent: BitstreamIndividual, crossover_point: int)[source]#
Single-point crossover: take bits before crossover_point from self and the rest from parent.