示例#1
0
文件: plugin.py 项目: conradbm/pyomo
 def apply_to(self, model, **kwds):
     """
     Apply the transformation to the given model.
     """
     timer = TransformationTimer(self, 'in-place')
     if not hasattr(model, '_transformation_data'):
         model._transformation_data = TransformationData()
     self._apply_to(model, **kwds)
     timer.report()
示例#2
0
文件: plugin.py 项目: Pyomo/pyomo
 def apply_to(self, model, **kwds):
     """
     Apply the transformation to the given model.
     """
     timer = TransformationTimer(self, 'in-place')
     if not hasattr(model, '_transformation_data'):
         model._transformation_data = TransformationData()
     self._apply_to(model, **kwds)
     timer.report()
示例#3
0
文件: plugin.py 项目: conradbm/pyomo
 def create_using(self, model, **kwds):
     """
     Create a new model with this transformation
     """
     timer = TransformationTimer(self, 'out-of-place')
     if not hasattr(model, '_transformation_data'):
         model._transformation_data = TransformationData()
     new_model = self._create_using(model, **kwds)
     timer.report()
     return new_model
示例#4
0
文件: plugin.py 项目: Pyomo/pyomo
 def create_using(self, model, **kwds):
     """
     Create a new model with this transformation
     """
     timer = TransformationTimer(self, 'out-of-place')
     if not hasattr(model, '_transformation_data'):
         model._transformation_data = TransformationData()
     new_model = self._create_using(model, **kwds)
     timer.report()
     return new_model