Changeset 2372


Ignore:
Timestamp:
Feb 18, 2010 2:55:38 PM (10 years ago)
Author:
jwatson
Message:

Added PySP test to exercise node-based instance data

Location:
coopr.pysp/trunk/coopr/pysp/tests/unit
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pysp/trunk/coopr/pysp/tests/unit/test_ph.py

    r2370 r2372  
    9898        self.failUnlessFileEqualsBaseline(current_directory+"farmer_linearized.out",current_directory+"farmer_linearized.baseline", filter=filter_time)
    9999
     100    def test_linearized_farmer_nodedata(self):
     101
     102        solver_string = ""
     103        if cplex_available:
     104            solver_string="cplex"
     105        elif glpk_available:
     106            solver_string="glpk"
     107        else:
     108           return
     109
     110        pyutilib.misc.setup_redirect(current_directory+"farmer_linearized_nodedata.out")
     111        farmer_examples_dir = pysp_examples_dir + "farmer"
     112        model_dir = farmer_examples_dir + os.sep + "models"
     113        instance_dir = farmer_examples_dir + os.sep + "nodedata"       
     114        argstring = "runph --solver="+solver_string+" --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir+" --linearize-nonbinary-penalty-terms=10"
     115        args = string.split(argstring)
     116        coopr.pysp.phinit.run(args=args)       
     117        pyutilib.misc.reset_redirect()
     118        self.cleanup()               
     119        self.failUnlessFileEqualsBaseline(current_directory+"farmer_linearized_nodedata.out",current_directory+"farmer_linearized_nodedata.baseline", filter=filter_time)       
     120
    100121    def test_quadratic_sizes3(self):
    101122
Note: See TracChangeset for help on using the changeset viewer.