/home/coin/SVN-release/Alps-1.2.2/Alps/src/Alps.h

Go to the documentation of this file.
00001 /*===========================================================================*
00002  * This file is part of the Abstract Library for Parallel Search (ALPS).     *
00003  *                                                                           *
00004  * ALPS is distributed under the Common Public License as part of the        *
00005  * COIN-OR repository (http://www.coin-or.org).                              *
00006  *                                                                           *
00007  * Authors:                                                                  *
00008  *                                                                           *
00009  *          Yan Xu, Lehigh University                                        *
00010  *          Ted Ralphs, Lehigh University                                    *
00011  *                                                                           *
00012  * Conceptual Design:                                                        *
00013  *                                                                           *
00014  *          Yan Xu, Lehigh University                                        *
00015  *          Ted Ralphs, Lehigh University                                    *
00016  *          Laszlo Ladanyi, IBM T.J. Watson Research Center                  *
00017  *          Matthew Saltzman, Clemson University                             *
00018  *                                                                           * 
00019  *                                                                           *
00020  * Copyright (C) 2001-2010, Lehigh University, Yan Xu, and Ted Ralphs.       *
00021  * All Rights Reserved.                                                      *
00022  *===========================================================================*/
00023 
00024 #ifndef Alps_h_
00025 #define Alps_h_
00026 
00027 #include <cfloat>
00028 #include <cstdio>
00029 
00030 #include "CoinFinite.hpp"
00031 
00032 //#############################################################################
00033 
00034 #if defined(__linux__)
00035 #define ALPS_MEMORY_USAGE 1
00036 #endif
00037 
00038 //#############################################################################
00040 //#############################################################################
00041 
00042 enum AlpsClockType {
00043    AlpsClockTypeCpu,
00044    AlpsClockTypeWallClock
00045 };
00046 
00047 //#############################################################################
00049 //#############################################################################
00050 
00051 enum AlpsStaticBalanceScheme {
00052     AlpsRootInit = 0,
00053     AlpsSpiral
00054 };
00055 
00056 //#############################################################################
00058 //#############################################################################
00059 
00060 enum AlpsNodeStatus {
00061     AlpsNodeStatusCandidate,
00062     AlpsNodeStatusEvaluated,
00063     AlpsNodeStatusPregnant,
00064     AlpsNodeStatusBranched,
00065     AlpsNodeStatusFathomed,
00066     AlpsNodeStatusDiscarded
00067 };
00068 
00069 //#############################################################################
00071 //#############################################################################
00072 
00073 enum AlpsSearchType {
00074     AlpsSearchTypeBestFirst = 0,
00075     AlpsSearchTypeBreadthFirst,
00076     AlpsSearchTypeDepthFirst,
00077     AlpsSearchTypeBestEstimate,
00078     AlpsSearchTypeHybrid
00079 };
00080 
00081 //#############################################################################
00083 //#############################################################################
00084 
00085 typedef int KnowledgeType;
00086 
00087 enum AlpsKnowledgeType{
00088    AlpsKnowledgeTypeModel = 0,
00089    AlpsKnowledgeTypeModelGen, 
00090    AlpsKnowledgeTypeNode,
00091    AlpsKnowledgeTypeSolution,
00092    AlpsKnowledgeTypeSubTree,
00093    AlpsKnowledgeTypeUndefined
00094 };
00095 
00096 //#############################################################################
00097 // Search return status
00098 //#############################################################################
00099 
00100 enum AlpsExitStatus {
00101     AlpsExitStatusUnknown = -1,
00102     AlpsExitStatusOptimal,
00103     AlpsExitStatusTimeLimit, 
00104     AlpsExitStatusNodeLimit,
00105     AlpsExitStatusSolLimit,
00106     AlpsExitStatusFeasible,
00107     AlpsExitStatusInfeasible,
00108     AlpsExitStatusNoMemory,
00109     AlpsExitStatusFailed,
00110     AlpsExitStatusUnbounded
00111 };
00112 
00113 //#############################################################################
00114 // Return code.
00115 //#############################################################################
00116 
00117 enum AlpsReturnStatus {
00118     AlpsReturnStatusOk = 0,
00119     AlpsReturnStatusErr,
00120     AlpsReturnStatusErrNoInt,  /* No integer variable.*/
00121     AlpsReturnStatusErrNoMem
00122 };
00123 
00124 //#############################################################################
00125 // Seach phase
00126 //#############################################################################
00127 
00128 enum AlpsPhase {
00129     AlpsPhaseRampup = 0,
00130     AlpsPhaseSearch,
00131     AlpasPhaseRampdown
00132 };
00133 
00134 #define ALPS_NODE_PROCESS_TIME  0.0123
00135 #define ALPS_NONE 0
00136 #define ALPS_NOT_SET -1
00137 
00138 //#############################################################################
00139 // Big number
00140 //#############################################################################
00141 
00142 #define ALPS_DBL_MAX          COIN_DBL_MAX
00143 #define ALPS_INC_MAX          1.0e80
00144 #define ALPS_OBJ_MAX          1.0e75
00145 #define ALPS_OBJ_MAX_LESS     1.0e70
00146 #define ALPS_BND_MAX          1.0e20
00147 #define ALPS_INFINITY         1.0e20
00148 
00149 #define ALPS_INT_MAX          COIN_INT_MAX
00150 
00151 //#############################################################################
00152 // Small number
00153 //#############################################################################
00154 
00155 #define ALPS_ZERO             1.0e-14
00156 #define ALPS_GEN_TOL          1.0e-6
00157 #define ALPS_QUALITY_TOL      1.0e-5
00158 #define ALPS_SMALL_3          1.0e-3
00159 #define ALPS_SMALL_4          1.0e-4
00160 #define ALPS_SMALL_5          1.0e-5
00161 
00162 //#############################################################################
00163 
00164 #define ALPS_PRINTF           printf
00165 
00166 #define ALPS_DMSG             printf
00167 
00168 
00169 //#############################################################################
00170 
00171 #define  ALPS_MAX( x, y )          ( ( (x) > (y) ) ? (x) : (y) )
00172 #define  ALPS_MIN( x, y )          ( ( (x) < (y) ) ? (x) : (y) )
00173 #define  ALPS_FABS(x)              ( (x < 0.0) ? -(x) : (x) )
00174 #define  ALPS_ABS(x)               ( (x < 0) ? -(x) : (x) )
00175 
00176 //#############################################################################
00177 
00178 typedef struct ALPS_PS_STATS 
00179 {
00180     int qualityBalance_;
00181     int quantityBalance_;
00182     int interBalance_;
00183     int intraBalance_;
00184     int workerAsk_;
00185     int donateSuccess_;
00186     int donateFail_;
00187     int subtreeSplit_;
00188     int subtreeWhole_;
00189     int subtreeChange_;
00190 } AlpsPsStats;
00191     
00192 //#############################################################################
00193 
00194 
00195 #endif

Generated on Fri Jan 7 03:09:08 2011 by  doxygen 1.4.7