Operations
StateTracker provides composable operations for building complex state
structures from simple leaf states. Each operation returns a new
State, so calls can be chained into declarative
pipelines. All examples assume:
from statetracker import Manager, State
Composition Operations
Combine multiple states into a single derived state.
Operation |
Description |
|---|---|
Cartesian product of states (values multiply) |
|
Disjoint union of states (values add) |
|
Round-robin alternation between states |
Transformation Operations
Create a new state by transforming an existing state’s values.
Operation |
Description |
|---|---|
Select a subset of values using Python slice syntax |
|
Cycle through a state’s values multiple times |
|
Random permutation of values |
|
Random subset of values (with or without replacement) |
|
Divide a state into multiple sub-states |
Synchronization Operations
Link states so they track each other’s values.
Operation |
Description |
|---|---|
Synchronize two states and create mirrored aliases |