pooltool.physics.resolve.resolver

Resolve collisions and transitions

Overview

Classes

ResolverConfig

A structured form of the user resolver config

Resolver

A physics engine component that characterizes event resolution

Attributes

RESOLVER_CONFIG_PATH

The location of the resolver config path YAML

Classes

class pooltool.physics.resolve.resolver.ResolverConfig(ball_ball: BallBallModel, ball_ball_params: Mapping[str, float | int | str | bool], ball_linear_cushion: BallLCushionModel, ball_linear_cushion_params: Mapping[str, float | int | str | bool], ball_circular_cushion: BallCCushionModel, ball_circular_cushion_params: Mapping[str, float | int | str | bool], ball_pocket: BallPocketModel, ball_pocket_params: Mapping[str, float | int | str | bool], stick_ball: StickBallModel, stick_ball_params: Mapping[str, float | int | str | bool], transition: BallTransitionModel, transition_params: Mapping[str, float | int | str | bool])[source]

A structured form of the user resolver config

Important

For everything you need to know about this class, see :doc:`Modular Physics </resources/custom_physics>`_.

Methods:

classmethod default() ResolverConfig[source]

Load ~/.config/pooltool/physics/resolver.yaml if exists, create otherwise

Return type:

ResolverConfig

class pooltool.physics.resolve.resolver.Resolver(ball_ball: BallBallCollisionStrategy, ball_linear_cushion: BallLCushionCollisionStrategy, ball_circular_cushion: BallCCushionCollisionStrategy, ball_pocket: BallPocketStrategy, stick_ball: StickBallCollisionStrategy, transition: BallTransitionStrategy)[source]

A physics engine component that characterizes event resolution

Important

For everything you need to know about this class, see :doc:`Modular Physics </resources/custom_physics>`_.

Methods:

resolve(shot: pooltool.system.datatypes.System, event: pooltool.events.datatypes.Event) None[source]

Resolve an event for a system

Attributes

pooltool.physics.resolve.resolver.RESOLVER_CONFIG_PATH

The location of the resolver config path YAML