diff --git a/concordia/components/agent/person_representation.py b/concordia/components/agent/person_representation.py index baaddd0a..18daae94 100644 --- a/concordia/components/agent/person_representation.py +++ b/concordia/components/agent/person_representation.py @@ -185,3 +185,15 @@ def _make_pre_act_value(self) -> str: }) return result + + def get_state(self) -> entity_component.ComponentState: + """Converts the component to JSON data.""" + with self._lock: + return { + 'names_detected': self._names_detected, + } + + def set_state(self, state: entity_component.ComponentState) -> None: + """Sets the component state from JSON data.""" + with self._lock: + self._names_detected = state['names_detected']