TreeRecipe

class TreeRecipe

Bases: TypedReferenceCount

An 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=""]; }
TreeRecipe.__init__()
TreeRecipe.add()

Appends a new op of the kind with its default settings.

TreeRecipe.add_op()
TreeRecipe.clear_ops()
TreeRecipe.find_op()

The nth op of a kind, or None.

static TreeRecipe.get_class_type()
TreeRecipe.get_hash()

A digest of the params and every op: with the seed, the key of a prototype cache.

TreeRecipe.get_num_ops()
TreeRecipe.get_op()
TreeRecipe.get_params()

Appends an op; one without an id (-1) gets type * 100 + its count of that type so far.

TreeRecipe.grow()

Runs the ops in order. Byte-identical for the same params, ops and seed.

static TreeRecipe.make_default()

Trunk, Weber-Penn levels, leaves.

TreeRecipe.remove_op()
TreeRecipe.set_params()