00001 /* This file is part of the Solver for Udine Course Timetabling Problem based 00002 * on Multiphase Exploitation of Multiple Objective-/Value-restricted Submodels 00003 * (abbreviated MEMOS for Timetabling). 00004 * 00005 * Copyright 2009 Jakub Marecek 00006 * Copyright 2009 The University of Nottingham 00007 * http://www.cs.nott.ac.uk/~jxm/timetabling/memos/ 00008 * http://memos-solvers.sourceforge.net/ 00009 * 00010 * MEMOS for Timetabling is free software: you can redistribute it and/or 00011 * modify it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation, either version 3 of the License, or (at your 00013 * option) any later version. It would be greatly appreciated, however, if you 00014 * could cite the following paper in any work that uses it: 00015 * Edmund K. Burke, Jakub Marecek, Andrew J. Parkes, and Hana Rudova: 00016 * Decomposition, Reformulation, and Diving in University Course Timetabling. 00017 * Computers and Operations Research. DOI 10.1016/j.cor.2009.02.023 00018 */ 00019 00020 00021 #include "saver_bound.h" 00022 00023 using namespace Udine; 00024 00025 IloCplex::Callback Udine::BoundSaver(IloEnv &env, Udine::Config &configuration, const char *tagToCreate) { 00026 return (IloCplex::Callback(new (env) Udine::BoundSaverI(env, configuration, tagToCreate))); 00027 } 00028 00029 void BoundSaverI::main() { 00030 if (fabs(getBestObjValue() - previousBest) > 0.01) { 00031 env.out() << "</cplex>" << std::endl; 00032 env.out() << "<" << tag << " value='" << getBestObjValue() << "' discovered='" << config.elapsed() << "' />"; 00033 env.out() << "<cplex>" << std::endl; 00034 previousBest = getBestObjValue(); 00035 } 00036 }
1.5.9