MCPcopy Create free account
hub / github.com/Tong89/smartNode / restore

Method restore

backend/core.py:2318–2337  ·  view source on GitHub ↗

从快照字典恢复仿真状态,进入回放模式(主循环暂停)。 Parameters ---------- snapshot_data: 由 :meth:`snapshot` 生成的快照字典。 Returns ------- dict 恢复结果摘要。 Raises ------ ValueError 快照结构非法或版本不兼容时抛出。

(self, snapshot_data: dict)

Source from the content-addressed store, hash-verified

2316 return SnapshotManager.take(self, label=label)
2317
2318 def restore(self, snapshot_data: dict) -> dict:
2319 """从快照字典恢复仿真状态,进入回放模式(主循环暂停)。
2320
2321 Parameters
2322 ----------
2323 snapshot_data:
2324 由 :meth:`snapshot` 生成的快照字典。
2325
2326 Returns
2327 -------
2328 dict
2329 恢复结果摘要。
2330
2331 Raises
2332 ------
2333 ValueError
2334 快照结构非法或版本不兼容时抛出。
2335 """
2336 from backend.snapshot import SnapshotManager
2337 return SnapshotManager.restore(self, snapshot_data)
2338
2339 def resume_from_snapshot(self) -> bool:
2340 """退出回放模式,重新启动主仿真循环。

Calls

no outgoing calls