splintered-reality / py_trees

Python implementation of behaviour trees.
Other
416 stars 140 forks source link

Explicit constructor arguments #373

Closed stonier closed 1 year ago

stonier commented 1 year ago

This is something of a paradigm shift for py_trees and comes as a result of increasing the configuration complexity for composites with the introduction of memory/no-memory variants.

Exposing the arguments explicitly will help users transition to memory/no-memory variants of Selector and Sequence without having v2.1 default constructed Sequences suddenly behaving differently in v2.2 (e.g. memory vs no-memory). The alternative was to default construct in line with v2.1 behaviours, but that resulted in confusing inconsistencies for default configurations across Selector (w/o memory) and Sequence (w/ memory) composites.

Explicit configuration will also make code easier to introspect.