|
QDpy
|
Analyze genealogies and search trajectory networks in quality-diversity runs. More...
Go to the source code of this file.
Classes | |
| class | qdpy.genealogy.GoalSwitch |
| An observed parent-to-child transition between distinct goals. More... | |
| class | qdpy.genealogy.SearchTrajectoryNetwork |
| A directed graph of transitions aggregated by search state. More... | |
| class | qdpy.genealogy.SteppingStoneAnalysis |
| Endpoint-restricted path counts and the states passing the percentile cutoff. More... | |
Namespaces | |
| namespace | qdpy |
Functions | |
| qdpy.genealogy.ancestry (source, elite, *, include_elite=False) | |
| Extract the ancestor graph of a selected proposal without duplicating shared ancestors. | |
| qdpy.genealogy.ancestor_archive (source, elite, *, grid, include_elite=False) | |
| Rebin an elite's ancestors and keep one representative per reporting cell. | |
| qdpy.genealogy.goal_switches (source, *, elite=None, goals=None) | |
| Count observed ancestry edges that move between distinct goals. | |
| qdpy.genealogy._shortest_paths (adjacency, origin) | |
| qdpy.genealogy.search_trajectory_network (trajectories) | |
| Aggregate successive states from explicit search trajectories. | |
| qdpy.genealogy.lineage_trajectory_network (runs, *, state=None, targets=None, objective=0) | |
| Build a trajectory network from recorded genealogy rather than consecutive evaluations. | |
| qdpy.genealogy.plot_ancestry_archive (source, elite, *, grid, ax=None) | |
| Overlay the measured parent edges of one elite on its ancestor archive. | |
| qdpy.genealogy.plot_stepping_stones (network, *, analysis=None, positions=None, ax=None) | |
| Draw a search trajectory network with betweenness and transition frequencies. | |
Analyze genealogies and search trajectory networks in quality-diversity runs.
Definition in file genealogy.py.
|
protected |
Build a breadth-first DAG and count the shortest paths to each state.
Definition at line 222 of file genealogy.py.
| qdpy.genealogy.ancestor_archive | ( | source, | |
| elite, | |||
| * | , | ||
| grid, | |||
| include_elite = False ) |
Rebin an elite's ancestors and keep one representative per reporting cell.
Build a new Grid or CVTGrid containing measurements from one elite's ancestry. Use a measured lineage and a fixed reporting grid with matching objectives and descriptors. Ignore measurements outside the reporting domain. Each candidate stores its lineage ID as its sole genome coordinate. The grid can be plotted and scored with ordinary QDpy archive methods.
Definition at line 85 of file genealogy.py.
| qdpy.genealogy.ancestry | ( | source, | |
| elite, | |||
| * | , | ||
| include_elite = False ) |
Extract the ancestor graph of a selected proposal without duplicating shared ancestors.
Return a dictionary of the selected elite's unique ancestors ordered by proposal ID. Supply a lineage JSONL path or a mapping of IDs to ``LineageNode`` records. ``include_elite`` adds the focal individual to the returned graph.
Definition at line 39 of file genealogy.py.
| qdpy.genealogy.goal_switches | ( | source, | |
| * | , | ||
| elite = None, | |||
| goals = None ) |
Count observed ancestry edges that move between distinct goals.
Return all observed switches, or just switches in one elite's ancestry. By default use the cells recorded at admission. Provide ``goals`` as a mapping from proposal IDs to explicit categorical goals to override them. Edges with an unknown endpoint are omitted. A repeated parent on one proposal contributes at most one edge.
Definition at line 115 of file genealogy.py.
| qdpy.genealogy.lineage_trajectory_network | ( | runs, | |
| * | , | ||
| state = None, | |||
| targets = None, | |||
| objective = 0 ) |
Build a trajectory network from recorded genealogy rather than consecutive evaluations.
Aggregate parent-to-child transitions across a mapping of run labels to lineage logs. Use recorded admission cells or supply ``state(node)`` returning a hashable location. ``None`` marks an unknown location. To restrict the graph to stepping stones of selected elites, pass ``targets`` as a mapping from run label to an iterable of node IDs. Supply the same state definition and geometry for all runs. Counts preserve repeated transitions. Record worsening on ``objective`` when both endpoints have comparable measurements. Pass ``objective=None`` for a topology-only analysis.
Definition at line 273 of file genealogy.py.
| qdpy.genealogy.plot_ancestry_archive | ( | source, | |
| elite, | |||
| * | , | ||
| grid, | |||
| ax = None ) |
Overlay the measured parent edges of one elite on its ancestor archive.
Plot directed ancestry paths on a two-descriptor Grid or CVTGrid. The background contains the ancestors' cell elites. The outlined focal elite is included in the paths and excluded from the background colors.
Definition at line 323 of file genealogy.py.
| qdpy.genealogy.plot_stepping_stones | ( | network, | |
| * | , | ||
| analysis = None, | |||
| positions = None, | |||
| ax = None ) |
Draw a search trajectory network with betweenness and transition frequencies.
Plot a directed trajectory network, using supplied two-dimensional positions or a circle. Node color shows normalized betweenness, or shortest-path counts if ``analysis`` is supplied. A ring marks states classified as stepping stones. Thicker arrows correspond to more observations. Self-loops count in the data and are omitted from the plot.
Definition at line 352 of file genealogy.py.
| qdpy.genealogy.search_trajectory_network | ( | trajectories | ) |
Aggregate successive states from explicit search trajectories.
Build a directed network from an iterable of ordered sequences of hashable states.
Definition at line 254 of file genealogy.py.