def to_json(self) -> str:
    """Encode this dataclass as a string to serialize as a json file."""
    outcome_dict = dataclasses.asdict(self.simulation_outcome)
    outcome_dict['resident_scores'] = dict(outcome_dict['resident_scores'])
    outcome_dict['visitor_scores'] = dict(outcome_dict['visitor_scores'])
    outcome_dict['metadata'] = dict(outcome_dict['metadata'])

    self_as_dict = dataclasses.asdict(self)
    self_as_dict['simulation_outcome'] = outcome_dict

    return json.dumps(self_as_dict, indent=2)
Encode this dataclass as a string to serialize as a json file.
examples/deprecated/modular/utils/logging_types.py