Changeset 3557


Ignore:
Timestamp:
01/29/11 19:18:45 (3 years ago)
Author:
jwatson
Message:

Modifications to PySP and test baselines to account for John's elimination of expression simplification and translation of Greater-Than constraints to the equivalent Less-Than constraints. Also some additional minor touch-up to re-establish the farmer baseline example.

Location:
coopr.pysp/trunk
Files:
10 edited

Legend:

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

    r3357 r3557  
    638638                           getattr(instance, weight_parameter_name)[index] = new_variable_weight 
    639639 
    640       # we shouldn't have to re-simplify the expression, as we aren't adding any constant-variable terms - just modifying parameters. 
    641  
    642640      end_time = time.time() 
    643641      self._cumulative_weight_time += (end_time - start_time) 
     
    677675                           new_variable_weight = (-new_variable_weight) 
    678676                        getattr(instance, weight_parameter_name)[index] = new_variable_weight 
    679  
    680       # we shouldn't have to re-simplify the expression, as we aren't adding any constant-variable terms - just modifying parameters. 
    681677 
    682678      end_time = time.time() 
     
    725721                     if (instance_variable.status is not VarStatus.unused) and (instance_variable.fixed is False): 
    726722                         
    727                         # TBD - if maximizing, here is where you would want "-=" - however, if you do this, the collect/simplify process chokes. 
     723                        # TBD - if maximizing, here is where you would want "-=" - however, if you do this, the collect process chokes. 
    728724                        objective_expression += (w_parameter[index] * instance_variable) 
    729725                        quad_expression += (rho_parameter[index] * (instance_variable - average_parameter[index]) ** 2) 
     
    732728         # pre-processed out of the expression tree. however, if the under-the-hood should change, 
    733729         # we'll be covered. 
    734          objective_expression.simplify(instance) 
    735730         instance.active_components(Objective)[objective_name]._data[None].expr = objective_expression 
    736731         instance.active_components(Objective)[objective_name]._quad_subexpr = quad_expression 
  • coopr.pysp/trunk/coopr/pysp/ph.py

    r3479 r3557  
    465465      # indicating unassigned. 
    466466      self._mipgap = None 
    467  
    468       # should PH simplify expressions after creating them? an example includes 
    469       # the objective function expression, either with or without linearization. 
    470       self._simplify_expressions = False 
    471467 
    472468      # we only store these temporarily... 
     
    497493      self._checkpoint_interval    = kwds.pop( 'checkpoint_interval', self._checkpoint_interval ) 
    498494      self._output_scenario_tree_solution = kwds.pop( 'output_scenario_tree_solution', self._output_scenario_tree_solution ) 
    499       self._simplify_expressions   = kwds.pop( 'simplify_expressions', self._simplify_expressions ) 
    500495 
    501496      for key in kwds.keys(): 
     
    637632                                                         self._verbose, 
    638633                                                         preprocess=False, 
    639                                                          linearize=linearize, 
    640                                                          simplify=self._simplify_expressions) 
     634                                                         linearize=linearize) 
    641635 
    642636         # important - mark the scenario instances as "concrete" - PH augments 
     
    10361030                        weight_parameter[index].value = new_variable_weight 
    10371031 
    1038       # we shouldn't have to re-simplify the expression, as we aren't adding any constant-variable terms - just modifying parameters. 
    1039  
    10401032      end_time = time.time() 
    10411033      self._cumulative_weight_time += (end_time - start_time) 
     
    10531045                                       self._retain_quadratic_binary_terms, \ 
    10541046                                       self._breakpoint_strategy, \ 
    1055                                        self._integer_tolerance, \ 
    1056                                        self._simplify_expressions) 
     1047                                       self._integer_tolerance) 
    10571048         self._instance_augmented_attributes[instance_name].extend(new_attrs) 
    10581049 
  • coopr.pysp/trunk/coopr/pysp/phinit.py

    r3482 r3557  
    197197     dest="linearize_expressions", 
    198198     default=False) 
    199    phOpts.add_option("--simplify-expressions", 
    200      help="Enable expression simplification during both model instance creation and any " \ 
    201           "subsequent modifications of the model, e.g., during manipulation of the objective.", 
    202      action="store_true", 
    203      dest="simplify_expressions", 
    204      default=False) 
    205199 
    206200   solverOpts.add_option('--scenario-mipgap', 
     
    401395      if options.verbose is True: 
    402396         print "Scenario reference instance filename="+reference_instance_filename 
    403       reference_instance = reference_model.create(reference_instance_filename, preprocess=False, simplify=options.simplify_expressions) 
     397      reference_instance = reference_model.create(reference_instance_filename, preprocess=False) 
    404398      # IMPT: disable canonical representation construction for ASL solvers. 
    405399      #       this is a hack, in that we need to address encodings and 
     
    425419      if options.verbose is True: 
    426420         print "Scenario tree instance filename="+scenario_tree_instance_filename 
    427       scenario_tree_instance = scenario_tree_model.create(scenario_tree_instance_filename, simplify=options.simplify_expressions) 
     421      scenario_tree_instance = scenario_tree_model.create(scenario_tree_instance_filename) 
    428422   except IOError: 
    429423      print "***ERROR: Failed to load scenario tree reference instance data from file="+scenario_tree_instance_filename 
     
    586580                           linearize_nonbinary_penalty_terms=options.linearize_nonbinary_penalty_terms, \ 
    587581                           breakpoint_strategy=options.breakpoint_strategy, \ 
    588                            checkpoint_interval=options.checkpoint_interval, \ 
    589                            simplify_expressions=options.simplify_expressions) 
     582                           checkpoint_interval=options.checkpoint_interval) 
    590583 
    591584   ph.initialize(scenario_data_directory_name=os.path.expanduser(options.instance_directory), \ 
  • coopr.pysp/trunk/coopr/pysp/phobjective.py

    r3524 r3557  
    219219   # clone the objective, because we're going to augment (repeatedly) the original objective. 
    220220   objective_expression = original_objective_expression.clone() 
    221    objective_expression.simplify(instance) 
    222221   instance.active_components(Objective)[objective_name]._data[None].expr = objective_expression 
    223222   instance.active_components(Objective)[objective_name]._quad_subexpr = None 
     
    232231                      linearize_nonbinary_penalty_terms, drop_proximal_terms, \ 
    233232                      retain_quadratic_binary_terms, breakpoint_strategy, \ 
    234                       tolerance, simplify_expressions): 
     233                      tolerance): 
    235234 
    236235   new_instance_attributes = [] 
     
    297296 
    298297               # add the linear (w-weighted) term is a consistent fashion, independent of variable type. 
    299                # if maximizing, here is where you would want "-=" - however, if you do this, the collect/simplify process chokes for reasons currently unknown. 
     298               # if maximizing, here is where you would want "-=" - however, if you do this, the collect process chokes for reasons currently unknown. 
    300299               objective_expression += (value(w_parameter[index]) * instance_variable[index]) 
    301300 
     
    394393                        quad_expression += (blend_parameter[index] * rho_parameter[index] * (instance_variable[index] - average_parameter[index]) ** 2) 
    395394 
    396    # simplification should actually not be required, at least for LPs and MIPs - repeating variables 
    397    # is not problematic in this context. it may be, though, in the land of NLPs. hence, the option. 
    398    if simplify_expressions is True: 
    399       objective_expression.simplify(instance) 
    400  
    401395   # assign the new expression to the objective. 
    402396   instance.active_components(Objective)[objective_name]._data[None].expr = objective_expression 
  • coopr.pysp/trunk/coopr/pysp/phutils.py

    r3454 r3557  
    216216                                verbose, 
    217217                                preprocess = True, 
    218                                 linearize = True, 
    219                                 simplify = True): 
     218                                linearize = True): 
    220219 
    221220   if verbose is True: 
     
    236235         if verbose is True: 
    237236            print "Data for scenario=" + scenario._name + " loads from file=" + scenario_data_filename 
    238          scenario_instance = reference_model.create(scenario_data_filename, simplify=simplify) 
     237         scenario_instance = reference_model.create(scenario_data_filename) 
    239238      else: 
    240239         scenario_instance = reference_model.clone() 
     
    259258 
    260259         scenario_data.read(model=scenario_instance) 
    261          scenario_instance.load(scenario_data, simplify=simplify) 
     260         scenario_instance.load(scenario_data) 
    262261         if preprocess is True: 
    263262            scenario_instance.preprocess()          
  • coopr.pysp/trunk/coopr/pysp/tests/unit/hydro_ef.baseline.lp

    r3453 r3557  
    11581158\ End constraint block for master  
    11591159\ Begin constraint block for scenario Scen8 
    1160 Scen8_c_l_conserv(1)_: 
    1161 -0.604800 Scen8_Pgh(1) 
     1160Scen8_c_u_conserv(1)_: 
     1161+0.604800 Scen8_Pgh(1) 
     1162+1.000000 Scen8_Vol(1) 
     1163<= 90.72 
     1164 
     1165Scen8_c_u_conserv(2)_: 
     1166+0.604800 Scen8_Pgh(2) 
    11621167-1.000000 Scen8_Vol(1) 
    1163 >= -90.72 
    1164  
    1165 Scen8_c_l_conserv(2)_: 
    1166 -0.604800 Scen8_Pgh(2) 
    1167 +1.000000 Scen8_Vol(1) 
     1168+1.000000 Scen8_Vol(2) 
     1169<= 54.432 
     1170 
     1171Scen8_c_u_conserv(3)_: 
     1172+1.209600 Scen8_Pgh(3) 
    11681173-1.000000 Scen8_Vol(2) 
    1169 >= -54.432 
    1170  
    1171 Scen8_c_l_conserv(3)_: 
    1172 -1.209600 Scen8_Pgh(3) 
    1173 +1.000000 Scen8_Vol(2) 
    1174 -1.000000 Scen8_Vol(3) 
    1175 >= -60.48 
     1174+1.000000 Scen8_Vol(3) 
     1175<= 60.48 
    11761176 
    11771177Scen8_c_e_StageCostConstraint(1)_: 
     
    11971197= 0.0 
    11981198 
    1199 Scen8_c_l_fcfe_: 
    1200 +4166.670000 Scen8_Vol(3) 
    1201 +1.000000 Scen8_sl 
    1202 >= 252000.2016 
     1199Scen8_c_u_fcfe_: 
     1200-4166.670000 Scen8_Vol(3) 
     1201-1.000000 Scen8_sl 
     1202<= -252000.2016 
    12031203 
    12041204Scen8_c_e_demand(1)_: 
     
    12261226 
    12271227\ Begin constraint block for scenario Scen9 
    1228 Scen9_c_l_conserv(1)_: 
    1229 -0.604800 Scen9_Pgh(1) 
     1228Scen9_c_u_conserv(1)_: 
     1229+0.604800 Scen9_Pgh(1) 
     1230+1.000000 Scen9_Vol(1) 
     1231<= 90.72 
     1232 
     1233Scen9_c_u_conserv(2)_: 
     1234+0.604800 Scen9_Pgh(2) 
    12301235-1.000000 Scen9_Vol(1) 
    1231 >= -90.72 
    1232  
    1233 Scen9_c_l_conserv(2)_: 
    1234 -0.604800 Scen9_Pgh(2) 
    1235 +1.000000 Scen9_Vol(1) 
     1236+1.000000 Scen9_Vol(2) 
     1237<= 54.432 
     1238 
     1239Scen9_c_u_conserv(3)_: 
     1240+1.209600 Scen9_Pgh(3) 
    12361241-1.000000 Scen9_Vol(2) 
    1237 >= -54.432 
    1238  
    1239 Scen9_c_l_conserv(3)_: 
    1240 -1.209600 Scen9_Pgh(3) 
    1241 +1.000000 Scen9_Vol(2) 
    1242 -1.000000 Scen9_Vol(3) 
    1243 >= -72.576 
     1242+1.000000 Scen9_Vol(3) 
     1243<= 72.576 
    12441244 
    12451245Scen9_c_e_StageCostConstraint(1)_: 
     
    12651265= 0.0 
    12661266 
    1267 Scen9_c_l_fcfe_: 
    1268 +4166.670000 Scen9_Vol(3) 
    1269 +1.000000 Scen9_sl 
    1270 >= 252000.2016 
     1267Scen9_c_u_fcfe_: 
     1268-4166.670000 Scen9_Vol(3) 
     1269-1.000000 Scen9_sl 
     1270<= -252000.2016 
    12711271 
    12721272Scen9_c_e_demand(1)_: 
     
    12941294 
    12951295\ Begin constraint block for scenario Scen1 
    1296 Scen1_c_l_conserv(1)_: 
    1297 -0.604800 Scen1_Pgh(1) 
     1296Scen1_c_u_conserv(1)_: 
     1297+0.604800 Scen1_Pgh(1) 
     1298+1.000000 Scen1_Vol(1) 
     1299<= 90.72 
     1300 
     1301Scen1_c_u_conserv(2)_: 
     1302+0.604800 Scen1_Pgh(2) 
    12981303-1.000000 Scen1_Vol(1) 
    1299 >= -90.72 
    1300  
    1301 Scen1_c_l_conserv(2)_: 
    1302 -0.604800 Scen1_Pgh(2) 
    1303 +1.000000 Scen1_Vol(1) 
     1304+1.000000 Scen1_Vol(2) 
     1305<= 6.048 
     1306 
     1307Scen1_c_u_conserv(3)_: 
     1308+1.209600 Scen1_Pgh(3) 
    13041309-1.000000 Scen1_Vol(2) 
    1305 >= -6.048 
    1306  
    1307 Scen1_c_l_conserv(3)_: 
    1308 -1.209600 Scen1_Pgh(3) 
    1309 +1.000000 Scen1_Vol(2) 
    1310 -1.000000 Scen1_Vol(3) 
    1311 >= -48.384 
     1310+1.000000 Scen1_Vol(3) 
     1311<= 48.384 
    13121312 
    13131313Scen1_c_e_StageCostConstraint(1)_: 
     
    13331333= 0.0 
    13341334 
    1335 Scen1_c_l_fcfe_: 
    1336 +4166.670000 Scen1_Vol(3) 
    1337 +1.000000 Scen1_sl 
    1338 >= 252000.2016 
     1335Scen1_c_u_fcfe_: 
     1336-4166.670000 Scen1_Vol(3) 
     1337-1.000000 Scen1_sl 
     1338<= -252000.2016 
    13391339 
    13401340Scen1_c_e_demand(1)_: 
     
    13621362 
    13631363\ Begin constraint block for scenario Scen2 
    1364 Scen2_c_l_conserv(1)_: 
    1365 -0.604800 Scen2_Pgh(1) 
     1364Scen2_c_u_conserv(1)_: 
     1365+0.604800 Scen2_Pgh(1) 
     1366+1.000000 Scen2_Vol(1) 
     1367<= 90.72 
     1368 
     1369Scen2_c_u_conserv(2)_: 
     1370+0.604800 Scen2_Pgh(2) 
    13661371-1.000000 Scen2_Vol(1) 
    1367 >= -90.72 
    1368  
    1369 Scen2_c_l_conserv(2)_: 
    1370 -0.604800 Scen2_Pgh(2) 
    1371 +1.000000 Scen2_Vol(1) 
     1372+1.000000 Scen2_Vol(2) 
     1373<= 6.048 
     1374 
     1375Scen2_c_u_conserv(3)_: 
     1376+1.209600 Scen2_Pgh(3) 
    13721377-1.000000 Scen2_Vol(2) 
    1373 >= -6.048 
    1374  
    1375 Scen2_c_l_conserv(3)_: 
    1376 -1.209600 Scen2_Pgh(3) 
    1377 +1.000000 Scen2_Vol(2) 
    1378 -1.000000 Scen2_Vol(3) 
    1379 >= -60.48 
     1378+1.000000 Scen2_Vol(3) 
     1379<= 60.48 
    13801380 
    13811381Scen2_c_e_StageCostConstraint(1)_: 
     
    14011401= 0.0 
    14021402 
    1403 Scen2_c_l_fcfe_: 
    1404 +4166.670000 Scen2_Vol(3) 
    1405 +1.000000 Scen2_sl 
    1406 >= 252000.2016 
     1403Scen2_c_u_fcfe_: 
     1404-4166.670000 Scen2_Vol(3) 
     1405-1.000000 Scen2_sl 
     1406<= -252000.2016 
    14071407 
    14081408Scen2_c_e_demand(1)_: 
     
    14301430 
    14311431\ Begin constraint block for scenario Scen3 
    1432 Scen3_c_l_conserv(1)_: 
    1433 -0.604800 Scen3_Pgh(1) 
     1432Scen3_c_u_conserv(1)_: 
     1433+0.604800 Scen3_Pgh(1) 
     1434+1.000000 Scen3_Vol(1) 
     1435<= 90.72 
     1436 
     1437Scen3_c_u_conserv(2)_: 
     1438+0.604800 Scen3_Pgh(2) 
    14341439-1.000000 Scen3_Vol(1) 
    1435 >= -90.72 
    1436  
    1437 Scen3_c_l_conserv(2)_: 
    1438 -0.604800 Scen3_Pgh(2) 
    1439 +1.000000 Scen3_Vol(1) 
     1440+1.000000 Scen3_Vol(2) 
     1441<= 6.048 
     1442 
     1443Scen3_c_u_conserv(3)_: 
     1444+1.209600 Scen3_Pgh(3) 
    14401445-1.000000 Scen3_Vol(2) 
    1441 >= -6.048 
    1442  
    1443 Scen3_c_l_conserv(3)_: 
    1444 -1.209600 Scen3_Pgh(3) 
    1445 +1.000000 Scen3_Vol(2) 
    1446 -1.000000 Scen3_Vol(3) 
    1447 >= -72.576 
     1446+1.000000 Scen3_Vol(3) 
     1447<= 72.576 
    14481448 
    14491449Scen3_c_e_StageCostConstraint(1)_: 
     
    14691469= 0.0 
    14701470 
    1471 Scen3_c_l_fcfe_: 
    1472 +4166.670000 Scen3_Vol(3) 
    1473 +1.000000 Scen3_sl 
    1474 >= 252000.2016 
     1471Scen3_c_u_fcfe_: 
     1472-4166.670000 Scen3_Vol(3) 
     1473-1.000000 Scen3_sl 
     1474<= -252000.2016 
    14751475 
    14761476Scen3_c_e_demand(1)_: 
     
    14981498 
    14991499\ Begin constraint block for scenario Scen4 
    1500 Scen4_c_l_conserv(1)_: 
    1501 -0.604800 Scen4_Pgh(1) 
     1500Scen4_c_u_conserv(1)_: 
     1501+0.604800 Scen4_Pgh(1) 
     1502+1.000000 Scen4_Vol(1) 
     1503<= 90.72 
     1504 
     1505Scen4_c_u_conserv(2)_: 
     1506+0.604800 Scen4_Pgh(2) 
    15021507-1.000000 Scen4_Vol(1) 
    1503 >= -90.72 
    1504  
    1505 Scen4_c_l_conserv(2)_: 
    1506 -0.604800 Scen4_Pgh(2) 
    1507 +1.000000 Scen4_Vol(1) 
     1508+1.000000 Scen4_Vol(2) 
     1509<= 30.24 
     1510 
     1511Scen4_c_u_conserv(3)_: 
     1512+1.209600 Scen4_Pgh(3) 
    15081513-1.000000 Scen4_Vol(2) 
    1509 >= -30.24 
    1510  
    1511 Scen4_c_l_conserv(3)_: 
    1512 -1.209600 Scen4_Pgh(3) 
    1513 +1.000000 Scen4_Vol(2) 
    1514 -1.000000 Scen4_Vol(3) 
    1515 >= -48.384 
     1514+1.000000 Scen4_Vol(3) 
     1515<= 48.384 
    15161516 
    15171517Scen4_c_e_StageCostConstraint(1)_: 
     
    15371537= 0.0 
    15381538 
    1539 Scen4_c_l_fcfe_: 
    1540 +4166.670000 Scen4_Vol(3) 
    1541 +1.000000 Scen4_sl 
    1542 >= 252000.2016 
     1539Scen4_c_u_fcfe_: 
     1540-4166.670000 Scen4_Vol(3) 
     1541-1.000000 Scen4_sl 
     1542<= -252000.2016 
    15431543 
    15441544Scen4_c_e_demand(1)_: 
     
    15661566 
    15671567\ Begin constraint block for scenario Scen5 
    1568 Scen5_c_l_conserv(1)_: 
    1569 -0.604800 Scen5_Pgh(1) 
     1568Scen5_c_u_conserv(1)_: 
     1569+0.604800 Scen5_Pgh(1) 
     1570+1.000000 Scen5_Vol(1) 
     1571<= 90.72 
     1572 
     1573Scen5_c_u_conserv(2)_: 
     1574+0.604800 Scen5_Pgh(2) 
    15701575-1.000000 Scen5_Vol(1) 
    1571 >= -90.72 
    1572  
    1573 Scen5_c_l_conserv(2)_: 
    1574 -0.604800 Scen5_Pgh(2) 
    1575 +1.000000 Scen5_Vol(1) 
     1576+1.000000 Scen5_Vol(2) 
     1577<= 30.24 
     1578 
     1579Scen5_c_u_conserv(3)_: 
     1580+1.209600 Scen5_Pgh(3) 
    15761581-1.000000 Scen5_Vol(2) 
    1577 >= -30.24 
    1578  
    1579 Scen5_c_l_conserv(3)_: 
    1580 -1.209600 Scen5_Pgh(3) 
    1581 +1.000000 Scen5_Vol(2) 
    1582 -1.000000 Scen5_Vol(3) 
    1583 >= -60.48 
     1582+1.000000 Scen5_Vol(3) 
     1583<= 60.48 
    15841584 
    15851585Scen5_c_e_StageCostConstraint(1)_: 
     
    16051605= 0.0 
    16061606 
    1607 Scen5_c_l_fcfe_: 
    1608 +4166.670000 Scen5_Vol(3) 
    1609 +1.000000 Scen5_sl 
    1610 >= 252000.2016 
     1607Scen5_c_u_fcfe_: 
     1608-4166.670000 Scen5_Vol(3) 
     1609-1.000000 Scen5_sl 
     1610<= -252000.2016 
    16111611 
    16121612Scen5_c_e_demand(1)_: 
     
    16341634 
    16351635\ Begin constraint block for scenario Scen6 
    1636 Scen6_c_l_conserv(1)_: 
    1637 -0.604800 Scen6_Pgh(1) 
     1636Scen6_c_u_conserv(1)_: 
     1637+0.604800 Scen6_Pgh(1) 
     1638+1.000000 Scen6_Vol(1) 
     1639<= 90.72 
     1640 
     1641Scen6_c_u_conserv(2)_: 
     1642+0.604800 Scen6_Pgh(2) 
    16381643-1.000000 Scen6_Vol(1) 
    1639 >= -90.72 
    1640  
    1641 Scen6_c_l_conserv(2)_: 
    1642 -0.604800 Scen6_Pgh(2) 
    1643 +1.000000 Scen6_Vol(1) 
     1644+1.000000 Scen6_Vol(2) 
     1645<= 30.24 
     1646 
     1647Scen6_c_u_conserv(3)_: 
     1648+1.209600 Scen6_Pgh(3) 
    16441649-1.000000 Scen6_Vol(2) 
    1645 >= -30.24 
    1646  
    1647 Scen6_c_l_conserv(3)_: 
    1648 -1.209600 Scen6_Pgh(3) 
    1649 +1.000000 Scen6_Vol(2) 
    1650 -1.000000 Scen6_Vol(3) 
    1651 >= -72.576 
     1650+1.000000 Scen6_Vol(3) 
     1651<= 72.576 
    16521652 
    16531653Scen6_c_e_StageCostConstraint(1)_: 
     
    16731673= 0.0 
    16741674 
    1675 Scen6_c_l_fcfe_: 
    1676 +4166.670000 Scen6_Vol(3) 
    1677 +1.000000 Scen6_sl 
    1678 >= 252000.2016 
     1675Scen6_c_u_fcfe_: 
     1676-4166.670000 Scen6_Vol(3) 
     1677-1.000000 Scen6_sl 
     1678<= -252000.2016 
    16791679 
    16801680Scen6_c_e_demand(1)_: 
     
    17021702 
    17031703\ Begin constraint block for scenario Scen7 
    1704 Scen7_c_l_conserv(1)_: 
    1705 -0.604800 Scen7_Pgh(1) 
     1704Scen7_c_u_conserv(1)_: 
     1705+0.604800 Scen7_Pgh(1) 
     1706+1.000000 Scen7_Vol(1) 
     1707<= 90.72 
     1708 
     1709Scen7_c_u_conserv(2)_: 
     1710+0.604800 Scen7_Pgh(2) 
    17061711-1.000000 Scen7_Vol(1) 
    1707 >= -90.72 
    1708  
    1709 Scen7_c_l_conserv(2)_: 
    1710 -0.604800 Scen7_Pgh(2) 
    1711 +1.000000 Scen7_Vol(1) 
     1712+1.000000 Scen7_Vol(2) 
     1713<= 54.432 
     1714 
     1715Scen7_c_u_conserv(3)_: 
     1716+1.209600 Scen7_Pgh(3) 
    17121717-1.000000 Scen7_Vol(2) 
    1713 >= -54.432 
    1714  
    1715 Scen7_c_l_conserv(3)_: 
    1716 -1.209600 Scen7_Pgh(3) 
    1717 +1.000000 Scen7_Vol(2) 
    1718 -1.000000 Scen7_Vol(3) 
    1719 >= -48.384 
     1718+1.000000 Scen7_Vol(3) 
     1719<= 48.384 
    17201720 
    17211721Scen7_c_e_StageCostConstraint(1)_: 
     
    17411741= 0.0 
    17421742 
    1743 Scen7_c_l_fcfe_: 
    1744 +4166.670000 Scen7_Vol(3) 
    1745 +1.000000 Scen7_sl 
    1746 >= 252000.2016 
     1743Scen7_c_u_fcfe_: 
     1744-4166.670000 Scen7_Vol(3) 
     1745-1.000000 Scen7_sl 
     1746<= -252000.2016 
    17471747 
    17481748Scen7_c_e_demand(1)_: 
  • coopr.pysp/trunk/examples/pysp/farmer/models/ReferenceModel.py

    r3553 r3557  
    2020 
    2121model.TOTAL_ACREAGE = Param(within=PositiveReals) 
    22  
    23 model.RentOutRatePerAcre = Param(within=PositiveReals) 
    2422 
    2523model.PriceQuota = Param(model.CROPS, within=PositiveReals) 
     
    4644model.DevotedAcreage = Var(model.CROPS, bounds=(0.0, model.TOTAL_ACREAGE)) 
    4745 
    48 model.RentedOutAcreage = Var(bounds=(0.0, model.TOTAL_ACREAGE)) 
    49  
    5046model.QuantitySubQuotaSold = Var(model.CROPS, bounds=(0.0, None)) 
    5147model.QuantitySuperQuotaSold = Var(model.CROPS, bounds=(0.0, None)) 
     
    6157 
    6258def total_acreage_rule(model): 
    63     return summation(model.DevotedAcreage) + model.RentedOutAcreage <= model.TOTAL_ACREAGE 
     59    return summation(model.DevotedAcreage) <= model.TOTAL_ACREAGE 
    6460 
    6561model.ConstrainTotalAcreage = Constraint(rule=total_acreage_rule) 
     
    8581 
    8682def first_stage_cost_rule(model): 
    87    return model.FirstStageCost - summation(model.PlantingCostPerAcre, model.DevotedAcreage) + model.RentedOutAcreage * model.RentOutRatePerAcre == 0.0 
     83   return model.FirstStageCost - summation(model.PlantingCostPerAcre, model.DevotedAcreage) == 0.0 
    8884 
    8985model.ComputeFirstStageCost = Constraint(rule=first_stage_cost_rule) 
  • coopr.pysp/trunk/examples/pysp/farmer/nodedata/ReferenceModel.dat

    r3550 r3557  
    22 
    33param TOTAL_ACREAGE := 500 ; 
    4  
    5 param RentOutRatePerAcre := 411 ; 
    64 
    75# no quotas on wheat or corn 
  • coopr.pysp/trunk/examples/pysp/farmer/nodedata/RootNode.dat

    r3551 r3557  
    22 
    33param TOTAL_ACREAGE := 500 ; 
    4  
    5 param RentOutRatePerAcre := 411 ; 
    64 
    75# no quotas on wheat or corn 
  • coopr.pysp/trunk/examples/pysp/farmer/nodedata/ScenarioStructure.dat

    r3552 r3557  
    3030                          AboveAverageScenario AboveAverageNode ; 
    3131 
    32 set StageVariables[FirstStage] :=  DevotedAcreage[*] 
    33                                    RentedOutAcreage ; 
     32set StageVariables[FirstStage] :=  DevotedAcreage[*] ; 
    3433set StageVariables[SecondStage] := QuantitySubQuotaSold[*] 
    3534                                   QuantitySuperQuotaSold[*] 
Note: See TracChangeset for help on using the changeset viewer.