- Main Page
- Classes
- Files

- Search for |

# moeoDummyDiversityAssignment.h

    00001 // -*- mode: c++; c-indent-level: 4; c++-member-init-indent: 8; comment-column: 35; -*-
    00002
    00003 //-----------------------------------------------------------------------------
    00004 // moeoDummyDiversityAssignment.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 MOEODUMMYDIVERSITYASSIGNMENT_H_
    00014 #define MOEODUMMYDIVERSITYASSIGNMENT_H_
    00015
    00016 #include<diversity/moeoDiversityAssignment.h>
    00017
    00021 template < class MOEOT >
    00022 class moeoDummyDiversityAssignment : public moeoDiversityAssignment < MOEOT >
    00023 {
    00024 public:
    00025
    00027     typedef typename MOEOT::ObjectiveVector ObjectiveVector;
    00028
    00029
    00034     void operator () (eoPop < MOEOT > & _pop)
    00035     {
    00036         for (unsigned int idx = 0; idx<_pop.size (); idx++)
    00037         {
    00038             if (_pop[idx].invalidDiversity())
    00039             {
    00040                 // set the diversity to 0
    00041                 _pop[idx].diversity(0.0);
    00042             }
    00043         }
    00044     }
    00045
    00046
    00052     void updateByDeleting(eoPop < MOEOT > & _pop, ObjectiveVector & _objVec)
    00053     {
    00054         // nothing to do...  ;-)
    00055     }
    00056
    00057 };
    00058
    00059 #endif /*MOEODUMMYDIVERSITYASSIGNMENT_H_*/