Main Page | Class Hierarchy | Class List | File List | Class Members

Solve.h

00001 // Solve.h -- Various ugly global things used to solve problems w/ all algs.
00002 
00003 /*
00004  * Copyright (C) 1998,2004-2005 Tudor Hulubei <tudor@hulubei.net>.
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as
00008  * published by the Free Software Foundation; either version 2, or (at
00009  * your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA,
00019  * 02111-1307, USA.
00020  */
00021 
00022 // $Id: Solve_8h-source.html,v 1.1 2005/05/25 12:37:18 tudor Exp $
00023 
00024 #ifndef _CSP_EXAMPLES_Solve_H
00025 #define _CSP_EXAMPLES_Solve_H
00026 
00027 
00028 #ifndef __cplusplus
00029 #error Must use C++ for Solve.h.
00030 #endif
00031 
00032 
00033 #include <vector>
00034 #include <string>
00035 
00036 
00037 std::wostream& printBackdoor(
00038     std::wostream& wos,
00039     const csp::Decomposition& decomposition);
00040 std::wostream& printBranchingAssignments(
00041     std::wostream& wos,
00042     const csp::Decomposition& decomposition);
00043 std::wostream& printLastPathSelections(
00044     std::wostream& wos,
00045     const csp::Decomposition& decomposition);
00046 std::wostream& printSolutionHeuristicMistakes(
00047     std::wostream& wos,
00048     const csp::Decomposition& decomposition);
00049 std::wostream& printNodes(
00050     std::wostream& wos,
00051     const csp::Decomposition& decomposition);
00052 std::wostream& printLeaves(
00053     std::wostream& wos,
00054     const csp::Decomposition& decomposition);
00055 std::wostream& printBacktracks(
00056     std::wostream& wos,
00057     const csp::Decomposition& decomposition);
00058 
00059 bool registerProblemSpecificHeuristics(
00060     csp::Decomposition& decomposition,
00061     const std::wstring& name,
00062     const std::vector<std::pair<double, double> >& intervals,
00063     double quality);
00064 
00065 csp::Problem* clone(const csp::Problem& problem);
00066 
00067 void solubleProblemFFA(const csp::Decomposition& decomposition);
00068 void insolubleProblemFFA(const csp::Decomposition& decomposition);
00069 
00070 bool problemIsWorthFFAing(bool hasSolutions);
00071 
00072 typedef bool (*callback_type)(
00073     csp::Decomposition& decomposition,
00074     bool& countResources);
00075 
00076 bool genericSolutionCallback(
00077     csp::Decomposition& decomposition,
00078     bool& countResources);
00079 
00080 csp::Retraction* createRetraction(
00081     csp::Problem& problem,
00082     CommonOptions& options);
00083 
00084 csp::Filter* createFilter(
00085     csp::Problem& problem,
00086     csp::Retraction& retraction,
00087     CommonOptions& options);
00088 
00089 csp::Decomposition* createDecomposition(
00090     csp::Problem& problem,
00091     csp::Retraction& retraction,
00092     csp::Filter& filter,
00093     CommonOptions& options,
00094     int index = 0);
00095 
00096 ulonglong regularSolver(
00097     CommonOptions& options,
00098     bool verbose,
00099     csp::Problem& problem,
00100     bool& timeLimitExceeded,
00101     bool& nodeLimitExceeded,
00102     callback_type solutionCallback = genericSolutionCallback,
00103     callback_type evaluationCallback = 0,
00104     callback_type refutationCallback = 0);
00105 
00106 ulonglong driverSolver(
00107     CommonOptions& options,
00108     bool verbose,
00109     csp::Problem& problem,
00110     bool& timeLimitExceeded,
00111     bool& nodeLimitExceeded,
00112     callback_type solutionCallback = genericSolutionCallback);
00113 
00114 
00115 #endif // _CSP_EXAMPLES_Solve_H
00116 
00117 // Local Variables:
00118 // mode: C++
00119 // End:

Generated on Wed May 25 12:21:15 2005 for csp.kdevelop by  doxygen 1.3.9.1