MCPcopy Index your code
hub / github.com/Tong89/smartNode / create_engine

Function create_engine

backend/core.py:2381–2390  ·  view source on GitHub ↗

工厂:创建引擎实例,可注入随机种子以保证可复现;autostart 控制是否启动后台线程。 未显式传 seed 时回退到环境变量 SMARTNODE_SEED(确定性模式)。

(seed=None, autostart=True)

Source from the content-addressed store, hash-verified

2379 )
2380
2381def create_engine(seed=None, autostart=True):
2382 """工厂:创建引擎实例,可注入随机种子以保证可复现;autostart 控制是否启动后台线程。
2383
2384 未显式传 seed 时回退到环境变量 SMARTNODE_SEED(确定性模式)。
2385 """
2386 if seed is None:
2387 from backend.config import get_seed
2388 seed = get_seed()
2389 rng = random.Random(seed) if seed is not None else random.Random()
2390 return SimulationEngine(rng=rng, autostart=autostart)
2391
2392
2393# 注意:导入 backend.core 不再自动创建实例或启动线程;由工厂在应用入口创建。

Callers 15

api.pyFile · 0.90
_make_engineMethod · 0.90
engineMethod · 0.90
isolated_engineFunction · 0.90
_make_engineFunction · 0.90
engineFunction · 0.90
test_engineFunction · 0.90
_engineFunction · 0.90

Calls 2

get_seedFunction · 0.90
SimulationEngineClass · 0.85

Tested by 15

_make_engineMethod · 0.72
engineMethod · 0.72
isolated_engineFunction · 0.72
_make_engineFunction · 0.72
engineFunction · 0.72
test_engineFunction · 0.72
_engineFunction · 0.72