Skip to content

Commit 7e62b25

Browse files
jzleibocopybara-github
authored andcommitted
fix type mismatch introduced by recent commit
PiperOrigin-RevId: 866403395 Change-Id: Ie7f81537d19610e83ae59605edbe1010915134f7
1 parent 2e93d54 commit 7e62b25

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

concordia/prefabs/simulation/questionnaire_simulation.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
from concordia.typing import entity_component
3131
from concordia.typing import prefab as prefab_lib
3232
from concordia.typing import simulation as simulation_lib
33+
from concordia.utils import structured_logging
3334
import numpy as np
3435

3536

@@ -241,7 +242,7 @@ def play(
241242
raw_log: list[Mapping[str, Any]] | None = None,
242243
checkpoint_path: str | None = None,
243244
verbose: bool = False,
244-
) -> str:
245+
) -> structured_logging.SimulationLog:
245246
"""Run the simulation.
246247
247248
Args:
@@ -255,7 +256,8 @@ def play(
255256
verbose: Whether to print verbose output.
256257
257258
Returns:
258-
JSON string of the raw simulation log.
259+
SimulationLog object with structured data. Use .to_html() for HTML output
260+
or .to_json() for JSON serialization.
259261
"""
260262

261263
logging.info("[QuestionnaireSimulation] Starting simulation.")
@@ -301,7 +303,7 @@ def play(
301303
finally:
302304
self._engine.shutdown()
303305
logging.info("[QuestionnaireSimulation] Simulation finished.")
304-
return json.dumps(raw_log, indent=2)
306+
return structured_logging.SimulationLog.from_raw_log(raw_log)
305307

306308
def save_checkpoint(self, step: int, checkpoint_path: str):
307309
"""Saves the state of all entities at the current step."""

0 commit comments

Comments
 (0)