TreeParams¶
-
class TreeParams¶
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=""]; }- TreeParams.__init__()¶
- TreeParams.assign()¶
- TreeParams.get()¶
The value of a parameter (at a level, for a per-level one).
- static TreeParams.get_class_type()¶
- TreeParams.get_default()¶
- TreeParams.get_doc()¶
One line on what the parameter does.
- TreeParams.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 TreeParams.get_num_params()¶
- static TreeParams.get_param_name()¶
- TreeParams.has_param()¶
- TreeParams.is_per_level()¶
- TreeParams.output()¶
- TreeParams.reset()¶
Every parameter back to its default.
- TreeParams.set()¶
Sets a scalar parameter, or every level of a per-level one.
- TreeParams.set_level()¶
Sets one level of a per-level parameter (a scalar ignores the level).
- TreeParams.write()¶
Every parameter that differs from its default.