add systemsolver copy method
This commit is contained in:
parent
09b8e662b1
commit
eb1b7fc8bb
@ -1,5 +1,7 @@
|
|||||||
from ..pgcollections import OrderedDict
|
from ..pgcollections import OrderedDict
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import copy
|
||||||
|
|
||||||
|
|
||||||
class SystemSolver(object):
|
class SystemSolver(object):
|
||||||
"""
|
"""
|
||||||
@ -73,6 +75,12 @@ class SystemSolver(object):
|
|||||||
self.__dict__['_currentGets'] = set()
|
self.__dict__['_currentGets'] = set()
|
||||||
self.reset()
|
self.reset()
|
||||||
|
|
||||||
|
def copy(self):
|
||||||
|
sys = type(self)()
|
||||||
|
sys.__dict__['_vars'] = copy.deepcopy(self.__dict__['_vars'])
|
||||||
|
sys.__dict__['_currentGets'] = copy.deepcopy(self.__dict__['_currentGets'])
|
||||||
|
return sys
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
"""
|
"""
|
||||||
Reset all variables in the solver to their default state.
|
Reset all variables in the solver to their default state.
|
||||||
|
Loading…
Reference in New Issue
Block a user