API Reference#
This section contains auto-generated documentation for every module in the
BitstreamEvolution codebase. The source of truth for the system’s design is
BitstreamEvolutionProtocols.py, which defines the Protocol classes
(interfaces) that all concrete implementations satisfy.
Core Interfaces#
All major components are defined as Python Protocol classes so that
implementations can be swapped freely. The table below summarises each
interface and where to find its implementations.
Interface |
Purpose |
Implementations |
|---|---|---|
The atomic unit of evolution — a genome that can be mutated and recombined. Specifies essentially nothing beyond identity, allowing any representation (bitstreams, integers, trees, etc.). |
||
An FPGA configuration compiled from one or more Individuals. Provides
a |
||
A comparable result of evaluating a Circuit. Supports the standard
comparison operators ( |
Any comparable type |
|
Async interface to one or more physical FPGAs. Compiles a Circuit, uploads it, takes a measurement, and returns the result. Designed for future server-client concurrency across multiple devices. |
||
Converts a list of Populations into a mapping of Circuits to the Individuals that contribute to each one. Handles the one-to-one or many-to-one relationship between Individuals and Circuits. |
||
Selection and mutation strategy. Takes a Population and returns a new Population of offspring for the next generation. |
||
Factory that produces the initial Population before evolution begins. |
||
Assigns fitness values to every Individual in a Population given a list of Measurements. |
||
Decides which Measurements to take for a set of Populations and returns them mapped to the Individuals they affect. |
||
Manages generation metadata. Produces the initial |
|
Supporting Types#
Population— Holds a list of(Individual, Fitness | None)pairs with sorting and iteration support.Measurement— Bundles a Circuit, aDataRequesttype, sample count, and aResultthat is filled after hardware evaluation.GenData— Minimal generation metadata (currently justgeneration_number).FPGA_Compilation_Data— Target FPGA model and device ID, passed toCircuit.compile().DataRequest— Enum selecting the measurement type (WAVEFORM,OSCILLATIONS).
Orchestration#
Evolution.py — The main loop that wires all of the above together: generates an initial population, then repeatedly evaluates fitness and reproduces until the
GenDataFactorysignals completion.TrivialImplementation.py — A self-contained reference implementation that exercises the full protocol stack using integer-valued circuits (no hardware required). Useful for testing and as a starting template.