this repo has no description
at develop 3.1 kB view raw
1/**** , [ qsolverunblockable.hh ], 2Copyright (c) 2008 Universite d'Orleans - Jeremie Vautard 3 4Permission is hereby granted, free of charge, to any person obtaining a copy 5of this software and associated documentation files (the "Software"), to deal 6in the Software without restriction, including without limitation the rights 7to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8copies of the Software, and to permit persons to whom the Software is 9furnished to do so, subject to the following conditions: 10 11The above copyright notice and this permission notice shall be included in 12all copies or substantial portions of the Software. 13 14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20THE SOFTWARE. 21 *************************************************************************/ 22#ifndef __QECODE_QSOLVER_TRICK__ 23#define __QECODE_QSOLVER_TRICK__ 24 25#include "QCSPPlusUnblockable.hh" 26#include "QCOPPlus.hh" 27#include <iostream> 28#include <cstdlib> 29#include "gecode/minimodel.hh" 30#include "gecode/search.hh" 31#include "Strategy.hh" 32#include "qecode.hh" 33 34using namespace Gecode; 35 36/** Unblockable QCSP+ Solver. 37* This class is the search engine for unblockable QCSP+ defined with the qpecial QcspUnblockable class. 38*/ 39class QECODE_VTABLE_EXPORT QSolverUnblockable { 40 41private: 42 int n; 43 QcspUnblockable* sp; 44 int* nbRanges; 45 Strategy rSolve(QcspUnblockable* qs,int scope,vector<int> assignments,unsigned long int& nodes); 46 47public: 48 /** Public constructor. 49 @param sp The problem to solve 50 */ 51 QECODE_EXPORT QSolverUnblockable(QcspUnblockable* sp); 52 53 /** Solves the problem and returns a corresponding winning strategy. 54 @param nodes A reference that is increased by the number of nodes encountered in the search tree. 55 */ 56 QECODE_EXPORT Strategy solve(unsigned long int& nodes); 57}; 58 59 60/** Unblockable QCSP+ Solver. 61* This class is the search engine for unblockable QCSP+ defined with the general Qcop class. 62*/ 63class QECODE_VTABLE_EXPORT QSolverUnblockable2 { 64 65private: 66 int n; 67 Qcop* sp; 68 int* nbRanges; 69 Strategy rSolve(Qcop* qs,int scope,vector<int> assignments,unsigned long int& nodes); 70 71public: 72 /** Public constructor. 73 @param sp The problem to solve 74 */ 75 QECODE_EXPORT QSolverUnblockable2(Qcop* sp); 76 77 /** Solves the problem and returns a corresponding winning strategy. 78 WARNING : Defined optimization conditions and aggregates are NOT taken into account. 79 @param nodes A reference that is increased by the number of nodes encountered in the search tree. 80 */ 81 QECODE_EXPORT Strategy solve(unsigned long int& nodes); 82}; 83 84#endif