HFSM2
  • HFSM2
  • Quick Tutorial
  • General Information
    • History
    • Goals
    • Development Principles
    • Future Plans
  • User Guide
    • Getting Started
    • Configuration
      • Feature Macros
      • Type Configuration
      • Context
    • Basic Features
      • Hierarchy
        • Root
        • Region
        • State
      • State Methods
        • Control
      • Transitions
        • Events
      • Update Cycle
    • Advanced Features
      • Transitions into Regions
      • Guards
        • Entry Guards
        • Exit Guards
      • State Injections
      • State Data Access
      • Dynamic States
      • Plans
    • Debugging and Tools
      • Activity Report
      • Structure Report
      • Transition History
      • Serialization *
      • Logging Support
  • Practical Topics
    • How-To
      • Designing Hierarchy
      • Reducing State Coupling
      • Reusing State Code
    • Common Patterns
      • Delayed Teardown
  • Users
Powered by GitBook
On this page

Was this helpful?

  1. User Guide
  2. Configuration

Type Configuration

PreviousFeature MacrosNextContext

Last updated 4 years ago

Was this helpful?

The types used by can be configured using parameterized hfsm2::MachineT<hfsm2::Config> structure in place of default-configured hfsm2::Machine, e.g.:

using M = hfsm2::MachineT< hfsm2::Config ::ContextT<Empty> ::RandomT<hfsm2::XoShiRo128Plus> >;

(from ).

Once hfsm2::Config is fully declared, it needs to be passed as a template argument into hfsm2::MachineT<> to define configured parent struct containing all derivative types used in client code.

hfsm2::Config customization points:

Feature Define

Type

Used In

Default

ContextT<T>

Context& Control::context()

(see )

EmptyContext

HFSM2_ENABLE_UTILITY_THEORY

RankT<T>

Rank State::rank()

int8_t

HFSM2_ENABLE_UTILITY_THEORY

UtilityT<T>

Utility State::utility()

float

HFSM2_ENABLE_UTILITY_THEORY

RandomT<T>

Used internally by randomize() transition and Random region

RandomT<float>

SubstitutionLimitN<N>

Maximum number of times State::entryGuard()methods are allowed to substitute the transition into their class for a transition into another one during the single *Root::update()

4

HFSM2_ENABLE_PLANS

TaskCapacityN<N>

Total number of tasks across all plans in an FSM

2x Number of Sub-States of All Composite Regions

HFSM2
test_debug.cpp
HFSM2
Context