Changeset 2058


Ignore:
Timestamp:
Dec 29, 2009 12:57:58 PM (10 years ago)
Author:
jwatson
Message:

Missed some _initialize_constraint function calls within the PySP EF writer during the recent switch to the corresponding "add" method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/ef.py

    r2029 r2058  
    422422            compute_excess_expression -= getattr(scenario_instance, cost_variable.name)[cost_variable_idx]
    423423         compute_excess_expression += cvar_eta_variable
    424          compute_excess_constraint._initialize_constraint(None, (0.0, compute_excess_expression, None), scenario_instance, compute_excess_constraint_name)
     424         compute_excess_constraint.add(None, (0.0, compute_excess_expression, None))
    425425         compute_excess_constraint._model = scenario_instance
    426426         setattr(scenario_instance, compute_excess_constraint_name, compute_excess_constraint)
     
    683683                        new_constraint = Constraint(name=new_constraint_name)
    684684                        new_expr = master_variable[index] - scenario_variable[index]
    685                         new_constraint._initialize_constraint(None, (0.0, new_expr, 0.0), master_binding_instance, new_constraint_name)
     685                        new_constraint.add(None, (0.0, new_expr, 0.0))
    686686                        new_constraint._model = master_binding_instance
    687687                        setattr(master_binding_instance, new_constraint_name, new_constraint)
     
    730730            new_constraint = Constraint(name=new_constraint_name)
    731731            new_expr = new_cost_variable[cost_variable_index] - scenario_cost_variable[cost_variable_index]
    732             new_constraint._initialize_constraint(None, (0.0, new_expr, 0.0), master_binding_instance, new_constraint_name)
     732            new_constraint.add(None, (0.0, new_expr, 0.0))
    733733            new_constraint._model = master_binding_instance
    734734            setattr(master_binding_instance, new_constraint_name, new_constraint)
     
    760760         new_constraint_name = "COST" + "_" + node_cost_variable_name + "_" + str(cost_variable_index)
    761761         new_constraint = Constraint(name=new_constraint_name)
    762          new_constraint._initialize_constraint(None, (0.0, constraint_expr, 0.0), master_binding_instance, new_constraint_name)
     762         new_constraint.add(None, (0.0, constraint_expr, 0.0))
    763763         new_constraint._model = master_binding_instance                     
    764764         setattr(master_binding_instance, new_constraint_name, new_constraint)
Note: See TracChangeset for help on using the changeset viewer.