Changeset 9490


Ignore:
Timestamp:
Dec 14, 2014 10:50:18 PM (4 years ago)
Author:
wehart
Message:

Create a RealInterval? domain for many
relaxed integer domains

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyomo/trunk/pyomo/core/plugins/transform/relax_integrality.py

    r9485 r9490  
    1010from pyomo.util.plugin import alias
    1111from pyomo.core.base import Var
    12 from pyomo.core.base.set_types import BooleanSet, IntegerSet, Reals
     12from pyomo.core.base.set_types import BooleanSet, IntegerSet, Reals, RealInterval
    1313import pyomo.core.base
    1414from pyomo.core.plugins.transform.hierarchy import NonIsomorphicTransformation
     
    6565            if bnd is None:
    6666                bnd = ( None, None )
    67 
    6867            bnd = ( self._tightenBound(bnd[0], dbnd[0], max),
    6968                    self._tightenBound(bnd[1], dbnd[1], min) )
     69
    7070            if bnd == (None, None):
    71                 var.domain._bounds = None
     71                var.domain = Reals
    7272            else:
    73                 var.domain._bounds = bnd
     73                var.domain = RealInterval(bounds=bnd)
     74            #print("HERE %s %s %s %s %s" % (str(var), str(type(var.domain)), str(var.bounds), str(bnd), str(dbnd)))
    7475            var._initialize_members(var._index)
     76            #print("HERE %s %s %s %s %s" % (str(var), str(type(var.domain)), str(var.bounds), str(bnd), str(dbnd)))
    7577
    7678        return M
Note: See TracChangeset for help on using the changeset viewer.