source: releases/2.8.8/Cbc/scripts/run_cbc.sh

Last change on this file was 1854, checked in by stefan, 6 years ago

fix svn keywords property

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2#*                                                                           *
3#*            This file is part of the test engine for MIPLIB2010            *
4#*                                                                           *
5#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
6# $Id: run_cbc.sh 1854 2013-01-28 00:02:55Z tkr $
7
8SOLVER=$1
9BINNAME=$2
10NAME=$3
11TIMELIMIT=$4
12SOLFILE=$5
13THREADS=$6
14MIPGAP=$7
15
16TMPFILE=results/check.$SOLVER.tmp
17
18if test $THREADS != 0
19then
20    $BINNAME -import $NAME -sec $TIMELIMIT -threads $THREADS -ratio $MIPGAP -solve -solution $SOLFILE
21else
22    $BINNAME -import $NAME -sec $TIMELIMIT -ratio $MIPGAP -solve -solution $SOLFILE
23fi
24
25if test -f $SOLFILE
26then
27    # translate CBC solution format into format for solution checker.
28    #  The SOLFILE format is a very simple format where in each line
29    #  we have a <variable, value> pair, separated by spaces.
30    #  A variable name of =obj= is used to store the objective value
31    #  of the solution, as computed by the solver. A variable name of
32    #  =infeas= can be used to indicate that an instance is infeasible.
33    awk '
34    BEGIN{
35        infeasible = 0;
36        nointsol = 0;
37    }
38    ($3 != "objective" && $3 != "gap" && $3 != "time" && $2 != "infeasible"){
39        if (!infeasible){
40                printf ("%s %s \n", $2, $3);
41            }
42    }
43    ($3 == "objective" && $1 != "Infeasible" && $2 != "infeasible"){
44        printf ("=obj= %s \n", $5);
45    }
46    ($3 == "gap"){
47        printf ("=obj= %s \n", $8);
48    }
49    ($3 == "time"){
50        if ($5 == "integer"){
51           printf ("=nointsol= \n");
52           nointsol = 1;
53        }else{
54           printf ("=obj= %s \n", $7);
55        }
56    }   
57    ($1 == "Infeasible" || $2 == "infeasible"){
58        printf ("=infeas= \n");
59        infeasible = 1;
60    }' $SOLFILE | tee $TMPFILE
61    mv $TMPFILE $SOLFILE
62fi
Note: See TracBrowser for help on using the repository browser.