Generated on Wed Nov 1 15:04:43 2006 for Gecode by doxygen 1.4.5

stop.cc

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Christian Schulte <schulte@gecode.org>
00004  *
00005  *  Copyright:
00006  *     Christian Schulte, 2006
00007  *
00008  *  Last modified:
00009  *     $Date: 2006-08-04 16:03:17 +0200 (Fri, 04 Aug 2006) $ by $Author: schulte $
00010  *     $Revision: 3511 $
00011  *
00012  *  This file is part of Gecode, the generic constraint
00013  *  development environment:
00014  *     http://www.gecode.org
00015  *
00016  *  See the file "LICENSE" for information on usage and
00017  *  redistribution of this file, and for a
00018  *     DISCLAIMER OF ALL WARRANTIES.
00019  *
00020  */
00021 
00022 #include "gecode/search.hh"
00023 
00024 namespace Gecode { namespace Search {
00025 
00026   /*
00027    * Stopping for memory limit
00028    *
00029    */
00030   bool
00031   MemoryStop::stop(const Statistics& s) {
00032     return s.memory > l;
00033   }
00034 
00035 
00036   /*
00037    * Stopping for memory limit
00038    *
00039    */
00040   bool
00041   FailStop::stop(const Statistics& s) {
00042     return s.fail > l;
00043   }
00044 
00045 
00046   /*
00047    * Stopping for memory limit
00048    *
00049    */
00050   bool
00051   TimeStop::stop(const Statistics&) {
00052     return static_cast<unsigned long int>
00053       ((static_cast<double>(clock()-s)/CLOCKS_PER_SEC) * 1000.0) > l;
00054   }
00055 
00056 }}
00057 
00058 // STATISTICS: search-any