src.common.strategy_manager

Enhanced strategy management with improved factory pattern and performance optimizations.

Functions

get_strategy_manager()

Get the global strategy manager instance.

reset_strategy_manager()

Reset the global strategy manager (useful for testing).

Classes

StrategyManager()

Enhanced strategy manager with caching and performance monitoring.

class src.common.strategy_manager.StrategyManager[source]

Enhanced strategy manager with caching and performance monitoring.

__init__()[source]
register_strategy(name, strategy_class)[source]

Register a new strategy class.

Return type:

None

get_strategy(name)[source]

Get a strategy instance (cached for performance).

Return type:

StatelessSolverStrategy

get_suggestions_with_monitoring(strategy_name, possible_words, common_words, guesses_so_far, count=10, word_manager=None)[source]

Get suggestions with performance monitoring.

Return type:

List[str]

get_available_strategies()[source]

Get list of available strategy names.

Return type:

List[str]

get_performance_stats()[source]

Get performance statistics for all strategies.

Return type:

Dict[str, Dict[str, Any]]

Recommend the best strategy based on game state.

Return type:

str

clear_instances()[source]

Clear cached strategy instances (useful for testing).

Return type:

None

src.common.strategy_manager.get_strategy_manager()[source]

Get the global strategy manager instance.

Return type:

StrategyManager

src.common.strategy_manager.reset_strategy_manager()[source]

Reset the global strategy manager (useful for testing).

Return type:

None