Generated on Tue May 22 09:40:12 2018 for Gecode by doxygen 1.6.3

dfs.hh

Go to the documentation of this file.
00001 /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
00002 /*
00003  *  Main authors:
00004  *     Christian Schulte <schulte@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Christian Schulte, 2009
00008  *
00009  *  This file is part of Gecode, the generic constraint
00010  *  development environment:
00011  *     http://www.gecode.org
00012  *
00013  *  Permission is hereby granted, free of charge, to any person obtaining
00014  *  a copy of this software and associated documentation files (the
00015  *  "Software"), to deal in the Software without restriction, including
00016  *  without limitation the rights to use, copy, modify, merge, publish,
00017  *  distribute, sublicense, and/or sell copies of the Software, and to
00018  *  permit persons to whom the Software is furnished to do so, subject to
00019  *  the following conditions:
00020  *
00021  *  The above copyright notice and this permission notice shall be
00022  *  included in all copies or substantial portions of the Software.
00023  *
00024  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00025  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00026  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00027  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
00028  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
00029  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00030  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00031  *
00032  */
00033 
00034 #ifndef __GECODE_SEARCH_PAR_DFS_HH__
00035 #define __GECODE_SEARCH_PAR_DFS_HH__
00036 
00037 #include <gecode/search/par/engine.hh>
00038 
00039 namespace Gecode { namespace Search { namespace Par {
00040 
00042   template<class Tracer>
00043   class DFS : public Engine<Tracer> {
00044   protected:
00045     using Engine<Tracer>::idle;
00046     using Engine<Tracer>::busy;
00047     using Engine<Tracer>::stop;
00048     using Engine<Tracer>::block;
00049     using Engine<Tracer>::e_search;
00050     using Engine<Tracer>::e_reset_ack_start;
00051     using Engine<Tracer>::e_reset_ack_stop;
00052     using Engine<Tracer>::n_busy;
00053     using Engine<Tracer>::m_search;
00054     using Engine<Tracer>::m_wait_reset;
00055     using Engine<Tracer>::opt;
00056     using Engine<Tracer>::release;
00057     using Engine<Tracer>::signal;
00058     using Engine<Tracer>::solutions;
00059     using Engine<Tracer>::terminate;
00060     using Engine<Tracer>::workers;
00061     using Engine<Tracer>::C_WAIT;
00062     using Engine<Tracer>::C_RESET;
00063     using Engine<Tracer>::C_TERMINATE;
00064     using Engine<Tracer>::C_WORK;
00066     class Worker : public Engine<Tracer>::Worker {
00067     public:
00068       using Engine<Tracer>::Worker::_engine;
00069       using Engine<Tracer>::Worker::m;
00070       using Engine<Tracer>::Worker::path;
00071       using Engine<Tracer>::Worker::cur;
00072       using Engine<Tracer>::Worker::d;
00073       using Engine<Tracer>::Worker::idle;
00074       using Engine<Tracer>::Worker::node;
00075       using Engine<Tracer>::Worker::fail;
00076       using Engine<Tracer>::Worker::start;
00077       using Engine<Tracer>::Worker::tracer;
00078       using Engine<Tracer>::Worker::stop;
00080       Worker(Space* s, DFS& e);
00082       DFS& engine(void) const;
00084       virtual void run(void);
00086       void find(void);
00088       void reset(Space* s, unsigned int ngdl);
00089     };
00091     Worker** _worker;
00092   public:
00094     Worker* worker(unsigned int i) const;
00095 
00097 
00098 
00099     void solution(Space* s);
00101 
00103 
00104 
00105     DFS(Space* s, const Options& o);
00107     virtual Statistics statistics(void) const;
00109     virtual void reset(Space* s);
00111     virtual NoGoods& nogoods(void);
00113     virtual ~DFS(void);
00115   };
00116 
00117 }}}
00118 
00119 #include <gecode/search/par/dfs.hpp>
00120 
00121 #endif
00122 
00123 // STATISTICS: search-par