Contents:
Technology abstraction classes and functions.
A technology, represented by a boolean circuit. Can be compared to other technologies for equality and, given a goal, closeness of approximation of the goal.
Parameters: |
|
---|
Determine whether this instance approximates a goal tech better than some other Technology instance.
Parameters: |
|
---|
Combine with another Technology instance and return the resulting, new tech. Note that this operation is NOT commutative. In other words, a.combined_with(b) does NOT do the same thing as b.combined_with(a), even if you set the PRNG seed.
Parameters: | other – another technology with which to combine |
---|
Distance is the number of possible inputs for which the output of the technology circuit differs from that of the goal technology. Smaller values indicate technologies that are closer in functionality.
Basically, this is the number of identical rows in the truth tables of the respective truth tables.
Note that, for now, we compare right-to-left and ignore extra bits if one bit string is longer than the other. So, for example, a circuit that outputs 1101 for a given set of inputs will be considered equal to another circuit for that set of values if the other circuit evaluates to 101.
Todo
Evaluate how to compare bit strings of unequal lengths.
Parameters: | goal – the goal technology to compare against |
---|
Primary building blocks for simulations based on the circuit model.
A single innovation community. Within the community, technology sharing occurs freely and regularly. New technologies can be composed from old technologies as the community attempts to achieve its goals. Serves the following purposes:
- tracks discovered technologies
- maintains a list of goals
If tech is superior to an existing technology at satisfying a goal, replace and return the existing technology. Return None otherwise.
Shared set of boolean variables for use in all technologies. Two special constants are exported.
X is the vector of BDD variables that are available for use in all circuits. These can be used, once imported, by indexing X like a list: X[0], etc.
N is the length of the X vector.
Evaluates the given circuit (function array) at the given bitstring and returns the resulting bitstring. The input and output bitstrings will be lists of 0 and 1. If the input bitstring is shorter than N, it will be padded to the right with zeroes.
Parameters: |
|
---|
Utilities for dealing with bit strings.
Primitive logic circuit technologies.
The follow primitive technologies are available here:
- NAND
- AND
- OR
- XOR
- ONE (binary 1)
- ZERO (binary 0)
Simulation constants. Some of these will move to configuration files or command line arguments at some point.
Todo
Evaluate how to compare bit strings of unequal lengths.
(The original entry is located in /var/build/user_builds/evolutionary-circuits/checkouts/latest/circuits/technology.py:docstring of circuits.technology.Technology.distance_from, line 14.)