00001
00002
00003
00004
00005
00006
00007
00008
00009
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