/home/coin/SVN-release/OS-2.1.0/Bonmin/src/CbcBonmin/Heuristics/BonPumpForMinlp.cpp

Go to the documentation of this file.
00001 // (C) Copyright CNRS
00002 // This code is published under the Common Public License.
00003 //
00004 // Authors :
00005 // Pierre Bonami, LIF Université de la Méditérannée-CNRS
00006 //
00007 // Date : 02/18/2009
00008 
00009 #include "BonPumpForMinlp.hpp"
00010 #include "CbcModel.hpp"
00011 #include "OsiBranchingObject.hpp"
00012 
00013 namespace Bonmin {
00014 
00016   PumpForMinlp::PumpForMinlp():
00017     LocalSolverBasedHeuristic(){
00018   }
00020   PumpForMinlp::PumpForMinlp(BonminSetup * setup):
00021     LocalSolverBasedHeuristic(setup){
00022     setupDefaults(setup->options());
00023   }
00024 
00026   PumpForMinlp::PumpForMinlp
00027              (const PumpForMinlp &other):
00028     LocalSolverBasedHeuristic(other){
00029   }
00030 
00031   PumpForMinlp::~PumpForMinlp(){
00032   }
00033 
00035   int
00036   PumpForMinlp::solution(double & objectiveValue,
00037                                  double * newSolution){
00038     if(model_->getNodeCount() || model_->getCurrentPassNumber() > 1) return 0;
00039     if(model_->getSolutionCount()) return 0;
00040     //int numberObjects = model_->numberObjects();
00041     //OsiObject ** objects = model_->objects();
00042     OsiTMINLPInterface * nlp = dynamic_cast<OsiTMINLPInterface *>
00043                                (setup_->nonlinearSolver()->clone());
00044 
00045     OsiBranchingInformation info = model_->usefulInformation();
00046 
00047     double cutoff = info.cutoff_; 
00048     int r_val = doLocalSearch(nlp, newSolution, objectiveValue, cutoff, "pump_for_minlp.");
00049     return r_val;
00050   }
00051 
00052    void
00053    PumpForMinlp::setupDefaults(Ipopt::SmartPtr<Bonmin::OptionsList> options){
00054      //int dummy;
00055      std::string prefix = "pump_for_minlp.";
00056      changeIfNotSet(options, prefix, "algorithm", "B-iFP");
00057      changeIfNotSet(options, prefix, "time_limit", 30.);
00058    }
00059 
00060 
00061   void
00062   PumpForMinlp::registerOptions(Ipopt::SmartPtr<Bonmin::RegisteredOptions> roptions){
00063    roptions->SetRegisteringCategory("MINLP Heuristics", RegisteredOptions::BonminCategory);
00064    roptions->AddStringOption2(
00065      "pump_for_minlp",
00066      "if yes runs FP for MINLP",
00067      "no",
00068      "no", "don't run it",
00069      "yes", "runs the heuristic",
00070      "");
00071     roptions->setOptionExtraInfo("pump_for_minlp", 63);
00072   }
00073 
00075    void 
00076    PumpForMinlp::Initialize(Ipopt::SmartPtr<Bonmin::OptionsList> options){
00077    }
00078 }/* ends bonmin namespace*/
00079 

Generated on Tue Mar 30 03:04:35 2010 by  doxygen 1.4.7