Generated on Thu Jul 6 07:06:49 2006 for Gecode by doxygen 1.4.7

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: 2005-08-10 20:28:01 +0200 (Wed, 10 Aug 2005) $ by $Author: schulte $
00010  *     $Revision: 2202 $
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    * Base class
00028    *
00029    */
00030   Stop::~Stop(void) {}
00031 
00032 
00033   /*
00034    * Stopping for memory limit
00035    *
00036    */
00037   bool
00038   MemoryStop::stop(const Statistics& s) {
00039     return s.memory > l;
00040   }
00041 
00042   
00043   /*
00044    * Stopping for memory limit
00045    *
00046    */
00047   bool
00048   FailStop::stop(const Statistics& s) {
00049     return s.fail > l;
00050   }
00051 
00052   
00053   /*
00054    * Stopping for memory limit
00055    *
00056    */
00057   bool
00058   TimeStop::stop(const Statistics&) {
00059     return static_cast<unsigned long int>
00060       ((static_cast<double>(clock()-s)/CLOCKS_PER_SEC) * 1000.0) > l; 
00061   }
00062 
00063 }}
00064 
00065 // STATISTICS: search-any