00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include <iomanip>
00011 #include <fstream>
00012
00013 #include "CoinPragma.hpp"
00014 #include "BonminConfig.h"
00015 #include "IpoptConfig.h"
00016 #include "CbcConfig.h"
00017 #include "CoinTime.hpp"
00018 #include "RobotSetup.hpp"
00019 #include "BonCbc.hpp"
00020
00021 #define CATCH_ERRORS
00022 using namespace Bonmin;
00023 int main (int argc, char *argv[])
00024 {
00025 using namespace Ipopt;
00026 char * pbName = NULL;
00027
00028 std::cout<<"Bonmin "
00029 <<BONMIN_VERSION;
00030 std::cout<<" using Cbc "
00031 <<CBC_VERSION;
00032 std::cout<<" and Ipopt "
00033 <<IPOPT_VERSION<<std::endl;
00034 if(argc > 1) {
00035 pbName = new char[strlen(argv[1])+1];
00036 strcpy(pbName, argv[1]);
00037 }
00038 #ifdef CATCH_ERRORS
00039 try
00040 #endif
00041 {
00042
00043
00044 RobotSetup bonmin;
00045 bonmin.initialize(argv);
00046 Bab bb;
00047
00048 bb(bonmin);
00049
00050 }
00051 #ifdef CATCH_ERRORS
00052 catch(TNLPSolver::UnsolvedError *E) {
00053 E->writeDiffFiles();
00054 E->printError(std::cerr);
00055
00056
00057
00058
00059 }
00060 catch(OsiTMINLPInterface::SimpleError &E) {
00061 std::cerr<<E.className()<<"::"<<E.methodName()
00062 <<std::endl
00063 <<E.message()<<std::endl;
00064 }
00065 catch(CoinError &E) {
00066 std::cerr<<E.className()<<"::"<<E.methodName()
00067 <<std::endl
00068 <<E.message()<<std::endl;
00069 }
00070 catch (Ipopt::OPTION_INVALID &E)
00071 {
00072 std::cerr<<"Ipopt exception : "<<E.Message()<<std::endl;
00073 }
00074 catch (Ipopt::IpoptException &E)
00075 {
00076 std::cerr<<"Ipopt exception : "<<E.Message()<<std::endl;
00077 }
00078 catch(...) {
00079 std::cerr<<pbName<<" unrecognized exception"<<std::endl;
00080 std::cerr<<pbName<<"\t Finished \t exception"<<std::endl;
00081 throw;
00082 }
00083 #endif
00084
00085 delete [] pbName;
00086 return 0;
00087 }
00088