QDpy
Loading...
Searching...
No Matches
qdpy.algorithms.graph_qd.CartesianGraphSpace Class Reference

Define a fixed-length integer genotype for acyclic controller graphs. More...

Public Member Functions

 sample (self, rng)
 Draw one independent uniform value per legal gene domain.
 mutate (self, genome, rng)
 Mutate operation and connection genes independently within their domains.
 decode (self, genome)
 Decode the reachable subgraph and its fixed output nodes.

Detailed Description

Define a fixed-length integer genotype for acyclic controller graphs.

Lay out graph nodes in one sequence, with the last nodes as outputs.

Every node has an operation gene and two predecessor genes. Operands
may refer to observations, constants, or strictly earlier function
nodes. Unary functions ignore the second connection. Inactive nodes
can still mutate, so later connections can activate new computations.

:param inputs: Number of observation coordinates.
:param outputs: Number of scalar outputs, beginning at the last outputs nodes.
:param nodes: Total number of function nodes in the genotype.
:param primitives: Ordered built-in operation names. Defaults to all operations.
:param constants: Finite scalar terminals available to every node.
:param operation_rate: Optional independent mutation rate for operation genes.
:param connection_rate: Optional independent mutation rate for operand genes.
    Unspecified rates default to the inverse genotype length.

Definition at line 43 of file graph_qd.py.

Member Function Documentation

◆ decode()

qdpy.algorithms.graph_qd.CartesianGraphSpace.decode ( self,
genome )

Decode the reachable subgraph and its fixed output nodes.

Return a controller that can be used independently of the search.

Definition at line 106 of file graph_qd.py.

◆ mutate()

qdpy.algorithms.graph_qd.CartesianGraphSpace.mutate ( self,
genome,
rng )

Mutate operation and connection genes independently within their domains.

Flip selected genes to a different legal value and retain neutral genes.

Definition at line 96 of file graph_qd.py.

◆ sample()

qdpy.algorithms.graph_qd.CartesianGraphSpace.sample ( self,
rng )

Draw one independent uniform value per legal gene domain.

Return a complete immutable integer genotype.

Definition at line 91 of file graph_qd.py.


The documentation for this class was generated from the following file: