Skip to content

Commit

Permalink
Rewritten Organism.clone() to manually copy the original organism's d…
Browse files Browse the repository at this point in the history
…ictionary keys one key at a time
  • Loading branch information
Clarence Castillo committed Oct 2, 2013
1 parent 0d6b2cb commit 75766b7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dose/genetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,12 @@ def clone(self):
@since: version 0.4
"""
return deepcopy(self)

org = deepcopy(self)
temp_status = {}
for key in self.status.keys():
temp_status[key] = self.status[key]
org.status = temp_status
return org

class Population(object):
"""
Expand Down

0 comments on commit 75766b7

Please sign in to comment.