- Main Page
- Classes
- Files

- Search for |

# moeoObjectiveVector.h

    00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
    00002
    00003 //-----------------------------------------------------------------------------
    00004 // moeoObjectiveVector.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 MOEOOBJECTIVEVECTOR_H_
    00014 #define MOEOOBJECTIVEVECTOR_H_
    00015
    00016 #include <vector>
    00017
    00024 template < class ObjectiveVectorTraits, class ObjectiveVectorType >
    00025 class moeoObjectiveVector : public std::vector < ObjectiveVectorType >
    00026 {
    00027 public:
    00028
    00030     typedef ObjectiveVectorTraits Traits;
    00032     typedef ObjectiveVectorType Type;
    00033
    00034
    00038     moeoObjectiveVector(Type _value = Type()) : std::vector < Type > (ObjectiveVectorTraits::nObjectives(), _value)
    00039     {}
    00040
    00041
    00046     moeoObjectiveVector(std::vector < Type > & _v) : std::vector < Type > (_v)
    00047     {}
    00048
    00049
    00055     static void setup(unsigned int _nObjectives, std::vector < bool > & _bObjectives)
    00056     {
    00057         ObjectiveVectorTraits::setup(_nObjectives, _bObjectives);
    00058     }
    00059
    00060
    00064     static unsigned int nObjectives()
    00065     {
    00066         return ObjectiveVectorTraits::nObjectives();
    00067     }
    00068
    00069
    00074     static bool minimizing(unsigned int _i)
    00075     {
    00076         return ObjectiveVectorTraits::minimizing(_i);
    00077     }
    00078
    00079
    00084     static bool maximizing(unsigned int _i)
    00085     {
    00086         return ObjectiveVectorTraits::maximizing(_i);
    00087     }
    00088
    00089 };
    00090
    00091 #endif /*MOEOOBJECTIVEVECTOR_H_*/