DecompParam.h

Go to the documentation of this file.
00001 //===========================================================================//
00002 // This file is part of the Decomp Solver Framework.                         //
00003 //                                                                           //
00004 // Decomp is distributed under the Common Public License as part of the      //
00005 // COIN-OR repository (http://www.coin-or.org).                              //
00006 //                                                                           //
00007 // Author: Matthew Galati, Lehigh University                                 //
00008 //                                                                           //
00009 // Copyright (C) 2002-2007, Lehigh University, Matthew Galati, and Ted Ralphs//
00010 // All Rights Reserved.                                                      //
00011 //===========================================================================//
00012 
00013 #ifndef DECOMP_PARAM_INCLUDED
00014 #define DECOMP_PARAM_INCLUDED
00015 
00016 #include "UtilParameters.h"
00017 #include "DecompConstants.h"
00018 
00019 // --------------------------------------------------------------------- //
00020 class DecompParam {
00021 private:
00022    DecompParam(const DecompParam&);
00023    DecompParam& operator=(const DecompParam&);
00024 
00025 public:
00026 
00027    int    LogLevel;
00028    int    LogAppLevel;
00029    int    LogDebugLevel;
00030    int    LogLpLevel;    //name? inner solver
00031    unsigned int    LimitInitVars; //?? specific to PC? make own section ??
00032    double TolZero;
00033    int    LimitTotalCutIters;
00034    int    LimitTotalPriceIters;
00035    int    LimitRoundCutIters;
00036    int    LimitRoundPriceIters;
00037    double LimitTime;
00038    int    PriceMultiPoly;
00039    int    CutDC;
00040    int    CutCGL;
00041    //subsection?
00042    int    CutCglKnapC;
00043    int    CutCglFlowC;
00044    int    CutCglMir;
00045    int    CutCglClique;
00046 
00047 public:
00048    void getSettings(UtilParameters& utilParam) {
00049       static const char* common = "DECOMP";
00050       LogLevel      = utilParam.GetSetting("LogLevel",      0,     common);
00051       LogAppLevel   = utilParam.GetSetting("LogAppLevel",   0,     common);
00052       LogDebugLevel = utilParam.GetSetting("LogDebugLevel", 0,     common);
00053       LogLpLevel    = utilParam.GetSetting("LogLpLevel",    0,     common);
00054       LimitInitVars = utilParam.GetSetting("LimitInitVars", 1,     common);
00055       TolZero       = utilParam.GetSetting("TolZero",
00056                                            DecompEpsilon, common);
00057       LimitTotalCutIters  = utilParam.GetSetting("LimitTotalCutIters",
00058                             2000, common);
00059       LimitTotalPriceIters = utilParam.GetSetting("LimitTotalPriceIters",
00060                              2000, common);
00061       LimitRoundCutIters  = utilParam.GetSetting("LimitRoundCutIters",
00062                             2000, common);
00063       LimitRoundPriceIters = utilParam.GetSetting("LimitRoundPriceIters",
00064                              2000, common);
00065       LimitTime           = utilParam.GetSetting("LimitTime",
00066                             600, common);
00067       //TODO: what if we want multi-poly on just 1st and 3rd - TODO
00068       PriceMultiPoly       = utilParam.GetSetting("PriceMultiPoly",
00069                              0,     common);
00070       CutDC                = utilParam.GetSetting("CutDC",
00071                              0,     common);
00072       CutCGL                = utilParam.GetSetting("CutCGL",
00073                               0,     common);
00074       CutCglKnapC                = utilParam.GetSetting("CutCglKnapC",
00075                                    0,     common);
00076       CutCglFlowC                = utilParam.GetSetting("CutCglFlowC",
00077                                    0,     common);
00078       CutCglMir                = utilParam.GetSetting("CutCglMir",
00079                                  0,     common);
00080       CutCglClique                = utilParam.GetSetting("CutCglClique",
00081                                     0,     common);
00082    }
00083 
00084    //this should be a parameter method, should parameter be an object?
00085    //have user register parameters, so can set usage too
00086    void dumpSettings(ostream* os = &cout) {
00087       static const char* common = "DECOMP";
00088       (*os) << "\n========================================================\n"
00089             << "DECOMP PARAMETER SETTINGS \n";
00090       (*os) << common << ": LogLevel      = " << LogLevel      << endl;
00091       (*os) << common << ": LogAppLevel   = " << LogAppLevel   << endl;
00092       (*os) << common << ": LogDebugLevel = " << LogDebugLevel << endl;
00093       (*os) << common << ": LogLpLevel    = " << LogLpLevel    << endl;
00094       (*os) << common << ": LimitInitVars = " << LimitInitVars << endl;
00095       (*os) << common << ": TolZero       = " << TolZero       << endl;
00096       (*os) << common << ": LimitTotalCutIters   = "
00097             << LimitTotalCutIters      << endl;
00098       (*os) << common << ": LimitTotalPriceIters = "
00099             << LimitTotalPriceIters    << endl;
00100       (*os) << common << ": LimitRoundCutIters   = "
00101             << LimitRoundCutIters      << endl;
00102       (*os) << common << ": LimitRoundPriceIters = "
00103             << LimitRoundPriceIters    << endl;
00104       (*os) << common << ": PriceMultiPoly= " << PriceMultiPoly  << endl;
00105       (*os) << common << ": CutDC         = " << CutDC           << endl;
00106       (*os) << common << ": CutCGL        = " << CutCGL          << endl;
00107       (*os) << common << ": CutCglKnapC   = " << CutCglKnapC     << endl;
00108       (*os) << common << ": CutCglFlowC   = " << CutCglFlowC     << endl;
00109       (*os) << common << ": CutCglMir     = " << CutCglMir       << endl;
00110       (*os) << common << ": CutCglClique  = " << CutCglClique    << endl;
00111       (*os) << "========================================================\n";
00112    }
00113 
00114 public:
00115    DecompParam():
00116       LogLevel(0),
00117       LogAppLevel(0),
00118       LogDebugLevel(0),
00119       LogLpLevel(0),
00120       LimitInitVars(1),
00121       TolZero(DecompEpsilon),
00122       LimitTotalCutIters(2000),
00123       LimitTotalPriceIters(2000),
00124       LimitRoundCutIters(2000),
00125       LimitRoundPriceIters(2000),
00126       LimitTime(60),
00127       PriceMultiPoly(0),
00128       CutDC(0),
00129       CutCGL(0),
00130       CutCglKnapC(0),
00131       CutCglFlowC(0),
00132       CutCglMir(0),
00133       CutCglClique(0)
00134    {}
00135 
00136    ~DecompParam() {};
00137 };
00138 
00139 #endif

Generated on 5 Apr 2015 for Dip-All by  doxygen 1.6.1