code: def clone(self, debug = False, trace = False):
          
          new = empty_clone(self)
          new_dict = new.__dict__
  
          for key, value in self.__dict__.items():
              if key not in ('debug', 'trace', 'tracer'):
                  new_dict[key] = value
  
          new.persons = self.persons.clone(new)
          setattr(new, new.persons.entity.key, new.persons)
          new.populations = {new.persons.entity.key: new.persons}
  
          for entity in self.tax_benefit_system.group_entities:
              population = self.populations[entity.key].clone(new)
              new.populations[entity.key] = population
              setattr(new, entity.key, population)  # create shortcut simulation.household (for instance)
  
          new.debug = debug
          new.trace = trace
  
          return new
docs: Copy the simulation just enough to be able to run the copy without modifying the original simulation