RobotSetup.hpp
Go to the documentation of this file.
1 // (C) Copyright CNRS and others 2010
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // Pierre Bonami, Université de la Méditérannée
7 // Hassan Hijazi, Orange Labs
8 //
9 // Date : 05/22/2010
10 
11 #ifndef RobotSetup_H
12 #define RobotSetup_H
13 #include "BonBonminSetup.hpp"
14 #include "BonAmplSetup.hpp"
15 namespace Bonmin
16 {
18  class RobotSetup : public BonminSetup
19  {
20  public:
22  RobotSetup(const CoinMessageHandler * handler = NULL);
24  RobotSetup(const RobotSetup & other);
25 
27  RobotSetup(const RobotSetup &setup,
28  OsiTMINLPInterface &nlp);
29 
31  RobotSetup(const RobotSetup &setup,
32  OsiTMINLPInterface &nlp,
33  const std::string & prefix);
35  virtual BonminSetup * clone() const
36  {
37  return new RobotSetup(*this);
38  }
40  // virtual BonminSetup *clone(OsiTMINLPInterface&nlp)const{
41  // return new RobotSetup(*this, nlp);
42  // }
45  return new RobotSetup(*this, nlp);
46  }
48  RobotSetup *clone(OsiTMINLPInterface &nlp, const std::string & prefix)const{
49  return new RobotSetup(*this, nlp, prefix);
50  }
51  virtual ~RobotSetup()
52  {}
56  virtual void registerOptions();
61  void initialize(Ipopt::SmartPtr<TMINLP> tminlp, bool createContinuousSolver = true);
63  void initialize(const OsiTMINLPInterface& nlpSi, bool createContinuousSolver = true);
64 
66 void initialize(char **& argv)
67  {
69  /* Read the model.*/
71  argv, NULL, "bonmin", NULL);
72  mayPrintDoc();
73  initialize(Ipopt::GetRawPtr(model), true);
74  }
75 
76 
77 
78  protected:
80  void addNWays();
82  void initializeRobot();
83  };
84 }
86 #endif
87 
virtual void registerOptions()
Register all the options for this algorithm instance.
Definition: RobotSetup.cpp:64
void initializeRobot()
Initialize a branch-and-with robot nway.
Definition: RobotSetup.cpp:85
algorithm setup.
Definition: RobotSetup.hpp:18
Ipopt::SmartPtr< Ipopt::Journalist > journalist()
Acces storage of Journalist for output.
Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions()
Access registered Options.
This is class provides an Osi interface for a Mixed Integer Linear Program expressed as a TMINLP (so ...
RobotSetup * clone(OsiTMINLPInterface &nlp) const
Make a copy with solver replace by one passed .
Definition: RobotSetup.hpp:44
virtual BonminSetup * clone() const
virtual copy constructor.
Definition: RobotSetup.hpp:35
void initialize(char **&argv)
Ampl initialization.
Definition: RobotSetup.hpp:66
RobotSetup(const CoinMessageHandler *handler=NULL)
Default constructor.
Definition: RobotSetup.cpp:23
static void registerAllOptions(Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions)
Register all bonmin type executable options.
Definition: RobotSetup.cpp:43
OSSmartPtr< const U > ConstPtr(const OSSmartPtr< U > &smart_ptr)
Definition: OSSmartPtr.hpp:458
U * GetRawPtr(const OSSmartPtr< U > &smart_ptr)
Definition: OSSmartPtr.hpp:452
void addNWays()
Add nway objects.
Definition: RobotSetup.cpp:105
Ampl MINLP Interface.
virtual ~RobotSetup()
Definition: RobotSetup.hpp:51
void initialize(Ipopt::SmartPtr< TMINLP > tminlp, bool createContinuousSolver=true)
Initialize, read options and create appropriate bonmin setup.
Definition: RobotSetup.cpp:71
Ipopt::SmartPtr< Ipopt::OptionsList > options()
Acces list of Options.
RobotSetup * clone(OsiTMINLPInterface &nlp, const std::string &prefix) const
Make a copy but take options with different prefix.
Definition: RobotSetup.hpp:48
void mayPrintDoc()
May print documentation of options if options print_options_documentation is set to yes...
virtual void readOptionsFile()
Get the options from default text file (bonmin.opt) if don&#39;t already have them.
const char * prefix() const
Get prefix to use for options.