Ignore:
Timestamp:
Aug 21, 2009 12:19:13 PM (10 years ago)
Author:
forrest
Message:

fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/CbcHeuristicLocal.hpp

    r1173 r1212  
    140140};
    141141
     142/** Crossover Search class
     143 */
     144
     145class CbcHeuristicCrossover : public CbcHeuristic {
     146public:
     147
     148  // Default Constructor
     149  CbcHeuristicCrossover ();
     150
     151  /* Constructor with model - assumed before cuts
     152     Initial version does not do Lps
     153  */
     154  CbcHeuristicCrossover (CbcModel & model);
     155 
     156  // Copy constructor
     157  CbcHeuristicCrossover ( const CbcHeuristicCrossover &);
     158   
     159  // Destructor
     160  ~CbcHeuristicCrossover ();
     161 
     162  /// Clone
     163  virtual CbcHeuristic * clone() const;
     164
     165  /// Assignment operator
     166  CbcHeuristicCrossover & operator=(const CbcHeuristicCrossover& rhs);
     167
     168  /// Create C++ lines to get to current state
     169  virtual void generateCpp( FILE * fp) ;
     170
     171  /// Resets stuff if model changes
     172  virtual void resetModel(CbcModel * model);
     173
     174  /// update model (This is needed if cliques update matrix etc)
     175  virtual void setModel(CbcModel * model);
     176 
     177  using CbcHeuristic::solution ;
     178  /** returns 0 if no solution, 1 if valid solution.
     179      Fix variables if agree in useNumber_ solutions
     180      when_ 0 off, 1 only at new solutions, 2 also every now and then
     181      add 10 to make only if agree at lower bound
     182  */
     183  virtual int solution(double & objectiveValue,
     184                       double * newSolution);
     185
     186  /// Sets number of solutions to use
     187  inline void setNumberSolutions(int value)
     188  {
     189    if (value>0&&value<=10)
     190      useNumber_=value;
     191  }
     192
     193protected:
     194  // Data
     195  /// Attempts
     196  std::vector <double> attempts_;
     197  /// Random numbers to stop same search happening
     198  double random_[10];
     199  /// Number of solutions so we only do after new solution
     200  int numberSolutions_;
     201  /// Number of solutions to use
     202  int useNumber_;
     203};
    142204
    143205#endif
Note: See TracChangeset for help on using the changeset viewer.