TreeRecipe¶
from acron.proctree import TreeRecipe
- class TreeRecipe¶
Bases:
Bases:
TypedReferenceCountAn ordered list of ops over one TreeParams: `grow(seed)` runs them and returns the skeleton. The same params, ops and seed give a byte-identical skeleton on every run and platform (all arithmetic is in doubles, in a fixed order; the random streams are splitmix64).
`grow()` releases the GIL. It starts from a snapshot of the recipe (its ops and a copy of the params and of every op), so another thread may edit the recipe meanwhile; the edits apply to the next
grow().`make_default(params)` is trunk, Weber-Penn levels, leaves. An op added without an id gets `type * 100 + n` (n counting that type), so adding or removing an op of one kind never renumbers the streams of the others.
Inheritance diagram
digraph inheritancee2b4c31768 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TreeRecipe" [URL="acron.proctree.TreeRecipe.html#acron.proctree.TreeRecipe",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "TreeRecipe" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }- __init__()¶
- add()¶
Appends a new op of the kind with its default settings.
- add_op()¶
- clear_ops()¶
- find_op()¶
The nth op of a kind, or None.
- static get_class_type()¶
- get_hash()¶
A digest of the params and every op: with the seed, the key of a prototype cache.
- get_num_ops()¶
- get_op()¶
- get_params()¶
Appends an op; one without an id (-1) gets type * 100 + its count of that type so far.
- grow()¶
Runs the ops in order. Byte-identical for the same params, ops and seed.
- static make_default()¶
Trunk, Weber-Penn levels, leaves.
- property params TreeParams¶
- Getter
Appends an op; one without an id (-1) gets type * 100 + its count of that type so far.
Setter
- remove_op()¶
- set_params()¶