Changeset 2269


Ignore:
Timestamp:
Feb 5, 2010 5:46:35 PM (10 years ago)
Author:
jwatson
Message:

Added SIZES3 PySP test and added absolute paths to "runph" script.

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

    r2268 r2269  
    1010
    1111pysp_examples_dir = dirname(dirname(dirname(dirname(dirname(abspath(__file__))))))+os.sep+"examples"+os.sep+"pysp"+os.sep
     12
     13coopr_bin_dir = dirname(dirname(dirname(dirname(dirname(dirname(dirname(abspath(__file__))))))))+os.sep+"bin"+os.sep
    1214
    1315#
     
    5860        model_dir = farmer_examples_dir + os.sep + "models"
    5961        instance_dir = farmer_examples_dir + os.sep + "scenariodata"       
    60         pyutilib.subprocess.run("lbin runph --solver=cplex --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir,outfile="farmer_quadratic.out")
     62        pyutilib.subprocess.run(coopr_bin_dir+"runph --solver=cplex --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir,outfile="farmer_quadratic.out")
    6163        # if the test passes, the first argument is deleted.
    6264        self.failUnlessFileEqualsBaseline(currdir+"farmer_quadratic.out",currdir+"farmer_quadratic.baseline", filter=filter_time)
     
    7375        model_dir = farmer_examples_dir + os.sep + "models"
    7476        instance_dir = farmer_examples_dir + os.sep + "scenariodata"       
    75         pyutilib.subprocess.run("lbin runph --solver=cplex --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir+" --linearize-nonbinary-penalty-terms=10",outfile="farmer_linearized.out")
     77        pyutilib.subprocess.run(coopr_bin_dir+"runph --solver=cplex --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir+" --linearize-nonbinary-penalty-terms=10",outfile="farmer_linearized.out")
    7678        # if the test passes, the first argument is deleted.
    7779        self.failUnlessFileEqualsBaseline(currdir+"farmer_linearized.out",currdir+"farmer_linearized.baseline", filter=filter_time)
     80
     81    def test_quadratic_sizes3(self):
     82
     83        if cplex_available is False:
     84           return
     85       
     86        pyutilib.misc.setup_redirect(currdir+"test_quadratic_sizes3.out")
     87        print "RUNNING QUADRATIC SIZES3 TEST"
     88        pyutilib.misc.reset_redirect()
     89        sizes_example_dir = pysp_examples_dir + os.sep + "sizes"
     90        model_dir = sizes_example_dir + os.sep + "models"
     91        instance_dir = sizes_example_dir + os.sep + "SIZES3"       
     92        pyutilib.subprocess.run(coopr_bin_dir+"runph --solver=cplex --solver-manager=serial --model-directory="+model_dir+" --instance-directory="+instance_dir+
     93                                " --max-iterations=200"+
     94                                " --rho-cfgfile="+sizes_example_dir+os.sep+"config"+os.sep+"rhosetter.cfg"+
     95                                " --scenario-solver-options=\"mip_tolerances_integrality=1e-7\""+
     96                                " --enable-ww-extensions"+
     97                                " --ww-extension-cfgfile="+sizes_example_dir+os.sep+"config"+os.sep+"wwph.cfg"+
     98                                " --ww-extension-suffixfile="+sizes_example_dir+os.sep+"config"+os.sep+"wwph.suffixes",
     99                                outfile="sizes3_quadratic.out")
     100        # if the test passes, the first argument is deleted.
     101        self.failUnlessFileEqualsBaseline(currdir+"sizes3_quadratic.out",currdir+"sizes3_quadratic.baseline", filter=filter_time)       
    78102
    79103    def run(self, result=None):
Note: See TracChangeset for help on using the changeset viewer.