Sorry if the title is not very clear. I was not sure about the appropriate title. Let me explain what I need.
I am doing multiple runs of a simulation, where each run corresponds to a different seed. However, I want the starting characteristics of the instances of a class to remain the same across the different runs. For example, consider the class of people in a city. In the code below the command city = people()
creates person objects each of whom has some wealth chosen randomly from a distribution. Let F(.) be the realized initial distribution of wealth in the population. As one particular run of a simulation is made, things change in the population and various attributes of the person objects get updated. For example, a person's income changes. The final values of these attributes depend on some random realizations that occur during the simulation run. Now I want to again run the simulation with a different random seed, where before the run begins all attributes are reset to their initial values (including the wealth distribution that was randomly determined). Should I make a shallowCopy or a deepCopy? Is there a third way that is better?
Thanks a ton.
city = people()
for seedValue in ListOfSeeds:
cityThisInstance = city.copy()
cityThisInstance.someAttribute = xxxxx
cityThisInstance.anotherAttribute = yyyyy
Rest of the code