TreeParams¶
from acron.proctree import TreeParams
- class TreeParams¶
Bases:
Bases:
TypedReferenceCountThe shape of one tree species: Weber-Penn’s parameters, by name.
Scalars (`shape`, `scale`, `ratio` …) hold one value; per-level parameters (`length`, `curve`, `branches` …) hold one value per level, index 0 the trunk, 1..3 the branch levels and index `levels` the leaves (Weber-Penn use the next level’s angles to place leaves). Every parameter is read and written by its name, so a JSON preset maps onto it key for key: `set(name, value)` writes a scalar (or every level of a per-level parameter), `set_level(name, level, value)` one level. An unknown name raises.
Lengths are in metres. `get_hash()` digests every value, for caches keyed by the shape. A NaN or infinite value raises; a value outside the parameter’s range (counts such as `curve_res` 1-256, `seg_splits` 0-8, `branches` 0-10000, `levels` 1-4; anything else +/-1e6) is clamped with a warning.
Inheritance diagram
digraph inheritancecef2ec9428 { 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=""]; "TreeParams" [URL="acron.proctree.TreeParams.html#acron.proctree.TreeParams",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "TreeParams" [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__()¶
- assign()¶
- get()¶
The value of a parameter (at a level, for a per-level one).
- static get_class_type()¶
- get_default()¶
- get_doc()¶
One line on what the parameter does.
- get_hash()¶
A 64-bit FNV-1a digest of every value (and the names, so a new parameter changes it): the key of a prototype cache.
- static get_num_params()¶
- static get_param_name()¶
- has_param()¶
- is_per_level()¶
- output()¶
- reset()¶
Every parameter back to its default.
- set()¶
Sets a scalar parameter, or every level of a per-level one.
- set_level()¶
Sets one level of a per-level parameter (a scalar ignores the level).
- write()¶
Every parameter that differs from its default.