Changeset 3078


Ignore:
Timestamp:
Oct 5, 2010 10:46:33 AM (11 years ago)
Author:
jwatson
Message:

Fixing long-present bug in network flow model, exposed by Bill's recent commit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/examples/pysp/networkflow/models/ReferenceModel.py

    r2132 r3078  
    3535model.b0Cost = Param(model.Arcs)
    3636
    37 model.FCost = Param(model.Arcs)
     37model.FCost = Param(model.Nodes, model.Nodes)
    3838
    3939def compute_scenario_m_rule(model):
    4040   max_value = 0.0
    4141   for index in model.Demand:
    42       max_value = max(max_value, model.Demand[index]())
     42      max_value = max(max_value, value(model.Demand[index]))
    4343   return max_value
    4444model.M = Param(within=NonNegativeReals, default=0.0, rule=compute_scenario_m_rule)
Note: See TracChangeset for help on using the changeset viewer.