Changeset 2386


Ignore:
Timestamp:
Feb 22, 2010 1:14:30 AM (10 years ago)
Author:
wehart
Message:

Adding a work-around when FDT fails.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.fdt/trunk/coopr/fdt/FDT.py

    r2221 r2386  
    33import copy
    44from pyutilib.misc import Container, Options
    5 import bidict
     5try:
     6    import bidict
     7    using_bidict=True
     8except:
     9    using_bidict=False
    610from pyutilib.component.core import implements
    711from coopr.pyomo import *
     
    219223                var.fixed = True
    220224        reduced_instance = apply_transformation('eliminate_fixed_vars', instance)
    221         varmap=bidict.bidict()
     225        if using_bidict:
     226            varmap=bidict.bidict()
     227        else:
     228            varmap={}
    222229        for i in xsequence(len(reduced_instance.variables())):
    223230            varmap[ reduced_instance.variable(i).id ] = reduced_instance.variable(i)._old_id
Note: See TracChangeset for help on using the changeset viewer.