Ignore:
Timestamp:
Nov 5, 2009 10:57:25 AM (10 years ago)
Author:
forrest
Message:

Creating new stable branch 2.4 from trunk (rev 1270)

Location:
stable/2.4
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • stable/2.4

    • Property svn:externals
      •  

        old new  
        77CoinUtils         https://projects.coin-or.org/svn/CoinUtils/stable/2.5/CoinUtils
        88Cgl               https://projects.coin-or.org/svn/Cgl/stable/0.54/Cgl
        9 Clp               https://projects.coin-or.org/svn/Clp/stable/1.10/Clp
         9Clp               https://projects.coin-or.org/svn/Clp/stable/1.11/Clp
        1010Osi               https://projects.coin-or.org/svn/Osi/stable/0.100/Osi
        1111Vol               https://projects.coin-or.org/svn/Vol/stable/1.1/Vol
  • stable/2.4/Cbc/src/CbcHeuristic.hpp

    r1127 r1271  
     1/* $Id$ */
    12// Copyright (C) 2002, International Business Machines
    23// Corporation and others.  All Rights Reserved.
     
    112113      Default is do nothing
    113114  */
    114   virtual int solution(double & objectiveValue,
    115                        double * newSolution,
    116                        OsiCuts & cs) {return 0;}
     115  virtual int solution2(double & /*objectiveValue*/,
     116                       double * /*newSolution*/,
     117                       OsiCuts & /*cs*/) {return 0;}
    117118
    118119  /// Validate model i.e. sets when_ to 0 if necessary (may be NULL)
     
    138139      1 bit - stop once allowable gap on objective reached
    139140      2 bit - always do given number of passes
    140       for other possibilities see switches_
     141      4 bit - weaken cutoff by 5% every 50 passes?
     142      8 bit - if has cutoff and suminf bobbling for 20 passes then
     143              first try halving distance to best possible then
     144              try keep halving distance to known cutoff
     145      1024 bit - stop all heuristics on max time
    141146  */
    142147  inline void setSwitches(int value)
     
    145150      1 bit - stop once allowable gap on objective reached
    146151      2 bit - always do given number of passes
    147       for other possibilities see switches_
     152      4 bit - weaken cutoff by 5% every 50 passes?
     153      8 bit - if has cutoff and suminf bobbling for 20 passes then
     154              first try halving distance to best possible then
     155              try keep halving distance to known cutoff
     156      1024 bit - stop all heuristics on max time
    148157  */
    149158  inline int switches() const
     
    188197                          double cutoff , std::string name) const;
    189198  /// Create C++ lines to get to current state
    190   virtual void generateCpp( FILE * fp) {}
     199  virtual void generateCpp( FILE * ) {}
    191200  /// Create C++ lines to get to current state - does work for base class
    192201  void generateCpp( FILE * fp,const char * heuristic) ;
     
    202211  /// Set random number generator seed
    203212  void setSeed(int value);
     213  /// Sets decay factor (for howOften) on failure
     214  inline void setDecayFactor(double value)
     215  { decayFactor_=value;}
    204216  /// Set input solution
    205217  void setInputSolution(const double * solution, double objValue);
    206 
    207   /** Check whether the heuristic should run at all */
    208   virtual bool shouldHeurRun();
     218  /* Runs if bit set
     219      0 - before cuts at root node (or from doHeuristics)
     220      1 - during cuts at root
     221      2 - after root node cuts
     222      3 - after cuts at other nodes
     223      4 - during cuts at other nodes
     224          8 added if previous heuristic in loop found solution
     225   */
     226  inline void setWhereFrom(int value)
     227  { whereFrom_=value;}
     228  /** Upto this depth we call the tree shallow and the heuristic can be called
     229      multiple times. That is, the test whether the current node is far from
     230      the others where the jeuristic was invoked will not be done, only the
     231      frequency will be tested. After that depth the heuristic will can be
     232      invoked only once per node, right before branching. That's when it'll be
     233      tested whether the heur should run at all. */
     234  inline void setShallowDepth(int value)
     235  { shallowDepth_=value;}
     236  /** How often to invoke the heuristics in the shallow part of the tree */
     237  inline void setHowOftenShallow(int value)
     238  { howOftenShallow_=value;}
     239  /** How "far" should this node be from every other where the heuristic was
     240      run in order to allow the heuristic to run in this node, too. Currently
     241      this is tested, but we may switch to avgDistanceToRun_ in the future. */
     242  inline void setMinDistanceToRun(int value)
     243  { minDistanceToRun_=value;}
     244
     245  /** Check whether the heuristic should run at all
     246      0 - before cuts at root node (or from doHeuristics)
     247      1 - during cuts at root
     248      2 - after root node cuts
     249      3 - after cuts at other nodes
     250      4 - during cuts at other nodes
     251          8 added if previous heuristic in loop found solution
     252  */
     253  virtual bool shouldHeurRun(int whereFrom);
    209254  /** Check whether the heuristic should run this time */
    210255  bool shouldHeurRun_randomChoice();
     
    218263  inline int numCouldRun() const
    219264  { return numCouldRun_;}
    220 
     265  /** Clone but ..
     266      type 0 clone solver, 1 clone continuous solver
     267      Add 2 to say without integer variables which are at low priority
     268      Add 4 to say quite likely infeasible so give up easily.*/
     269  OsiSolverInterface * cloneBut(int type);
    221270protected:
    222271
     
    246295      8 bit - if has cutoff and suminf bobbling for 20 passes then
    247296              first try halving distance to best possible then
    248               try keep halving distance to known cutoff
    249   */
    250   int switches_;
     297              try keep halving distance to known cutoff
     298      1024 bit - stop all heuristics on max time
     299  */
     300  mutable int switches_;
     301  /* Runs if bit set
     302      0 - before cuts at root node (or from doHeuristics)
     303      1 - during cuts at root
     304      2 - after root node cuts
     305      3 - after cuts at other nodes
     306      4 - during cuts at other nodes
     307          8 added if previous heuristic in loop found solution
     308   */
     309  int whereFrom_;
    251310  /** Upto this depth we call the tree shallow and the heuristic can be called
    252311      multiple times. That is, the test whether the current node is far from
     
    426485
    427486  /** Check whether the heuristic should run at all */
    428   virtual bool shouldHeurRun();
     487  virtual bool shouldHeurRun(int whereFrom);
    429488
    430489protected:
     
    532591      This is dummy as never called
    533592  */
    534   virtual bool selectVariableToBranch(OsiSolverInterface* solver,
    535                                       const double* newSolution,
    536                                       int& bestColumn,
    537                                       int& bestRound)
     593  virtual bool selectVariableToBranch(OsiSolverInterface* /*solver*/,
     594                                      const double* /*newSolution*/,
     595                                      int& /*bestColumn*/,
     596                                      int& /*bestRound*/)
    538597  { return true;}
    539598  /// Validate model i.e. sets when_ to 0 if necessary (may be NULL)
Note: See TracChangeset for help on using the changeset viewer.