Changeset 5726


Ignore:
Timestamp:
11/04/08 10:18:44 (5 years ago)
Author:
jdsiiro
Message:

Updates to Coliny to get things closer to building under the new COLIN
framework.

Files:
25 edited

Legend:

Unmodified
Added
Removed
  • colin/trunk/colin/ColinOptSolver.h

    r5713 r5726  
    509509   int debug; 
    510510 
    511    bool verbosity(int threshhold) 
     511   bool verbosity(int threshhold) const 
    512512   {  
    513513      return threshhold <= this->debug;  
     
    839839void ColinOptSolver<DomainT, ProblemT>::write(std::ostream& os) const 
    840840{ 
    841    OptSolver<ProblemT>::write(os); 
     841   //OptSolver<ProblemT>::write(os); 
    842842   ObjectiveInfo<GetOptProblemTrait(ProblemT, multiple_objectives)>::write(os); 
    843843 
  • coliny/trunk/coliny/Direct.h

    r5272 r5726  
    2121 
    2222#include <acro_config.h> 
     23 
     24#include <coliny/DirectMisc.h> 
     25 
    2326#include <colin/colin.h> 
    24 #include <coliny/DirectMisc.h> 
     27#include <colin/ColinOptSolver.h> 
    2528 
    2629namespace coliny { 
     
    3841 *  number of function evaluations can be performed (less than 1000). 
    3942 */ 
    40 class DIRECT : public colin::StdOptSolver<std::vector<double>,colin::UNLP0_problem> 
     43class DIRECT  
     44   : public colin::ColinOptSolver<std::vector<double>, colin::UNLP0_problem> 
    4145{ 
    4246public: 
     
    4650 
    4751  /// 
    48   void minimize(); 
    49  
    50   /// 
    51   void reset(); 
     52  void optimize(); 
    5253 
    5354  /// 
     
    5556 
    5657protected: 
     58   /// 
     59   std::string define_solver_type() const 
     60   { return "DIRECT"; } 
    5761 
    5862  /// String for the user-defined specification for division 
     
    212216  utilib::BasicArray<colin::real> constr_buffer; 
    213217#endif 
     218 
     219private: 
     220 
     221  /// 
     222  void reset_DIRECT(); 
     223 
    214224}; 
    215225 
  • coliny/trunk/coliny/DirectMisc.h

    r4868 r5726  
    2727#endif 
    2828#include <utilib/stl_auxillary.h> 
     29#include <colin/colin.h> 
    2930#include <colin/real.h> 
    3031 
     
    171172        { 
    172173        std::vector<real> cvals; 
    173         response->get(colin::cf_info,cvals); 
     174        response.get(colin::cf_info,cvals); 
    174175        return cvals[i]; 
    175176        } 
  • coliny/trunk/coliny/DockingPS.h

    r4764 r5726  
    5050 
    5151  /// 
    52   void reset(); 
    53  
    54   /// 
    5552  void set_initial_point(const utilib::AnyRef& point); 
    5653 
    5754protected: 
     55   std::string define_solver_type() const 
     56   { return "DockingPS"; } 
    5857 
    5958  /// 
     
    9594  /// The initial angle (in degrees 
    9695  double initial_angle; 
     96 
     97private: 
     98  /// 
     99  void reset_DockingPS(); 
     100 
    97101}; 
    98102 
  • coliny/trunk/coliny/DomainOpsIntArray.h

    r4830 r5726  
    5353        DomainOpsArray<int,InfoT>::initialize( problem->num_int_vars(),  
    5454                                                popsize_, xover_rate, m_rate); 
    55         if ((problem->num_int_vars() > 0) && (problem->enforcing_bounds())) { 
     55        if ((problem->num_int_vars() > 0) && (problem->enforcing_domain_bounds())) { 
    5656           problem->get_int_bounds(lower,upper); 
    5757           lbound_type.resize(lower.size()); 
  • coliny/trunk/coliny/DomainOpsRealArray.h

    r5274 r5726  
    8181        DomainOpsArray<double,InfoT>::initialize( problem->num_real_vars(), 
    8282                                                        popsize_, xover_rate, m_rate); 
    83         if ((problem->num_real_vars() > 0) && (problem->enforcing_bounds())) { 
     83        if ((problem->num_real_vars() > 0) && (problem->enforcing_domain_bounds())) { 
    8484           problem->get_real_bounds(lower,upper); 
    8585           range.resize(this->nvars); 
  • coliny/trunk/coliny/DynamicGSS.h

    r5272 r5726  
    2020#include <utilib/default_rng.h> 
    2121#include <utilib/Normal.h> 
    22 #include <colin/StdOptSolver.h> 
     22#include <colin/ColinOptSolver.h> 
    2323 
    2424namespace coliny { 
     
    3333decomposes the search into subproblems. 
    3434*/ 
    35 class DynamicGSS : 
    36         public colin::StdOptSolver<BasicArray<double>, colin::NLP0_problem> 
     35class DynamicGSS  
     36   : public colin::ColinOptSolver<BasicArray<double>, colin::NLP0_problem> 
    3737{ 
    3838public: 
     
    4242 
    4343  /// 
    44   void reset(); 
    45  
    46   /// 
    47   void minimize(); 
     44  void optimize(); 
    4845 
    4946  /// 
     
    6158        } 
    6259 
     60private: 
     61  /// 
     62  void reset_DynamicGSS(); 
     63 
    6364}; 
    6465 
  • coliny/trunk/coliny/EAbase.h

    r5295 r5726  
    754754if (synchronous) { 
    755755   // Perform the evaluation synchronously 
    756    pt.response = this->problem->get_response(request); 
     756   pt.response = this->problem->eval_mngr().perform_evaluation(request); 
    757757   // Update EAindividual information 
    758758   pt.update_from_response(); 
  • coliny/trunk/coliny/EAgeneric.h

    r5274 r5726  
    6868  void reset() 
    6969        { 
    70         if (! (this->problem)) return; 
     70        if ( this->problem.empty() ) return; 
    7171        if (search_ops->check_domain(this->problem,this->best().termination_info)) 
    7272           return; 
  • coliny/trunk/coliny/EAindividual.h

    r5449 r5726  
    8888  void update_from_response() 
    8989        { 
    90         Sel_Val = response->value<colin::real>(colin::f_info); 
    91         Val     = response->value<colin::real>(colin::f_info); 
     90        Sel_Val = response.value<colin::real>(colin::f_info); 
     91        Val     = response.value<colin::real>(colin::f_info); 
    9292        Cval    = colin::real::positive_infinity; 
    9393        reset(); 
  • coliny/trunk/coliny/Factory.h

    r4992 r5726  
    1717#define coliny_Factory_h 
    1818 
    19 #include <colin/Factory.h> 
    20 #include <colin/OptSolver.h> 
    21 #include <colin/OptSolverHandle.h> 
     19//#include <colin/Factory.h> 
     20//#include <colin/OptSolver.h> 
     21//#include <colin/OptSolverHandle.h> 
    2222 
    2323/// 
     
    2525/// the COLIN factory. 
    2626/// 
    27 FACTORY_REFERENCE(direct) 
    28 FACTORY_REFERENCE(DockingPS) 
    29 FACTORY_REFERENCE(ps) 
    30 FACTORY_REFERENCE(plipshitzian) 
    31 FACTORY_REFERENCE(sw) 
    32 FACTORY_REFERENCE(ms) 
    33 FACTORY_REFERENCE(msps) 
     27namespace coliny { 
     28namespace StaticInitializers { 
     29 
     30extern const volatile bool coliny_solvers; 
     31 
     32} // namespace coliny::StaticInitializers 
     33} // namespace coliny 
     34 
     35//FACTORY_REFERENCE(direct) 
     36//FACTORY_REFERENCE(DockingPS) 
     37//FACTORY_REFERENCE(ps) 
     38//FACTORY_REFERENCE(sw) 
     39//FACTORY_REFERENCE(ms) 
     40//FACTORY_REFERENCE(msps) 
    3441 
    3542#ifdef ACRO_USING_PLGO 
    36 FACTORY_REFERENCE(plgo) 
     43//FACTORY_REFERENCE(plipshitzian) 
     44//FACTORY_REFERENCE(plgo) 
    3745#endif 
    3846 
  • coliny/trunk/coliny/MultiStart.h

    r5274 r5726  
    199199void MultiStartBase<DomainT, ProblemT, GeneratorT>::reset() 
    200200{ 
    201    if (!problem) return; 
     201   if ( problem.empty() ) return; 
    202202 
    203203   if ((ls_frequency < 0.0) || (ls_frequency > 1.0)) 
     
    336336   void reset() 
    337337   { 
    338       if (! this->get_problem()) return; 
     338      if ( this->get_problem().empty() ) return; 
    339339      this->get_problem()->get_real_bounds(this->generator.d_l_bound, this->generator.d_u_bound); 
    340340      this->get_problem()->get_int_bounds(this->generator.i_l_bound, this->generator.i_u_bound); 
  • coliny/trunk/coliny/MultiStatePS.h

    r5340 r5726  
    2020//#include <utilib/default_rng.h> 
    2121//#include <utilib/Normal.h> 
    22 #include <colin/ConcreteOptSolver.h> 
     22#include <colin/ColinOptSolver.h> 
    2323//#include <colin/AsyncEvaluator.h> 
    2424//#include <colin/ResponseSet.h> 
     
    124124 */ 
    125125class MultiStatePS  
    126    : public colin::ConcreteOptSolver<std::vector<double>, colin::UNLP0_problem> 
     126   : public colin::ColinOptSolver<std::vector<double>, colin::UNLP0_problem> 
    127127{ 
    128128public: // typedefs & sub-classes 
     
    133133   typedef colin::QueueManager::queueID_t       pseudoQueue_t; 
    134134   typedef colin::QueueManager::evalPriority_t  evalPriority_t; 
    135    typedef colin::ConcreteOptSolver<domain_t, colin::UNLP0_problem> 
     135   typedef colin::ColinOptSolver<domain_t, colin::UNLP0_problem> 
    136136      ConcreteOptSolver_t; 
    137137 
     
    168168 
    169169   /// 
    170    virtual void reset(); 
    171  
    172    /// 
    173    virtual void minimize(); 
     170   virtual void optimize(); 
    174171 
    175172   /// 
     
    225222                                const std::map<pseudoQueue_t, double> &alloc ); 
    226223 
     224   bool verbosity(int level) const 
     225   { return ConcreteOptSolver_t::verbosity(level); } 
     226 
     227protected: 
     228   std::string define_solver_type() const 
     229   { return "MultiState"; } 
    227230 
    228231private:  // data types 
     
    237240   void set_eval_mngr_allocations(); 
    238241 
     242   /// 
     243   virtual void reset_MultiStatePS(); 
    239244 
    240245private:  // member data 
  • coliny/trunk/coliny/PIDOMS.h

    r5367 r5726  
    2626#include <colin/StdOptSolver.h> 
    2727#include <colin/colin.h> 
    28 #include <colin/RelaxedApplication_MixedIntDomain.h> 
     28#include <colin/RelaxableMixedIntDomainApplication.h> 
    2929#include <pebbl/parBranching.h> 
    3030 
     
    5555  void set_problem(colin::OptProblem<ProblemT>& prob) 
    5656    { 
    57     problem &= prob; 
    58     colin::RelaxedApplication_MixedIntDomain<ProblemT>* app = dynamic_cast<colin::RelaxedApplication_MixedIntDomain<ProblemT>*>(prob.application()); 
     57    problem = prob; 
     58    colin::RelaxableMixedIntDomainApplication<ProblemT>* app 
     59       = dynamic_cast<colin::RelaxableMixedIntDomainApplication<ProblemT>*> 
     60       (prob.application()); 
    5961    if (!app) { 
    6062       EXCEPTION_MNGR(std::runtime_error, "Problem with dynamic cast."); 
    6163    } 
    62     colin::ContextMngr().lexical_cast(app->any_prob, relaxed_problem); 
     64    colin::ContextMngr().lexical_cast(app->relaxed_problem(), relaxed_problem); 
    6365    intvars = problem->num_int_vars() + problem->num_binary_vars(); 
    6466    } 
     
    867869void PIDOMS<ProblemT>::reset() 
    868870{ 
    869 if (!this->problem) 
     871if ( this->problem.empty() ) 
    870872   return; 
    871873//if (problem->numConstraints() > 0) 
  • coliny/trunk/coliny/PatternSearch.h

    r5340 r5726  
    2727#include <utilib/BitArray.h> 
    2828#include <utilib/DoubleVector.h> 
    29 #include <colin/colin.h> 
     29//#include <colin/colin.h> 
    3030#include <colin/ConstraintPenaltyApplication.h> 
     31#include <colin/ColinOptSolver.h> 
    3132 
    3233namespace coliny { 
     
    6869*/ 
    6970class PatternSearch 
    70   : public colin::StdOptSolver< utilib::BasicArray<double> , colin::UNLP0_problem > 
     71  : public colin::ColinOptSolver< utilib::BasicArray<double>,  
     72                                  colin::UNLP0_problem > 
    7173{  
    7274  typedef colin::AppResponse response_t; 
    7375  typedef utilib::BasicArray<double> domain_t; 
    7476 
     77  /// 
     78  void reset_PatternSearch(); 
     79 
    7580public: 
    7681 
     
    8792 
    8893  /// 
    89   void reset(); 
    90  
    91   /// 
    92   void minimize(); 
     94  void optimize(); 
    9395 
    9496  /// 
     
    103105 
    104106protected: 
     107   std::string define_solver_type() const 
     108   { return "PatternSearch"; } 
    105109 
    106110  /// 
     
    363367 
    364368  /// 
    365   colin::ConstraintPenaltyApplication<colin::NLP0_problem>* simple_app; 
     369  colin::ConstraintPenaltyApplication<colin::UNLP0_problem>* simple_app; 
    366370 
    367371  /// 
  • coliny/trunk/coliny/SolisWets.h

    r5272 r5726  
    2222#include <utilib/NumArray.h> 
    2323#include <utilib/Uniform.h> 
    24 #include <colin/StdOptSolver.h> 
     24#include <colin/ColinOptSolver.h> 
    2525 
    2626namespace coliny { 
     
    3535uniform deviations. 
    3636*/ 
    37 class SolisWets : 
    38         public colin::StdOptSolver<BasicArray<double>, colin::UNLP0_problem> 
     37class SolisWets  
     38   : public colin::ColinOptSolver<BasicArray<double>, colin::UNLP0_problem> 
    3939{ 
    4040public: 
     
    4444 
    4545  /// 
    46   void reset(); 
    47  
    48   /// 
    49   void minimize(); 
     46  void optimize(); 
    5047 
    5148  /// 
    5249  void write(std::ostream& os) const; 
    5350 
     51private: 
     52  /// 
     53  void reset_SolisWets(); 
     54 
    5455protected: 
     56   /// 
     57   std::string define_solver_type() const 
     58   { return "SolisWets"; } 
    5559 
    5660  /// 
  • coliny/trunk/src/exec/simple.cpp

    r4764 r5726  
    1212 
    1313#define USING_PROBE 
     14 
     15#include <coliny/Factory.h> 
     16 
     17#include <colin/OptApplications.h> 
     18//#include <colin/OptSolverHandle.h> 
     19#include <colin/OptSolverUtil.h> 
     20#include <colin/SolverMngr.h> 
     21#include <colin/SolverHandle.h> 
     22 
    1423#include <sys/types.h> 
    15 #include <colin/OptApplications.h> 
    16 #include <colin/OptSolverHandle.h> 
    17 #include <colin/OptSolverUtil.h> 
    18 #include <coliny/Factory.h> 
    1924 
    2025using namespace std; 
     
    8489// void test_function(vector<double>& x, double& answer); 
    8590// 
     91colin::ConfigurableApplication<colin::NLP0_problem> *app 
     92   = colin::new_application("docking_app",&test_function); 
     93app->set_num_real_vars(3); 
     94app->set_bounds("[1.0,10.0]^3"); 
     95 
    8696colin::OptProblem<colin::NLP0_problem> problem; 
    87 problem.set_application( colin::new_application("docking_app",&test_function) ); 
    88 problem->config_real_domain(3); 
    89 problem->set_bounds("[1.0,10.0]^3"); 
     97problem.set_application( app ); 
    9098vector<double> initpt(3); 
    9199initpt << 9.0; 
     
    95103// Other names for solvers: direct, ms, ms.ps, ms.sw, sw, eareal, apps 
    96104// 
    97 colin::OptSolverHandle* solver = colin::OptSolverFactory(solver_str.c_str()); 
     105colin::SolverHandle solver = colin::SolverMngr().create_solver(solver_str.c_str()); 
    98106//coliny::ColinySolver<colin::OptProblem<vector<double> >,vector<double> > solver; 
    99107//solver.initialize(solver_str.c_str()); 
    100108 
    101109if (solver_str == "help") { 
    102    colin::print_factory_solvers(cerr); 
     110   colin::SolverMngr().list_solver_types(cerr); 
    103111   exit(1); 
    104112   } 
    105113 
    106114if (filename == "help") { 
    107    solver->solver()->help_parameters(cout); 
     115   solver.solver()->help_parameters(cout); 
    108116   exit(1); 
    109117   } 
     
    112120ifstr.open(filename.c_str()); 
    113121if (ifstr) 
    114    solver->solver()->read_parameter_values(ifstr); 
     122   solver.solver()->read_parameter_values(ifstr); 
    115123 
    116124// 
     
    119127vector<double> best_point; 
    120128colin::real best_value; 
    121 solver->minimize(initpt, seed, true, true); 
     129 
     130solver.solver()->set_initial_point(initpt); 
     131#if defined(ACRO_HAVE_MPI) 
     132solve(solver, seed, true, true, utilib::uMPI::comm); 
     133#else 
     134int dummy = 0; 
     135solve(solver, seed, true, true, dummy); 
     136#endif 
    122137 
    123138//colin::solve(*(solver->solver()), problem, initpt, seed, true, true, best_point, best_value); 
  • coliny/trunk/src/lib/Direct.cpp

    r5274 r5726  
    2727 
    2828#include <acro_config.h> 
     29 
     30#include <coliny/Direct.h> 
     31 
     32//#include <colin/ConcreteOptSolverHandle.h> 
     33#include <colin/SolverMngr.h> 
     34 
    2935#include <utilib/_math.h> 
     36#include <utilib/sort.h> 
    3037#include <utilib/stl_auxillary.h> 
    31 #include <colin/ConcreteOptSolverHandle.h> 
    32 #include <coliny/Direct.h> 
    3338 
    3439const double pi = 3.14159265358979323846; 
     
    6772 : dimen(0) 
    6873{ 
    69 solver_type="DIRECT"; 
    7074division = 2; 
    7175constraint_method = 2; 
    72 DIRECT_BP = false; 
    73 agressive = false; 
    74 min_boxsize = 0.0001; 
    7576minsize2 = 0.01; 
    76 min_improvement = 1e-8; 
    77 ratio = 20; //*sqrt(10); 
    78 Gamma = .01; 
    7977nsort = 0; 
    8078directbp_converge=false; 
    81 division_str = "single"; 
    82 method_str = "penalty"; 
    83 max_boxsize_ratio = 0.0; 
    8479 
    8580//mindist = 0.05; 
     
    8883MPIVersion = false; 
    8984 
    90 disable_parameter("ftol"); 
    91  
    92 create_categorized_parameter("bp_flag", DIRECT_BP, 
    93         "<bool>","false", 
    94         "When true, optimization calls the DIRECT-BP subroutines to perform a\n\tneighborhood search about the best point found at each iteration", 
    95         "DIRECT-BP"); 
    96  
    97 create_categorized_parameter("gamma", Gamma, 
    98         "<double>","0.01", 
    99         "Enforces a lower limit on the distance to neighboring boxes in\n\tDIRECT-BP", 
    100         "DIRECT-BP"); 
    101  
    102 create_parameter("aggressive", agressive, 
    103         "<bool>","false", 
    104         "If false, then eliminate potentially optimal boxes based on the\n\tstandard DIRECT Graham sort routine."); 
    105  
    106 create_parameter("division", division_str, 
    107         "<string>","single", 
    108         "Controls how many dimensions of a box are subdivided:\n\t  single - boxes are divided on one long side\n\t  multi  - boxes are divided on all long sides"); 
    109  
    110 create_parameter("min_improvement", min_improvement, 
    111         "<double>","1e-8", 
    112         "Minimum potential function value improvement for a box on the convex\n\thull to be considered potentially optimal.  Indirectly sets a minimum\n\tvalue of the Lipschitz constant at any iteration based with the size of\n\the box containing the best point found."); 
    113 ParameterSet::alias_parameter("min_improvement","local_search_balance"); 
    114  
    115 create_parameter("constraints", method_str, 
    116         "<string>","explicit", 
    117         "Method used to manage constraints:\n\t  explicit - use Jone's constrained DIRECT technique\n\t  penalty  - use a simple penalty function technique"); 
     85   utilib::OptionParser &opt = this->option; 
     86 
     87   opt.disable("ftol"); 
     88 
     89    
     90   DIRECT_BP = false; 
     91   opt.add("bp_flag", DIRECT_BP, 
     92           "When true, optimization calls the DIRECT-BP subroutines to " 
     93           "perform a\n\tneighborhood search about the best point found " 
     94           "at each iteration"); 
     95 
     96   Gamma = .01; 
     97   opt.add("gamma", Gamma, 
     98           "Enforces a lower limit on the distance to neighboring boxes in\n" 
     99           "\tDIRECT-BP"); 
     100 
     101   agressive = false; 
     102   opt.add("aggressive", agressive, 
     103           "If false, then eliminate potentially optimal boxes based on the\n" 
     104           "\tstandard DIRECT Graham sort routine."); 
     105 
     106   division_str = "single"; 
     107   opt.add("division", division_str, 
     108           "Controls how many dimensions of a box are subdivided:\n" 
     109           "\t  single - boxes are divided on one long side\n" 
     110           "\t  multi  - boxes are divided on all long sides"); 
     111 
     112   min_improvement = 1e-8; 
     113   opt.add("min_improvement", min_improvement, 
     114           "Minimum potential function value improvement for a box on " 
     115           "the convex\n\thull to be considered potentially optimal.  " 
     116           "Indirectly sets a minimum\n\tvalue of the Lipschitz constant " 
     117           "at any iteration based with the size of\n\the box containing " 
     118           "the best point found."); 
     119   opt.alias_parameter("min_improvement","local_search_balance"); 
     120 
     121   method_str = "penalty"; 
     122   opt.add("constraints", method_str, 
     123           "Method used to manage constraints:\n" 
     124           "\t  explicit - use Jone's constrained DIRECT technique\n" 
     125           "\t  penalty  - use a simple penalty function technique"); 
    118126 
    119127#if 0 
     
    124132#endif 
    125133 
    126 create_categorized_parameter("min_boxsize_limit", min_boxsize, 
    127         "<double>","0.0001", 
    128         "Smallest size box divided by DIRECT.  DIRECT stops when smallest \n\tbox is smaller than this size", 
    129         "Termination"); 
    130  
    131 create_categorized_parameter("max_boxsize_limit", maxsize, 
    132         "<double>","0.0", 
    133         "DIRECT stops when the largest box is smaller than this size", 
    134         "Termination"); 
    135  
    136 create_parameter("max_boxsize_ratio", max_boxsize_ratio, 
    137         "<double>","0.0", 
    138         "Boxes whose size divided by the max box size is less than this ratio\n\t are not divided"); 
    139 ParameterSet::alias_parameter("max_boxsize_ratio","global_search_balance"); 
    140  
    141 create_categorized_parameter("ratio", ratio, 
    142         "<double>","20", 
    143         "Maximum ratio of the length of the longest vector needed to form a\n\tpossitive spanning set, to the length of the shortest side of the best\n\tbox in DIRECT-BP where the neighborhood is still considered balanced\n\tand the best box will still be divided", 
    144         "DIRECT-BP"); 
     134   min_boxsize = 0.0001; 
     135   opt.add("min_boxsize_limit", min_boxsize, 
     136           "Smallest size box divided by DIRECT.  DIRECT stops when smallest\n" 
     137           "\tbox is smaller than this size"); 
     138 
     139   maxsize = 0.0; 
     140   opt.add("max_boxsize_limit", maxsize, 
     141           "DIRECT stops when the largest box is smaller than this size"); 
     142 
     143   max_boxsize_ratio = 0.0; 
     144   opt.add("max_boxsize_ratio", max_boxsize_ratio, 
     145           "Boxes whose size divided by the max box size is less than this " 
     146           "ratio\n\t are not divided"); 
     147   opt.alias_parameter("max_boxsize_ratio","global_search_balance"); 
     148 
     149   ratio = 20; //*sqrt(10); 
     150   opt.add("ratio", ratio, 
     151           "Maximum ratio of the length of the longest vector needed to form " 
     152           "a\n\tpossitive spanning set, to the length of the shortest side " 
     153           "of the best\n\tbox in DIRECT-BP where the neighborhood is still " 
     154           "considered balanced\n\tand the best box will still be divided"); 
     155 
     156   reset_signal.connect(boost::bind(&DIRECT::reset_DIRECT, this)); 
    145157} 
    146158 
    147159 
    148160 
    149 void DIRECT::reset() 
     161void DIRECT::reset_DIRECT() 
    150162{ 
    151 if (!problem) return; 
    152  
    153 colin::StdOptSolver<vector<double>,colin::UNLP0_problem>::reset(); 
     163if ( problem.empty() ) return; 
    154164 
    155165dimen = problem->num_real_vars(); 
     
    196206minsize3 = sqrt((double)dimen)/ratio/3.0; 
    197207         
    198 if (problem->enforcing_bounds()) { 
     208if (problem->enforcing_domain_bounds()) { 
    199209   problem->get_real_bounds(x_lower,x_upper);            
    200210   range.resize(dimen); 
     
    217227bool DIRECT::check_convergence() 
    218228{ 
    219 if (colin::StdOptSolver<vector<double>,colin::UNLP0_problem>::check_convergence()) 
     229if ( colin::ColinOptSolver<vector<double>, colin::UNLP0_problem> 
     230     ::check_convergence() ) 
    220231   return true; 
    221232 
     
    254265/* Main Program                                                    */  
    255266/*******************************************************************/  
    256 void DIRECT::minimize()  
     267void DIRECT::optimize()  
    257268{ 
    258269// 
    259270// Misc initialization of the optimizer 
    260271// 
    261 opt_init(); 
     272//opt_init(); 
    262273if (initial_point.size() == 0) { 
    263274   opt_response.termination_info = "No-Real-Params"; 
     
    18711882 
    18721883 
     1884namespace StaticInitializers { 
     1885 
     1886namespace { 
     1887 
     1888bool RegisterDirect() 
     1889{ 
     1890   colin::SolverMngr().declare_solver_type<DIRECT> 
     1891      ("coliny:DIRECT", "The DIRECT global optimizer"); 
     1892 
     1893   colin::SolverMngr().declare_solver_type<DIRECT> 
     1894      ("coliny:direct", "An alias to coliny:DIRECT"); 
     1895 
     1896   return true; 
     1897} 
     1898 
     1899} // namespace coliny::StaticInitializers::(local) 
     1900 
     1901extern const volatile bool direct = RegisterDirect(); 
     1902 
     1903} // namespace coliny::StaticInitializers 
     1904 
    18731905} // namespace coliny 
    18741906 
     1907/* 
    18751908FACTORY_NAMED_REGISTER(direct, "coliny:direct", colin::OptSolverHandle*, 
    18761909                return new colin::ConcreteOptSolverHandle<coliny::DIRECT>;, 
     
    18791912                return new colin::ConcreteOptSolverHandle<coliny::DIRECT>;, 
    18801913                "The DIRECT global optimizer") 
    1881  
     1914*/ 
     1915 
     1916 
  • coliny/trunk/src/lib/DockingPS.cpp

    r5274 r5726  
    1212 
    1313#include <acro_config.h> 
    14 #include <colin/ConcreteOptSolverHandle.h> 
     14 
    1515#include <coliny/DockingPS.h> 
     16 
     17//#include <colin/ConcreteOptSolverHandle.h> 
     18#include <colin/SolverMngr.h> 
    1619 
    1720#define M_TWO_PI   (2.0*M_PI) 
     
    4649DockingPS::DockingPS() 
    4750{ 
    48 solver_type = "DockingPS"; 
    4951num_rotations=4; 
    5052last_x=last_y=last_theta=0.0; 
    51 ParameterSet::disable_parameter("expansion_factor"); 
     53option.disable("expansion_factor"); 
    5254initial_angle=80.0; 
    53 } 
    54  
    55  
    56  
    57 void DockingPS::reset() 
    58 { 
    59 if (!problem) return; 
     55 
     56reset_signal.connect(boost::bind(&DockingPS::reset_DockingPS, this)); 
     57} 
     58 
     59 
     60 
     61void DockingPS::reset_DockingPS() 
     62{ 
     63if ( problem.empty() ) return; 
    6064 
    6165if (Delta_init > 1.0) 
     
    6367 
    6468basis_str = "coordinate"; 
    65 PatternSearch::reset(); 
    6669 
    6770ntrials = ncore_trials = 2*problem->num_real_vars() - 4 + num_rotations; 
     
    489492 
    490493 
     494namespace StaticInitializers { 
     495 
     496namespace { 
     497 
     498bool RegisterDockingPS() 
     499{ 
     500   colin::SolverMngr().declare_solver_type<DockingPS> 
     501      ("coliny:DockingPS",  
     502       "A derivative free pattern search for flexible docking"); 
     503 
     504   colin::SolverMngr().declare_solver_type<DockingPS> 
     505      ("coliny:dockingps", "An alias to coliny:DockingPS"); 
     506 
     507   return true; 
     508} 
     509 
     510} // namespace coliny::StaticInitializers::(local) 
     511 
     512extern const volatile bool docking_ps = RegisterDockingPS(); 
     513 
     514} // namespace coliny::StaticInitializers 
     515 
    491516} // namespace coliny 
    492  
     517/* 
    493518FACTORY_NAMED_REGISTER(DockingPS, "coliny:DockingPS", colin::OptSolverHandle*, 
    494519                return new colin::ConcreteOptSolverHandle<coliny::DockingPS>;, 
     
    497522                return new colin::ConcreteOptSolverHandle<coliny::DockingPS>;, 
    498523                "An alias to DockingPS") 
    499  
     524*/ 
  • coliny/trunk/src/lib/DynamicGSS.cpp

    r5274 r5726  
    2525DynamicGSS::DynamicGSS() 
    2626{ 
     27   reset_signal.connect(boost::bind(&DynamicGSS::reset_DynamicGSS, this)); 
    2728} 
    2829 
    2930 
    30 void DynamicGSS::reset() 
     31void DynamicGSS::reset_DynamicGSS() 
    3132{ 
    32 if (!problem) return; 
    33  
    34 colin::StdOptSolver<BasicArray<double>,colin::NLP0_problem>::reset(); 
     33if ( problem.empty() ) return; 
    3534 
    3635if (!rng) 
     
    4645 
    4746 
    48 void DynamicGSS::minimize() 
     47void DynamicGSS::optimize() 
    4948{ 
    5049// 
    5150// Misc initialization of the optimizer 
    5251// 
    53 opt_init(); 
     52//opt_init(); 
    5453if (!(this->initial_point_flag)) 
    5554   EXCEPTION_MNGR(runtime_error,"DynamicGSS::minimize - no initial point specified."); 
  • coliny/trunk/src/lib/MultiStatePS.cpp

    r5340 r5726  
    1515 
    1616#include <acro_config.h> 
     17 
     18#include <coliny/MultiStatePS.h> 
     19 
    1720//#include <utilib/_math.h> 
    1821//#include <utilib/stl_auxillary.h> 
    19 #include <colin/ConcreteOptSolverHandle.h> 
    20 #include <colin/EpsilonCache.h> 
    21 #include <coliny/MultiStatePS.h> 
     22//#include <colin/ConcreteOptSolverHandle.h> 
     23#include <colin/ResponseCacheFactory.h> 
     24#include <colin/SolverMngr.h> 
     25 
    2226 
    2327#include <cmath> 
     
    102106      ++(pattern_info->refCount); 
    103107 
    104       double fval = center_point->value<double>(f_info); 
     108      double fval = center_point.value<double>(f_info); 
    105109      fval *= msps->get_problem()->sense(); 
    106110      StateContainer state = this; 
     
    125129      std::list<request_t>  newRequest; 
    126130 
    127       double response_fval = response->value<double>(f_info) * sense; 
    128       double base_fval = center->value<double>(f_info) * sense; 
     131      double response_fval = response.value<double>(f_info) * sense; 
     132      double base_fval = center.value<double>(f_info) * sense; 
    129133 
    130134      if ( response_fval < base_fval ) 
     
    163167         if ( msps->best().value() * sense > response_fval ) 
    164168         { 
    165             msps->best().point = response->get_point(); 
     169            msps->best().point = response.get_domain(); 
    166170            msps->best().point.to_value_any(); 
    167171            msps->best() << response; 
     
    221225               DEBUGPRX(100, msps, cerr << "Minimum delta reached.  No " 
    222226                        "further contraction allowed for state " << id() 
    223                         << ", value = " << center->value<double>(f_info) 
     227                        << ", value = " << center.value<double>(f_info) 
    224228                        << endl); 
    225229            } 
     
    342346      ++(pattern_info->refCount); 
    343347 
    344       double fval = center_point->value<double>(f_info); 
     348      double fval = center_point.value<double>(f_info); 
    345349      fval *= pattern_info->msps->get_problem()->sense(); 
    346350      StateContainer state = this; 
     
    361365      double sense = pattern_info->msps->get_problem()->sense(); 
    362366      response_buf.insert(pair<double,MultiStatePS::response_t> 
    363                           ( (response->value<double>(f_info) * sense),  
     367                          ( (response.value<double>(f_info) * sense),  
    364368                            response)); 
    365369 
     
    383387      std::list<request_t>  newRequest; 
    384388 
    385       double base_fval = center->value<double>(f_info) * sense; 
     389      double base_fval = center.value<double>(f_info) * sense; 
    386390      double response_fval = response_buf.begin()->first; 
    387391 
     
    389393      if ( msps->best().value() * sense > response_fval ) 
    390394      { 
    391          msps->best().point = response_buf.begin()->second->get_point(); 
     395         msps->best().point = response_buf.begin()->second.get_domain(); 
    392396         msps->best().point.to_value_any(); 
    393397         msps->best() << response_buf.begin()->second; 
     
    433437            DEBUGPRX(100, msps, cerr << "Minimum delta reached.  No " 
    434438                     "further contraction allowed for state " << id() 
    435                      << ", value = " << center->value<double>(f_info) 
     439                     << ", value = " << center.value<double>(f_info) 
    436440                     << endl); 
    437441         } 
     
    568572MultiStatePS::MultiStatePS() 
    569573{  
    570    solver_type = "MultiState Pattern Search"; 
    571  
    572    ParameterSet::create_categorized_parameter 
    573       ("initial_step", config.delta_init, "<double>", "1.0", 
    574        "Initial step length", 
    575        "Step Length Control"); 
    576    ParameterSet::alias_parameter("initial_step","initial_stepsize"); 
    577    ParameterSet::alias_parameter("initial_step","initial_steplength"); 
     574   utilib::OptionParser& opt = this->option; 
     575 
     576   config.delta_init = 1.0; 
     577   opt.add("initial_step", config.delta_init, 
     578           "Initial step length"); 
     579   opt.alias_parameter("initial_step","initial_stepsize"); 
     580   opt.alias_parameter("initial_step","initial_steplength"); 
    578581   
    579    ParameterSet::create_categorized_parameter 
    580       ("step_tolerance", config.delta_thresh, "<double>", "1e-5", 
    581        "Convergence tolerance step length", 
    582        "Termination"); 
    583  
    584    ParameterSet::create_categorized_parameter 
    585       ("contraction_factor", config.contraction_factor, "<double>", "0.5", 
    586        "Contraction factor", 
    587        "Step Length Control"); 
    588  
    589    ParameterSet::create_categorized_parameter 
    590       ("max_success", config.max_success, "<int>", "5", 
    591        "Number of successful iterations before step length is expanded", 
    592        "Step Length Control"); 
    593  
    594    ParameterSet::create_categorized_parameter 
    595       ("step_scales", config.sigma, "<Array<double>>", "All 1.0", 
    596        "The scale factors for each dimension", 
    597        "Step Length Control"); 
    598  
    599    ParameterSet::create_categorized_parameter 
    600       ("alpha", config.sufficient_decrease_coef, "<double>", "0.01", 
    601        "Sufficient decrease parameter", 
    602        "Step Length Control"); 
    603  
    604    ParameterSet::create_categorized_parameter 
    605       ("expansion_factor", config.expansion_factor, "<double>", "2.0", 
    606        "Expansion factor", 
    607        "Step Length Control"); 
    608 } 
    609  
    610  
    611  
    612 void MultiStatePS::reset() 
    613 { 
    614    if (!problem)  
     582   config.delta_thresh = 1e-5; 
     583   opt.add("step_tolerance", config.delta_thresh, 
     584           "Convergence tolerance step length"); 
     585 
     586   config.contraction_factor = 0.5; 
     587   opt.add("contraction_factor", config.contraction_factor, 
     588           "Contraction factor"); 
     589 
     590   config.max_success = 5; 
     591   opt.add("max_success", config.max_success, 
     592           "Number of successful iterations before step length is expanded"); 
     593 
     594   config.sigma.resize(1); 
     595   config.sigma << 1.0; 
     596   opt.add("step_scales", config.sigma, 
     597           "The scale factors for each dimension"); 
     598 
     599   config.sufficient_decrease_coef = 0.01; 
     600   opt.add("alpha", config.sufficient_decrease_coef, 
     601           "Sufficient decrease parameter"); 
     602 
     603   config.expansion_factor = 2.0; 
     604   opt.add("expansion_factor", config.expansion_factor, 
     605           "Expansion factor"); 
     606 
     607   reset_signal.connect(boost::bind(&MultiStatePS::reset_MultiStatePS, this)); 
     608} 
     609 
     610 
     611 
     612void MultiStatePS::reset_MultiStatePS() 
     613{ 
     614   if ( problem.empty() )  
    615615      return;  
    616  
    617    ConcreteOptSolver_t::reset(); 
    618616 
    619617   unsigned int nvars = problem->num_real_vars(); 
     
    629627 
    630628 
    631 void MultiStatePS::minimize() 
     629void MultiStatePS::optimize() 
    632630{ 
    633631   if ( DEBUG_MULTISTATE_PS > 1 ) 
    634       cerr << "entering minimize(); " << endl;  
     632      cerr << "entering optimize(); " << endl;  
    635633 
    636634   // 
    637635   // Misc initialization of the optimizer 
    638636   // 
    639    opt_init(); 
    640    if ( DEBUG_MULTISTATE_PS > 1 ) 
    641       cerr << "minimize(): opt_init done" << endl;  
     637   //opt_init(); 
     638   //if ( DEBUG_MULTISTATE_PS > 1 ) 
     639   //   cerr << "optimize(): opt_init done" << endl;  
    642640 
    643641 
     
    645643   { 
    646644      EXCEPTION_MNGR(runtime_error, 
    647                      "MultiStatePS::minimize - no initial point specified."); 
     645                     "MultiStatePS::optimize - no initial point specified."); 
    648646   } 
    649647 
     
    651649   { 
    652650      EXCEPTION_MNGR 
    653          ( runtime_error, "MultiStatePS::minimize - problem has " << 
     651         ( runtime_error, "MultiStatePS::optimize - problem has " << 
    654652           problem->num_real_vars() << " real params, but initial point has " 
    655653           << initial_point.size() ); 
     
    693691      EXCEPTION_MNGR 
    694692         ( runtime_error, 
    695            "MultiStatePS::minimize - initial point is not bound-feasible" ); 
     693           "MultiStatePS::optimize - initial point is not bound-feasible" ); 
    696694   } 
    697695 
     
    699697   if ( DEBUG_MULTISTATE_PS > 1 ) 
    700698   { 
    701       cerr << "minimize(): evaluating initial point" << endl;  
     699      cerr << "optimize(): evaluating initial point" << endl;  
    702700      cerr << indent_chars << "initial point: " << initial_point << endl; 
    703701   } 
     
    705703   // NB: the point won't be in the cache, but this will make sure it is added 
    706704   response_t response = checkCache(initial_point); 
    707    if ( ! response->is_computed(f_info) ) 
     705   if ( ! response.is_computed(f_info) ) 
    708706   { 
    709707      if ( DEBUG_MULTISTATE_PS > 1 ) 
     
    713711      } 
    714712 
    715       colin::AppRequest req(response); 
     713      colin::AppRequest req = problem->set_domain(response.get_domain()); 
    716714      problem->Request_F(req); 
    717715      eval_mngr().perform_evaluation(req); 
     
    729727 
    730728   if ( DEBUG_MULTISTATE_PS > 1 ) 
    731       cerr << "minimize(): exploring initial point" << endl;  
     729      cerr << "optimize(): exploring initial point" << endl;  
    732730 
    733731   // initialize the patterns we will use. 
     
    742740 
    743741   if ( DEBUG_MULTISTATE_PS > 1 ) 
    744       cerr << "entering minimize()::loop; " << endl;  
    745    EvaluationID eval_id; 
    746    while ( ! (eval_id = eval_mngr().next_response(response)).empty() ) 
    747    { 
     742      cerr << "entering optimize()::loop; " << endl;  
     743   std::pair<EvaluationID, colin::AppResponse> eval; 
     744   while ( ! (eval = eval_mngr().next_response()).first.empty() ) 
     745   { 
     746       
    748747      // I don't really have a concept of an "iteration", but to make this 
    749748      // somewhat consistent with other Colin solvers, I will make every 
     
    753752      if ( DEBUG_MULTISTATE_PS ) 
    754753      {  
    755          cerr << "minimize(): best = " << best().value()  
     754         cerr << "optimize(): best = " << best().value()  
    756755              << ", total eval = " << neval() << endl; 
    757756      } 
    758757      if ( DEBUG_MULTISTATE_PS > 1 ) 
    759758      {  
    760          cerr << indent_chars << "processing eval_id " << eval_id << endl; 
     759         cerr << indent_chars << "processing eval_id " << eval.first << endl; 
    761760      } 
    762761 
     
    769768 
    770769      // process the 'callback' 
    771       map<EvaluationID, StateContainer>::iterator eval = m_pending.find(eval_id); 
    772       if ( eval == m_pending.end() ) 
     770      map<EvaluationID, StateContainer>::iterator eval_cb  
     771         = m_pending.find(eval.first); 
     772      if ( eval_cb == m_pending.end() ) 
    773773      { 
    774774         EXCEPTION_MNGR( runtime_error, 
    775                          "MultiStatePS::minimize - invalid evalID returned" ); 
    776       } 
    777  
    778       --(eval->second->pending); 
    779       eval->second->process(response, eval_id); 
    780       m_pending.erase(eval); 
    781    } 
    782  
    783    if ( eval_id.empty() ) 
     775                         "MultiStatePS::optimize - invalid evalID returned" ); 
     776      } 
     777 
     778      --(eval_cb->second->pending); 
     779      eval_cb->second->process(eval.second, eval.first); 
     780      m_pending.erase(eval_cb); 
     781   } 
     782 
     783   if ( eval.first.empty() ) 
    784784   { 
    785785      best().termination_info = "No remaining queued evaluations"; 
     
    787787 
    788788   if ( DEBUG_MULTISTATE_PS ) 
    789       cerr << "minimize(): complete" << endl;  
     789      cerr << "optimize(): complete" << endl;  
    790790} 
    791791 
     
    811811MultiStatePS::checkCache(MultiStatePS::domain_t &point) 
    812812{ 
    813    static colin::EpsilonCache cache(problem.operator->()); 
    814    return cache.get_response(point); 
     813   static colin::ResponseCache* cache = NULL; 
     814   if ( cache == NULL ) 
     815      cache = colin::CacheFactory().create("Local", "Epsilon"); 
     816   EXCEPTION_MNGR(std::logic_error,  
     817                  "MSPS is currently broken and needs to be reworked " 
     818                  "to use new colin caching system"); 
     819   return response_t();//cache->find(problem.application(), point).first; 
    815820} 
    816821 
     
    850855   response_t    rs; 
    851856   domain_t      trial; 
    852    newCenter->get_point(trial); 
     857   newCenter.get_domain(trial); 
    853858 
    854859   if ( DEBUG_MULTISTATE_PS > 1 ) 
    855860   { 
    856861      cerr << indent << "expand_pattern_cartesian(): center fval = "  
    857            << newCenter->value<double>(f_info) << endl; 
     862           << newCenter.value<double>(f_info) << endl; 
    858863      cerr << indent << indent_chars << "domain = " << trial << endl; 
    859864   } 
     
    882887            cerr << indent << indent_chars << "trial("  
    883888                 << (positive ? "+" : "-") << "): "  
    884                  << trial << " [" << rs->number_computed(f_info) << "]";  
     889                 << trial;// << " [" << rs.number_computed(f_info) << "]";  
    885890         } 
    886891 
    887          if ( ! rs->is_computed(f_info) ) 
     892         if ( ! rs.is_computed(f_info) ) 
    888893         {  
    889             colin::AppRequest rq(rs); 
     894            colin::AppRequest rq = problem->set_domain(rs.get_domain()); 
    890895            problem->Request_F(rq); 
    891896            new_pts.push_back(rq); 
     
    12381243 
    12391244 
     1245namespace StaticInitializers { 
     1246 
     1247namespace { 
     1248 
     1249bool RegisterMultiStatePS() 
     1250{ 
     1251   colin::SolverMngr().declare_solver_type<MultiStatePS> 
     1252      ("coliny:MultiState",  
     1253       "The MultiState Pattern Search optimizer"); 
     1254 
     1255   colin::SolverMngr().declare_solver_type<MultiStatePS> 
     1256      ("coliny:msps", "An alias to coliny:MultiState"); 
     1257 
     1258   return true; 
     1259} 
     1260 
     1261} // namespace coliny::StaticInitializers::(local) 
     1262 
     1263extern const volatile bool multistate_ps = RegisterMultiStatePS(); 
     1264 
     1265} // namespace coliny::StaticInitializers 
     1266 
    12401267} // namespace coliny 
    1241  
     1268/* 
    12421269FACTORY_NAMED_REGISTER(msps, "coliny:msps", colin::OptSolverHandle*, return new  
    12431270                 colin::ConcreteOptSolverHandle<coliny::MultiStatePS>;, 
     
    12461273                 colin::ConcreteOptSolverHandle<coliny::MultiStatePS>;, 
    12471274                "The MultiState Pattern Search optimizer") 
     1275*/ 
  • coliny/trunk/src/lib/PLGO.cpp

    r5272 r5726  
    1515#ifdef ACRO_USING_PLGO 
    1616 
    17 #include <colin/ConcreteOptSolverHandle.h> 
    1817#include <coliny/Factory.h> 
    1918#include <coliny/PLGO.h> 
     19 
     20//#include <colin/ConcreteOptSolverHandle.h> 
     21#include <colin/SolverMngr.h> 
    2022 
    2123using namespace std; 
     
    5254void PLGO::reset() 
    5355{ 
    54 if (!problem) 
     56if (problem.empty()) 
    5557   return; 
    5658if (problem->numConstraints() > 0) 
    5759   EXCEPTION_MNGR(std::runtime_error, "PLGO::reset() - PLGO cannot solve a constrained optimization problem"); 
    5860 
    59 func.problem &= problem; 
     61func.problem = problem; 
    6062solver->set_func(&func); 
    6163 
     
    116118} 
    117119 
    118 }  
    119120 
     121namespace StaticInitializers { 
     122 
     123namespace { 
     124 
     125bool RegisterPLGO() 
     126{ 
     127   colin::SolverMngr().declare_solver_type<PLGO> 
     128      ("coliny:plipshitzian", "A parallel Lipshitzian global optimizer"); 
     129 
     130   colin::SolverMngr().declare_solver_type<PLGO> 
     131      ("coliny:plgo", "An alias to coling:plipshitzian"); 
     132 
     133   return true; 
     134} 
     135 
     136} // namespace coliny::StaticInitializers::(local) 
     137 
     138extern const volatile bool plgo = RegisterPLGO(); 
     139 
     140} // namespace coliny::StaticInitializers 
     141 
     142} // namespace coliny 
     143 
     144/* 
    120145FACTORY_NAMED_REGISTER(plgo, "coliny:plgo", colin::OptSolverHandle*, 
    121146                return new colin::ConcreteOptSolverHandle<coliny::PLGO>;, 
     
    124149                return new colin::ConcreteOptSolverHandle<coliny::PLGO>;, 
    125150                "A parallel Lipshitzian global optimizer") 
    126  
     151*/ 
    127152#endif 
  • coliny/trunk/src/lib/PatternSearch.cpp

    r5340 r5726  
    1313 
    1414#include <acro_config.h> 
     15 
     16#include <coliny/PatternSearch.h> 
     17 
     18//#include <colin/ConcreteOptSolverHandle.h> 
     19#include <colin/SolverMngr.h> 
     20 
    1521#include <utilib/_math.h> 
    1622#include <utilib/Uniform.h> 
    17 #include <colin/ConcreteOptSolverHandle.h> 
    18 #include <coliny/PatternSearch.h> 
    1923 
    2024#define EM_MULTISTEP            0 
     
    4852using namespace utilib; 
    4953using colin::EvaluationID; 
     54using std::stringstream; 
    5055 
    5156#define PENALTY_RATIO (std::pow((1.0+std::log(Delta_init/Delta_min)),2.0)) 
     
    7681 
    7782PatternSearch::PatternSearch() 
    78  : Delta_init(1.0), 
    79    Delta_thresh(1e-5), 
    80    rho(-1.0), 
    81    sufficient_decrease_coef(0.01), 
    82    ex_factor(2.0), 
    83    ct_factor(0.5), 
    84    max_success(5), 
    85    update_str("default"), 
     83 : rho(-1.0), 
    8684   update_id(PATTERN_SEARCH_DEFAULT), 
    87    basis_str("coordinate"), 
    8885   basis_id(UNKNOWN_BASIS), 
    8986   last_pt_id(-1), 
    90    em_str("simple"), 
    91    step_selection_str("random"), 
    92    biased_selection_factor(0.9), 
    9387   reverse_flag(false), 
    94    num_augmented_trials(0), 
    9588   trunc_fps(false), 
    9689   shrink_flag(false), 
     
    9891   extended_stopping_rule(true), 
    9992   nreq_trials(0), 
    100    HJ_bias(false), 
    101    Debug_success(false), 
    102    auto_rescale_flag(true), 
    10393   simple_app(0) 
    10494{ 
     
    10898#endif 
    10999 
    110 solver_type = "PatternSearch"; 
    111  
    112 ParameterSet::create_categorized_parameter("auto_rescale",auto_rescale_flag, 
    113         "<bool>","true", 
    114         "If true, then automatically rescale the search for bound-constrained\n" 
    115 "\t  problems. The initial scale is 10% of the range in each dimension.", 
    116         "Step Length Control"); 
    117  
    118 ParameterSet::create_categorized_parameter("initial_step",Delta_init, 
    119         "<double>","1.0", 
    120         "Initial step length", 
    121         "Step Length Control"); 
    122 ParameterSet::alias_parameter("initial_step","initial_stepsize"); 
    123 ParameterSet::alias_parameter("initial_step","initial_steplength"); 
    124  
    125 ParameterSet::create_categorized_parameter("step_tolerance",Delta_thresh, 
    126         "<double>","1e-5", 
    127         "Convergence tolerance step length", 
    128         "Termination"); 
    129  
    130 ParameterSet::create_categorized_parameter("contraction_factor",ct_factor, 
    131         "<double>","0.5", 
    132         "Contraction factor", 
    133         "Step Length Control"); 
    134  
    135 ParameterSet::create_categorized_parameter("num_augmented_trials",num_augmented_trials, 
    136         "<int>","0", 
    137         "The number of additional trial points used during search", 
    138         "Pattern Selection"); 
    139  
    140 ParameterSet::create_categorized_parameter("max_success",max_success, 
    141         "<int>","5", 
    142         "Number of successful iterations before step length is expanded", 
    143         "Step Length Control"); 
    144  
    145 ParameterSet::create_categorized_parameter("step_scales",Sigma, 
    146         "<Array<double>>","All 1.0", 
    147         "The scale factors for each dimension", 
    148         "Step Length Control"); 
    149  
    150 ParameterSet::create_categorized_parameter("update_type",update_str, 
    151         "<str>","default", 
    152         "Control for step length update:\n\t  default: expand and contract normally\n\t  single_expand: allow expansions until the first contraction", 
    153         "Step Length Control"); 
    154  
    155 ParameterSet::create_categorized_parameter("HJ_bias",HJ_bias, 
    156         "<bool>","false", 
    157         "If true, then use the biased steps used in the Hooke-Jeeves direct\ 
     100   utilib::OptionParser &opt = this->option; 
     101 
     102   auto_rescale_flag = true; 
     103   opt.add("auto_rescale",auto_rescale_flag, 
     104           "If true, then automatically rescale the search for " 
     105           "bound-constrained\n" 
     106           "\t  problems. The initial scale is 10% of the range in " 
     107           "each dimension."); 
     108 
     109   Delta_init = 1.0; 
     110   opt.add("initial_step",Delta_init, 
     111           "Initial step length"); 
     112   opt.alias_parameter("initial_step","initial_stepsize"); 
     113   opt.alias_parameter("initial_step","initial_steplength"); 
     114 
     115   Delta_thresh = 1e-5; 
     116   opt.add("step_tolerance",Delta_thresh, 
     117           "Convergence tolerance step length"); 
     118 
     119   ct_factor = 0.5; 
     120   opt.add("contraction_factor",ct_factor, 
     121           "Contraction factor"); 
     122 
     123   num_augmented_trials = 0; 
     124   opt.add("num_augmented_trials",num_augmented_trials, 
     125           "The number of additional trial points used during search"); 
     126 
     127   max_success = 5; 
     128   opt.add("max_success",max_success, 
     129           "Number of successful iterations before step length is expanded"); 
     130 
     131   Sigma.resize(1); 
     132   Sigma << 1.0; 
     133   opt.add("step_scales",Sigma, 
     134           "The scale factors for each dimension"); 
     135 
     136   update_str = "default"; 
     137   opt.add("update_type",update_str, 
     138           "Control for step length update:\n" 
     139           "\t  default: expand and contract normally\n" 
     140           "\t  single_expand: allow expansions until the first contraction"); 
     141    
     142   HJ_bias = false; 
     143   opt.add("HJ_bias",HJ_bias, 
     144           "If true, then use the biased steps used in the Hooke-Jeeves direct\ 
    158145\n\t   search method.  This only works with the simple and multistep\ 
    159146\n\t   exploratory_moves options.  Note that HJ_bias with multistep is\ 
    160 \n\t   equivalent to the Hooke-Jeeves direct search method.", 
    161         "Pattern Selection"); 
    162  
    163 ParameterSet::create_categorized_parameter("step_selection",step_selection_str, 
    164         "<str>","random", 
    165         "Defines the method used to order the selection of trial steps:\ 
     147\n\t   equivalent to the Hooke-Jeeves direct search method."); 
     148 
     149   step_selection_str = "random"; 
     150   opt.add("step_selection",step_selection_str, 
     151           "Defines the method used to order the selection of trial steps:\ 
    166152\n\t   random:    select steps in a uniformly random order\ 
    167153\n\t   biased:    select steps that look like previous improving steps.\ 
    168154\n\t              Uses the biased_selection_factor.\ 
    169 \n\t   fixed:     select steps in simple numerical order.", 
    170         "Pattern Selection"); 
    171  
    172 ParameterSet::create_categorized_parameter("biased_selection_factor",biased_selection_factor, 
    173         "<double>","1.0", 
    174         "Determines how the deterministic biased selection scheme is\ 
     155\n\t   fixed:     select steps in simple numerical order."); 
     156 
     157   biased_selection_factor = 0.9; 
     158   opt.add("biased_selection_factor",biased_selection_factor, 
     159           "Determines how the deterministic biased selection scheme is\ 
    175160\n\t   is used to order the trial steps in the pattern.  This value must be\ 
    176161\n\t   greater than zero and less-than-or-equal to one.  The closer the\ 
    177162\n\t   value is to one the more the last improving search direction is used\ 
    178 \n\t   as a bias.", 
    179         "Pattern Selection"); 
    180  
    181 ParameterSet::create_categorized_parameter("basis",basis_str, 
    182         "<str>","coordinate", 
    183         "The type of basis used for search:\n" 
     163\n\t   as a bias."); 
     164 
     165   basis_str = "coordinate"; 
     166   opt.add("basis",basis_str, 
     167           "The type of basis used for search:\n" 
    184168"\t  coordinate: 2n directions along the coordinate axes\n" 
    185169"\t  rotated_coordinate: 2n orthogonal directions which have been rotated\n" 
    186 "\t  simplex:    n+1 directions in a regular simplex", 
    187         "Pattern Selection"); 
    188  
    189 ParameterSet::create_parameter("exploratory_move",em_str, 
    190         "<str>","simple", 
    191         "The type of exploratory move used:\n" 
     170           "\t  simplex:    n+1 directions in a regular simplex"); 
     171 
     172   em_str = "simple"; 
     173   opt.add("exploratory_move",em_str, 
     174           "The type of exploratory move used:\n" 
    192175"\t  multi_step: Check for improvement in each search direction\n" 
    193176"\t     iteratively. Adapt the pattern to keep improvements when detected\n" 
     
    201184); 
    202185 
    203 ParameterSet::create_categorized_parameter("debug_success",Debug_success, 
    204         "<bool>","false", 
    205         "If true, then record whether each iteration is successful", 
    206         "Debugging"); 
    207  
    208 ParameterSet::create_categorized_parameter("alpha",sufficient_decrease_coef,  
    209         "<double>","0.01", 
    210         "Sufficient decrease parameter", 
    211         "Step Length Control"); 
    212  
    213 ParameterSet::create_categorized_parameter("expansion_factor",ex_factor, 
    214         "<double>","2.0", 
    215         "Expansion factor", 
    216         "Step Length Control"); 
    217  
     186   Debug_success = false; 
     187   opt.add("debug_success",Debug_success, 
     188           "If true, then record whether each iteration is successful"); 
     189 
     190   sufficient_decrease_coef = 0.01; 
     191   opt.add("alpha",sufficient_decrease_coef,  
     192           "Sufficient decrease parameter"); 
     193 
     194   ex_factor = 2.0; 
     195   opt.add("expansion_factor",ex_factor, 
     196           "Expansion factor"); 
     197 
     198   reset_signal.connect(boost::bind(&PatternSearch::reset_PatternSearch, this)); 
    218199} 
    219200 
     
    231212   if (problem_.type() == typeid(colin::OptProblem<colin::UNLP0_problem>)) 
    232213   { 
    233       problem &= problem_.expose<colin::OptProblem<colin::UNLP0_problem> > (); 
     214      problem = problem_.expose<colin::OptProblem<colin::UNLP0_problem> > (); 
    234215   } 
    235216   else 
     
    244225         colin::ProblemMngr().lexical_cast(problem_, tmp_problem); 
    245226         simple_app = new colin::ConstraintPenaltyApplication 
    246             <colin::NLP0_problem>(tmp_problem.application()); 
     227            <colin::UNLP0_problem>(tmp_problem); 
    247228         problem.set_application(simple_app); 
    248229      } 
     
    255236      } 
    256237   } 
    257  
    258 } 
    259  
    260  
    261 void PatternSearch::reset() 
     238} 
     239 
     240 
     241void PatternSearch::reset_PatternSearch() 
    262242{ 
    263 if (!problem) return; 
     243   if ( problem.empty() ) return; 
    264244/* 
    265245if ((problem->numConstraints() > 0) && 
     
    270250*/ 
    271251  double SHRINK_BOUND = 8.0; 
    272   colin::StdOptSolver<BasicArray<double>,colin::UNLP0_problem> :: reset(); 
    273252   
    274253  unsigned int nvars = problem->num_real_vars(); 
    275254  if (nvars == 0) return; 
    276255   
    277   bc_flag = problem->enforcing_bounds(); 
     256  bc_flag = problem->enforcing_domain_bounds(); 
    278257  if (bc_flag) 
    279258    problem->get_real_bounds(lower_bc, upper_bc); 
     
    345324    EXCEPTION_MNGR(runtime_error, "PatternSearch::reset -- incompatable HJ_bias with exploratory moves: \n\t\t" << em_str ); 
    346325       
    347   if ((problem->enforcing_bounds()) &&                
     326  if ((problem->enforcing_domain_bounds()) &&                
    348327      ((basis_str != "coordinate") && (basis_str != "prioritized_test")) ){ 
    349328    EXCEPTION_MNGR(runtime_error,"PatternSearch::reset - must specify coordinate pattern for bound-constrained problems."); 
     
    530509 
    531510 
    532 void PatternSearch::minimize() 
     511void PatternSearch::optimize() 
    533512{ 
    534513// 
    535514// Misc initialization of the optimizer 
    536515// 
    537 opt_init(); 
     516//opt_init(); 
    538517if (!(this->initial_point_flag)) 
    539518   EXCEPTION_MNGR(runtime_error,"PatternSearch::minimize - no initial point specified."); 
     
    10701049      //std::cerr << "HERE " << response->value<double>(colin::f_info); 
    10711050      response = tmp_response; 
    1072       response->get(colin::f_info, _best_val); 
     1051      response.get(colin::f_info, _best_val); 
    10731052      //std::cerr << " " << _best_val << std::endl; 
    1074       response->get_point(x_); 
     1053      response.get_domain(x_); 
    10751054      return true; 
    10761055      } 
     
    14111390         h = queue_order[id]; 
    14121391         response = tmp_response; 
    1413          response->get(colin::f_info, _best_val); 
    1414          response->get_point(x_); 
     1392         response.get(colin::f_info, _best_val); 
     1393         response.get_domain(x_); 
    14151394         } 
    14161395      } 
     
    14761455         h = queue_order[id]; 
    14771456         response = tmp_response; 
    1478          response->get(colin::f_info, _best_val); 
    1479          response->get_point(x_); 
     1457         response.get(colin::f_info, _best_val); 
     1458         response.get_domain(x_); 
    14801459         } 
    14811460      } 
     
    16201599void PatternSearch::write(std::ostream& os) const 
    16211600{ 
    1622 colin::StdOptSolver<BasicArray<double>,colin::UNLP0_problem> :: write(os); 
     1601colin::ColinOptSolver<BasicArray<double>,colin::UNLP0_problem> :: write(os); 
    16231602 
    16241603os << "##\n## Pattern Search Controls\n##\n"; 
     
    18311810} 
    18321811 
     1812 
     1813 
     1814namespace StaticInitializers { 
     1815 
     1816namespace { 
     1817 
     1818bool RegisterPatternSearch() 
     1819{ 
     1820   colin::SolverMngr().declare_solver_type<PatternSearch> 
     1821      ("coliny:PatternSearch",  
     1822       "A generic pattern search optimizer"); 
     1823 
     1824   colin::SolverMngr().declare_solver_type<PatternSearch> 
     1825      ("coliny:ps", "An alias to coliny:PatternSearch"); 
     1826 
     1827   return true; 
     1828} 
     1829 
     1830} // namespace coliny::StaticInitializers::(local) 
     1831 
     1832extern const volatile bool pattern_serch = RegisterPatternSearch(); 
     1833 
     1834} // namespace coliny::StaticInitializers 
     1835 
    18331836} // namespace coliny 
    1834  
     1837/* 
    18351838FACTORY_NAMED_REGISTER(ps, "coliny:ps", colin::OptSolverHandle*, 
    18361839        return new colin::ConcreteOptSolverHandle<coliny::PatternSearch>;, 
     
    18391842        return new colin::ConcreteOptSolverHandle<coliny::PatternSearch>;, 
    18401843        "A generic pattern search optimizer") 
    1841  
     1844*/ 
  • coliny/trunk/src/lib/SolisWets.cpp

    r5274 r5726  
    1919 
    2020#include <acro_config.h> 
     21#include <coliny/SolisWets.h> 
     22 
     23//#include <colin/ConcreteOptSolverHandle.h> 
     24#include <colin/SolverMngr.h> 
     25 
    2126#include <utilib/_math.h> 
    2227#include <utilib/pvector.h> 
    2328#include <utilib/stl_auxillary.h> 
    24 #include <colin/ConcreteOptSolverHandle.h> 
    25 #include <coliny/SolisWets.h> 
    2629 
    2730#define SWAP(x,y)       {NumArray<double>* tmp; tmp = x; x = y; y = tmp;} 
     
    3942 
    4043SolisWets::SolisWets() 
    41  : max_success(5), 
    42    max_failure(0), 
    43    ex_factor(2.0), 
    44    ct_factor(0.5), 
    45    Delta_thresh(1e-6), 
    46    Delta_init(1.0), 
    47    update_type("default"), 
    48    bias_flag(false), 
    49    neighborhood_type("normal") 
    5044{ 
    5145#if COLINDONE 
     
    5448#endif 
    5549 
    56 solver_type = "SolisWets"; 
    57  
    58 auto_rescale_flag=true; 
    59 ParameterSet::create_categorized_parameter("auto_rescale",auto_rescale_flag, 
    60         "<bool>","true", 
     50   utilib::OptionParser &opt = this->option; 
     51 
     52   auto_rescale_flag=true; 
     53   opt.add("auto_rescale",auto_rescale_flag, 
    6154        "If true, then automatically rescale the search for bound-constrained\n" 
    62 "\t  problems. The initial scale is 10% of the range in each dimension.", 
    63         "Step Length Control"); 
    64  
    65 ParameterSet::create_categorized_parameter("initial_step",Delta_init, 
    66         "<double>","1.0", 
    67         "Initial step length", 
    68         "Step Length Control"); 
    69 ParameterSet::alias_parameter("initial_step","initial_stepsize"); 
    70 ParameterSet::alias_parameter("initial_step","initial_steplength"); 
    71  
    72 ParameterSet::create_categorized_parameter("max_success",max_success, 
    73         "<int>","5", 
    74         "Number of successful iterations before step length is expanded", 
    75         "Step Length Control"); 
    76  
    77 ParameterSet::create_categorized_parameter("max_failure",max_failure, 
    78         "<int>","4*n", 
    79         "Number of unsuccessful iterations before step length is contracted", 
    80         "Step Length Control"); 
    81  
    82 ParameterSet::create_categorized_parameter("expansion_factor",ex_factor, 
    83         "<double>","2.0", 
    84         "Expansion factor", 
    85         "Step Length Control"); 
    86  
    87 ParameterSet::create_categorized_parameter("contraction_factor",ct_factor, 
    88         "<double>","0.5", 
    89         "Contraction factor", 
    90         "Step Length Control"); 
    91  
    92 ParameterSet::create_categorized_parameter("step_tolerance",Delta_thresh, 
    93         "<double>","1e-6", 
    94         "Convergence tolerance step length", 
    95         "Termination"); 
    96  
    97 ParameterSet::create_categorized_parameter("update_type",update_type, 
    98         "<string>","default", 
    99         "Control for step length update:\n\t  default, single_expand", 
    100         "Step Length Control"); 
    101  
    102 ParameterSet::create_parameter("bias_flag",bias_flag, 
    103         "<boolean>","false", 
    104         "Use an adaptive step bias"); 
    105  
    106 ParameterSet::create_parameter("neighborhood_type",neighborhood_type, 
    107         "<string>","normal", 
    108         "Type of neighorhood used:\n\t  normal, uniform, sphere"); 
    109  
    110 ParameterSet::create_categorized_parameter("step_scales",Sigma, 
    111         "<Array<double>>","All 1.0", 
    112         "The scale factors for each dimension", 
    113         "Step Length Control"); 
    114 } 
    115  
    116  
    117 void SolisWets::reset() 
    118 { 
    119 if (!problem) return; 
    120  
    121 colin::StdOptSolver<BasicArray<double>,colin::UNLP0_problem>::reset(); 
     55           "\t  problems. The initial scale is 10% of the range in each dimension."); 
     56 
     57   Delta_init = 1.0; 
     58   opt.add("initial_step",Delta_init, 
     59           "Initial step length"); 
     60   opt.alias_parameter("initial_step","initial_stepsize"); 
     61   opt.alias_parameter("initial_step","initial_steplength"); 
     62 
     63   max_success = 5; 
     64   opt.add("max_success",max_success, 
     65           "Number of successful iterations before step length is expanded"); 
     66 
     67   max_failure = 0; 
     68   opt.add("max_failure",max_failure, 
     69           "Number of unsuccessful iterations before step length is contracted"); 
     70 
     71   ex_factor = 2.0; 
     72   opt.add("expansion_factor",ex_factor, 
     73           "Expansion factor"); 
     74 
     75   ct_factor = 0.5; 
     76   opt.add("contraction_factor",ct_factor, 
     77           "Contraction factor"); 
     78 
     79   Delta_thresh = 1e-6; 
     80   opt.add("step_tolerance",Delta_thresh, 
     81           "Convergence tolerance step length"); 
     82 
     83   update_type = "default"; 
     84   opt.add("update_type",update_type, 
     85           "Control for step length update:\n\t  default, single_expand"); 
     86 
     87   bias_flag = false; 
     88   opt.add("bias_flag",bias_flag, 
     89           "Use an adaptive step bias"); 
     90 
     91   neighborhood_type = "normal"; 
     92   opt.add("neighborhood_type",neighborhood_type, 
     93           "Type of neighorhood used:\n\t  normal, uniform, sphere"); 
     94 
     95   Sigma.resize(1); 
     96   Sigma << 1.0; 
     97   opt.add("step_scales",Sigma, 
     98           "The scale factors for each dimension"); 
     99 
     100   reset_signal.connect(boost::bind(&SolisWets::reset_SolisWets, this)); 
     101} 
     102 
     103 
     104void SolisWets::reset_SolisWets() 
     105{ 
     106if ( problem.empty() ) return; 
    122107 
    123108if (!rng) 
     
    131116   EXCEPTION_MNGR(runtime_error,"SolisWets::reset - Scale vector length " << Sigma.size() << " is \n\t  not equal to num_real_vars: " << n); 
    132117Sigma.resize(n); 
    133 bool bc_flag = problem->enforcing_bounds(); 
     118bool bc_flag = problem->enforcing_domain_bounds(); 
    134119utilib::pvector<colin::real> lower_bc, upper_bc; 
    135120if (bc_flag) 
     
    191176 
    192177 
    193 void SolisWets::minimize() 
     178void SolisWets::optimize() 
    194179{ 
    195180// 
    196181// Misc initialization of the optimizer 
    197182// 
    198 opt_init(); 
     183//opt_init(); 
    199184if (!(this->initial_point_flag)) 
    200185   EXCEPTION_MNGR(runtime_error,"SolisWets::minimize - no initial point specified."); 
     
    433418void SolisWets::write(ostream& os) const 
    434419{ 
    435 colin::StdOptSolver<BasicArray<double>,colin::UNLP0_problem>::write(os); 
     420colin::ColinOptSolver<BasicArray<double>,colin::UNLP0_problem>::write(os); 
    436421  
    437422os << "##\n## Solis-Wets Information\n##\n"; 
     
    566551#endif 
    567552 
     553 
     554namespace StaticInitializers { 
     555 
     556namespace { 
     557 
     558bool RegisterSolisWets() 
     559{ 
     560   colin::SolverMngr().declare_solver_type<SolisWets> 
     561      ("coliny:SolisWets",  
     562       "The derivative-free optimizer of Solis-Wets"); 
     563 
     564   colin::SolverMngr().declare_solver_type<SolisWets> 
     565      ("coliny:sw", "An alias to coliny:SolisWets"); 
     566 
     567   return true; 
     568} 
     569 
     570} // namespace coliny::StaticInitializers::(local) 
     571 
     572extern const volatile bool solis_wets = RegisterSolisWets(); 
     573 
     574} // namespace coliny::StaticInitializers 
     575 
    568576} // namespace coliny 
    569577 
     578/* 
    570579FACTORY_NAMED_REGISTER(sw, "coliny:sw", colin::OptSolverHandle*, 
    571580                return new colin::ConcreteOptSolverHandle<coliny::SolisWets>;, 
     
    574583                return new colin::ConcreteOptSolverHandle<coliny::SolisWets>;, 
    575584                "The derivative-free optimizer of Solis-Wets") 
    576  
     585*/ 
  • coliny/trunk/src/lib/factory.cpp

    r5347 r5726  
    1111/// references data for other Coliny solvers that are registered. 
    1212 
    13 #include <algorithm> 
    14 #include <coliny/Factory.h> 
     13//#include <algorithm> 
     14//#include <coliny/Factory.h> 
    1515#include <coliny/MultiStart.h> 
    1616#include <coliny/PatternSearch.h> 
     
    1818#include <coliny/EAminlp.h> 
    1919#include <coliny/PIDOMS.h> 
     20 
    2021#include <colin/ConcreteOptSolverHybridHandle.h> 
     22#include <colin/SolverMngr.h> 
     23 
    2124 
    2225/* REGISTERING SOLVERS IN COLINY HEADERS */ 
    2326 
    2427typedef coliny::MultiStart<utilib::MixedIntVars, colin::MINLP0_problem> ms_opt; 
     28 
     29typedef coliny::PIDOMS<colin::MINLP1_problem> pidoms_nlp1_minlp1_type; 
     30 
     31typedef colin::ConcreteOptSolverHybridHandle< coliny::MultiStart<utilib::MixedIntVars, colin::MINLP0_problem> , coliny::SolisWets > ms_sw_type; 
     32typedef colin::ConcreteOptSolverHybridHandle< coliny::MultiStart<utilib::MixedIntVars, colin::MINLP0_problem> , coliny::PatternSearch > ms_ps_type; 
     33typedef colin::ConcreteOptSolverHybridHandle< coliny::EAminlp , coliny::SolisWets > ea_sw_type; 
     34typedef colin::ConcreteOptSolverHybridHandle< coliny::EAminlp , coliny::PatternSearch > ea_ps_type; 
     35 
     36namespace coliny { 
     37namespace StaticInitializers { 
     38 
     39extern const volatile bool direct; 
     40extern const volatile bool docking_ps; 
     41extern const volatile bool pattern_serch; 
     42extern const volatile bool solis_wets; 
     43extern const volatile bool multistate_ps; 
     44 
     45#ifdef ACRO_USING_PLGO 
     46extern const volatile bool plgo; 
     47#endif 
     48 
     49namespace { 
     50 
     51bool RegisterCommon() 
     52{ 
     53   // referencing solvers registered in cpp files 
     54   static_cast<void>(direct); 
     55   static_cast<void>(docking_ps); 
     56   static_cast<void>(pattern_serch); 
     57   static_cast<void>(solis_wets); 
     58   static_cast<void>(multistate_ps); 
     59 
     60#ifdef ACRO_USING_PLGO 
     61   static_cast<void>(plgo); 
     62#endif 
     63 
     64   // Registering solvers that are declared entirely in headers  
     65   //   (i.e. templates) 
     66 
     67   colin::SolverMngr().declare_solver_type<ms_opt> 
     68      ("coliny:MultiStart", "A simple random sampler"); 
     69 
     70   colin::SolverMngr().declare_solver_type<ms_opt> 
     71      ("coliny:multistart", "An alias to coliny:MultiStart"); 
     72 
     73   colin::SolverMngr().declare_solver_type<ms_opt> 
     74      ("coliny:ms", "An alias to coliny:MultiStart"); 
     75 
     76 
     77   colin::SolverMngr().declare_solver_type<EAminlp> 
     78      ("coliny:MEminlp", "An evolutionary algorithm"); 
     79 
     80   colin::SolverMngr().declare_solver_type<ms_opt> 
     81      ("coliny:ea", "An alias to coliny:EAminlp"); 
     82 
     83 
     84   colin::SolverMngr().declare_solver_type<pidoms_nlp1_minlp1_type> 
     85      ("coliny:PIDOMS",  
     86       "Parallel Iterative Decomposition of Multistart Search"); 
     87 
     88   colin::SolverMngr().declare_solver_type<pidoms_nlp1_minlp1_type> 
     89      ("coliny:pidoms", "An alias to coliny:PIDOMS"); 
     90 
     91   /* 
     92   colin::SolverMngr().declare_solver_type<ms_sw_type> 
     93      ("coliny:ms-sw", "Multi-start Solis-Wets"); 
     94 
     95   colin::SolverMngr().declare_solver_type<ms_ps_type> 
     96      ("coliny:ms-ps", "Multi-start pattern search"); 
     97 
     98   colin::SolverMngr().declare_solver_type<ea_sw_type> 
     99      ("coliny:ea-sw", "Hybrid EA with Solis-Wets local search"); 
     100 
     101   colin::SolverMngr().declare_solver_type<ea_ps_type> 
     102      ("coliny:ea-ps", "Hybrid EA with PatternSearch local search"); 
     103   */ 
     104   return true; 
     105} 
     106 
     107} // namespace coliny::StaticInitializers::(local) 
     108 
     109extern const volatile bool coliny_solvers = RegisterCommon(); 
     110 
     111} // namespace coliny::StaticInitializers 
     112} // namespace coliny 
     113 
     114 
     115 
     116 
     117/* 
    25118FACTORY_NAMED_REGISTER(ms, "coliny:ms", colin::OptSolverHandle*, 
    26119                return new colin::ConcreteOptSolverHandle<ms_opt>;, 
     
    40133                "An alias to EAminlp") 
    41134 
    42 typedef coliny::PIDOMS<colin::MINLP1_problem> pidoms_nlp1_minlp1_type; 
    43135 
    44136FACTORY_NAMED_REGISTER(pidoms, "coliny:pidoms", colin::OptSolverHandle*, 
     
    49141                "An alias to PIDOMS") 
    50142 
    51 /* REGISTERING HYBRID COLINY SOLVERS */ 
     143// 
     144// REGISTERING HYBRID COLINY SOLVERS  
     145// 
    52146 
    53147typedef colin::ConcreteOptSolverHybridHandle< coliny::MultiStart<utilib::MixedIntVars, colin::MINLP0_problem> , coliny::SolisWets > ms_sw_type; 
     
    70164                return new ea_ps_type();, 
    71165                "Hybrid EA with PatternSearch local search") 
     166*/ 
Note: See TracChangeset for help on using the changeset viewer.