pooltool.physics.dimensionality¶
Classes¶
- class Dim[source]¶
Dimensionality capability declaration for physics strategies.
Each Resolver and EventDetector strategy declares one of these as a class-level attribute.
pooltool.evolution.SimulationEnginereads these once at construction to validate that the bundled strategies are compatible with itsis_3dsetting.A strategy’s
dimis a promise about safety, not behavior. Strategies don’t seeSimulationEngine.is_3d- they see only the inputs handed to them and must remain correct under the states their mode can produce.BOTHis appropriate when the strategy is safe in either mode. It may still take different code paths depending on the input (e.g. a branch onstate == const.airborneis dead in 2D and live in 3D), as long as neither path is incorrect for the mode it runs under.- Members:
TWO: Safe only when
SimulationEngine.is_3disFalse. THREE: Safe only whenSimulationEngine.is_3disTrue. BOTH: Safe in either mode.
Base Classes:
pooltool.utils.strenum.StrEnum
Attributes¶
- SKIP_DIMENSION: frozenset[str]¶
Resolver/EventDetector field names whose strategies don’t carry a
dimattribute.SimulationEngine._validate_dimensionalityskips these fields entirely (in either mode). Used for slots whose events have no meaning in 2D (currently justball_table: airborne balls only exist in 3D).