engine.py¶
examples/pychess/engine.py
Engine wiring — connects entropic wrapper to chess game loop.
Owners: @tvanfossen
create_engine
ChessEngine engine.create_engine()
Instantiate EntropicEngine with pychess config.
examples/pychess/engine.py:44
Source · 11 lines
def create_engine() -> ChessEngine:
"""Create and configure the engine from local config.
@brief Instantiate EntropicEngine with pychess config.
@version 2
"""
config_path = EXAMPLE_ROOT / "data" / "default_config.yaml"
engine = EntropicEngine(config_path=str(config_path))
return ChessEngine(engine=engine, board=chess.Board())
Activity · 3 steps
Flows
shutdown
None engine.shutdown(ChessEngine chess_engine)
Destroy the C engine handle.
examples/pychess/engine.py:152
Source · 7 lines
def shutdown(chess_engine: ChessEngine) -> None:
"""Clean shutdown of entropic engine.
@brief Destroy the C engine handle.
@version 2
"""
chess_engine.engine.destroy()1 more lines, not shown