diff --git a/tags/paradiseo-ix86-1.0/paradiseo-moeo/doc/html/MOEO_8h-source.html b/tags/paradiseo-ix86-1.0/paradiseo-moeo/doc/html/MOEO_8h-source.html index bf80259c1..2dc0f18c5 100644 --- a/tags/paradiseo-ix86-1.0/paradiseo-moeo/doc/html/MOEO_8h-source.html +++ b/tags/paradiseo-ix86-1.0/paradiseo-moeo/doc/html/MOEO_8h-source.html @@ -21,209 +21,232 @@ -
00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*- -00002 -00003 //----------------------------------------------------------------------------- -00004 // MOEO.h -00005 // (c) OPAC Team (LIFL), Dolphin Project (INRIA), 2007 -00006 /* -00007 This library... -00008 -00009 Contact: paradiseo-help@lists.gforge.inria.fr, http://paradiseo.gforge.inria.fr -00010 */ -00011 //----------------------------------------------------------------------------- -00012 -00013 #ifndef MOEO_H_ -00014 #define MOEO_H_ -00015 -00016 #include <iostream> -00017 #include <stdexcept> -00018 #include <string> -00019 #include <EO.h> -00020 -00033 template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity > -00034 class MOEO : public EO < MOEOObjectiveVector > -00035 { -00036 public: -00037 -00039 typedef MOEOObjectiveVector ObjectiveVector; -00040 -00042 typedef MOEOFitness Fitness; +MOEO.h
00001 /* <MOEO.h> +00002 * +00003 * Copyright (C) DOLPHIN Project-Team, INRIA Futurs, 2006-2007 +00004 * (C) OPAC Team, LIFL, 2002-2007 +00005 * +00006 * Arnaud Liefooghe +00007 * +00008 * This software is governed by the CeCILL license under French law and +00009 * abiding by the rules of distribution of free software. You can use, +00010 * modify and/ or redistribute the software under the terms of the CeCILL +00011 * license as circulated by CEA, CNRS and INRIA at the following URL +00012 * "http://www.cecill.info". +00013 * +00014 * As a counterpart to the access to the source code and rights to copy, +00015 * modify and redistribute granted by the license, users are provided only +00016 * with a limited warranty and the software's author, the holder of the +00017 * economic rights, and the successive licensors have only limited liability. +00018 * +00019 * In this respect, the user's attention is drawn to the risks associated +00020 * with loading, using, modifying and/or developing or reproducing the +00021 * software by the user in light of its specific status of free software, +00022 * that may mean that it is complicated to manipulate, and that also +00023 * therefore means that it is reserved for developers and experienced +00024 * professionals having in-depth computer knowledge. Users are therefore +00025 * encouraged to load and test the software's suitability as regards their +00026 * requirements in conditions enabling the security of their systems and/or +00027 * data to be ensured and, more generally, to use and operate it in the +00028 * same conditions as regards security. +00029 * The fact that you are presently reading this means that you have had +00030 * knowledge of the CeCILL license and that you accept its terms. +00031 * +00032 * ParadisEO WebSite : http://paradiseo.gforge.inria.fr +00033 * Contact: paradiseo-help@lists.gforge.inria.fr +00034 */ +00035 +00036 #ifndef MOEO_H_ +00037 #define MOEO_H_ +00038 +00039 #include <iostream> +00040 #include <stdexcept> +00041 #include <string> +00042 #include <EO.h> 00043 -00045 typedef MOEODiversity Diversity; -00046 -00047 -00051 MOEO() -00052 { -00053 // default values for every parameters -00054 objectiveVectorValue = ObjectiveVector(); -00055 fitnessValue = Fitness(); -00056 diversityValue = Diversity(); -00057 // invalidate all -00058 invalidate(); -00059 } +00056 template < class MOEOObjectiveVector, class MOEOFitness, class MOEODiversity > +00057 class MOEO : public EO < MOEOObjectiveVector > +00058 { +00059 public: 00060 -00061 -00065 virtual ~MOEO() {}; +00062 typedef MOEOObjectiveVector ObjectiveVector; +00063 +00065 typedef MOEOFitness Fitness; 00066 -00067 -00071 ObjectiveVector objectiveVector() const -00072 { -00073 if ( invalidObjectiveVector() ) -00074 { -00075 throw std::runtime_error("invalid objective vector in MOEO"); -00076 } -00077 return objectiveVectorValue; -00078 } -00079 -00080 -00085 void objectiveVector(const ObjectiveVector & _objectiveVectorValue) -00086 { -00087 objectiveVectorValue = _objectiveVectorValue; -00088 invalidObjectiveVectorValue = false; -00089 } +00068 typedef MOEODiversity Diversity; +00069 +00070 +00074 MOEO() +00075 { +00076 // default values for every parameters +00077 objectiveVectorValue = ObjectiveVector(); +00078 fitnessValue = Fitness(); +00079 diversityValue = Diversity(); +00080 // invalidate all +00081 invalidate(); +00082 } +00083 +00084 +00088 virtual ~MOEO() {}; +00089 00090 -00091 -00095 void invalidateObjectiveVector() -00096 { -00097 invalidObjectiveVectorValue = true; -00098 } -00099 -00100 -00104 bool invalidObjectiveVector() const -00105 { -00106 return invalidObjectiveVectorValue; -00107 } -00108 -00109 -00113 Fitness fitness() const -00114 { -00115 if ( invalidFitness() ) -00116 { -00117 throw std::runtime_error("invalid fitness in MOEO"); -00118 } -00119 return fitnessValue; -00120 } -00121 +00094 ObjectiveVector objectiveVector() const +00095 { +00096 if ( invalidObjectiveVector() ) +00097 { +00098 throw std::runtime_error("invalid objective vector in MOEO"); +00099 } +00100 return objectiveVectorValue; +00101 } +00102 +00103 +00108 void objectiveVector(const ObjectiveVector & _objectiveVectorValue) +00109 { +00110 objectiveVectorValue = _objectiveVectorValue; +00111 invalidObjectiveVectorValue = false; +00112 } +00113 +00114 +00118 void invalidateObjectiveVector() +00119 { +00120 invalidObjectiveVectorValue = true; +00121 } 00122 -00127 void fitness(const Fitness & _fitnessValue) -00128 { -00129 fitnessValue = _fitnessValue; -00130 invalidFitnessValue = false; -00131 } +00123 +00127 bool invalidObjectiveVector() const +00128 { +00129 return invalidObjectiveVectorValue; +00130 } +00131 00132 -00133 -00137 void invalidateFitness() -00138 { -00139 invalidFitnessValue = true; -00140 } -00141 -00142 -00146 bool invalidFitness() const -00147 { -00148 return invalidFitnessValue; -00149 } -00150 -00151 -00155 Diversity diversity() const -00156 { -00157 if ( invalidDiversity() ) -00158 { -00159 throw std::runtime_error("invalid diversity in MOEO"); -00160 } -00161 return diversityValue; -00162 } -00163 +00136 Fitness fitness() const +00137 { +00138 if ( invalidFitness() ) +00139 { +00140 throw std::runtime_error("invalid fitness in MOEO"); +00141 } +00142 return fitnessValue; +00143 } +00144 +00145 +00150 void fitness(const Fitness & _fitnessValue) +00151 { +00152 fitnessValue = _fitnessValue; +00153 invalidFitnessValue = false; +00154 } +00155 +00156 +00160 void invalidateFitness() +00161 { +00162 invalidFitnessValue = true; +00163 } 00164 -00169 void diversity(const Diversity & _diversityValue) -00170 { -00171 diversityValue = _diversityValue; -00172 invalidDiversityValue = false; -00173 } +00165 +00169 bool invalidFitness() const +00170 { +00171 return invalidFitnessValue; +00172 } +00173 00174 -00175 -00179 void invalidateDiversity() -00180 { -00181 invalidDiversityValue = true; -00182 } -00183 -00184 -00188 bool invalidDiversity() const -00189 { -00190 return invalidDiversityValue; -00191 } -00192 -00193 -00197 void invalidate() -00198 { -00199 invalidateObjectiveVector(); -00200 invalidateFitness(); -00201 invalidateDiversity(); -00202 } -00203 -00204 -00208 bool invalid() const -00209 { -00210 return invalidObjectiveVector(); -00211 } -00212 -00213 -00220 bool operator<(const MOEO & _other) const -00221 { -00222 return objectiveVector() < _other.objectiveVector(); -00223 } -00224 -00225 -00229 virtual std::string className() const -00230 { -00231 return "MOEO"; -00232 } -00233 -00234 -00239 virtual void printOn(std::ostream & _os) const -00240 { -00241 if ( invalidObjectiveVector() ) -00242 { -00243 _os << "INVALID\t"; -00244 } -00245 else -00246 { -00247 _os << objectiveVectorValue << '\t'; -00248 } -00249 } -00250 -00251 -00256 virtual void readFrom(std::istream & _is) -00257 { -00258 std::string objectiveVector_str; -00259 int pos = _is.tellg(); -00260 _is >> objectiveVector_str; -00261 if (objectiveVector_str == "INVALID") -00262 { -00263 invalidateObjectiveVector(); -00264 } -00265 else -00266 { -00267 invalidObjectiveVectorValue = false; -00268 _is.seekg(pos); // rewind -00269 _is >> objectiveVectorValue; -00270 } -00271 } -00272 +00178 Diversity diversity() const +00179 { +00180 if ( invalidDiversity() ) +00181 { +00182 throw std::runtime_error("invalid diversity in MOEO"); +00183 } +00184 return diversityValue; +00185 } +00186 +00187 +00192 void diversity(const Diversity & _diversityValue) +00193 { +00194 diversityValue = _diversityValue; +00195 invalidDiversityValue = false; +00196 } +00197 +00198 +00202 void invalidateDiversity() +00203 { +00204 invalidDiversityValue = true; +00205 } +00206 +00207 +00211 bool invalidDiversity() const +00212 { +00213 return invalidDiversityValue; +00214 } +00215 +00216 +00220 void invalidate() +00221 { +00222 invalidateObjectiveVector(); +00223 invalidateFitness(); +00224 invalidateDiversity(); +00225 } +00226 +00227 +00231 bool invalid() const +00232 { +00233 return invalidObjectiveVector(); +00234 } +00235 +00236 +00243 bool operator<(const MOEO & _other) const +00244 { +00245 return objectiveVector() < _other.objectiveVector(); +00246 } +00247 +00248 +00252 virtual std::string className() const +00253 { +00254 return "MOEO"; +00255 } +00256 +00257 +00262 virtual void printOn(std::ostream & _os) const +00263 { +00264 if ( invalidObjectiveVector() ) +00265 { +00266 _os << "INVALID\t"; +00267 } +00268 else +00269 { +00270 _os << objectiveVectorValue << '\t'; +00271 } +00272 } 00273 -00274 private: -00275 -00277 ObjectiveVector objectiveVectorValue; -00279 bool invalidObjectiveVectorValue; -00281 Fitness fitnessValue; -00283 bool invalidFitnessValue; -00285 Diversity diversityValue; -00287 bool invalidDiversityValue; -00288 -00289 }; -00290 -00291 #endif /*MOEO_H_*/ -
Generated on Fri Jul 6 09:41:04 2007 for ParadisEO-MOEO by +00274 +00279 virtual void readFrom(std::istream & _is) +00280 { +00281 std::string objectiveVector_str; +00282 int pos = _is.tellg(); +00283 _is >> objectiveVector_str; +00284 if (objectiveVector_str == "INVALID") +00285 { +00286 invalidateObjectiveVector(); +00287 } +00288 else +00289 { +00290 invalidObjectiveVectorValue = false; +00291 _is.seekg(pos); // rewind +00292 _is >> objectiveVectorValue; +00293 } +00294 } +00295 +00296 +00297 private: +00298 +00300 ObjectiveVector objectiveVectorValue; +00302 bool invalidObjectiveVectorValue; +00304 Fitness fitnessValue; +00306 bool invalidFitnessValue; +00308 Diversity diversityValue; +00310 bool invalidDiversityValue; +00311 +00312 }; +00313 +00314 #endif /*MOEO_H_*/ +
1.4.7