docs: def _to_dict(self):
          """Return a json dictionary representing this model."""
          _dict = {}
          if hasattr(self, 'nodes_visited') and self.nodes_visited is not None:
              _dict['nodes_visited'] = [x._to_dict() for x in self.nodes_visited]
          if hasattr(self, 'log_messages') and self.log_messages is not None:
              _dict['log_messages'] = [x._to_dict() for x in self.log_messages]
          if hasattr(self, 'branch_exited') and self.branch_exited is not None:
              _dict['branch_exited'] = self.branch_exited
          if hasattr(self, 'branch_exited_reason'
                    ) and self.branch_exited_reason is not None:
              _dict['branch_exited_reason'] = self.branch_exited_reason
          return _dict