#ifndef GROUP_INDEX_H
#define GROUP_INDEX_H

#include <vector>
#include <valarray>

#include "specie.h"
#include <map>

class species;
class landscape;
class individual_index;

using namespace std;



/* Last revision, 22/07/15: Lots of code removed
 * Think about removing this class as only on function remains
 * This class is highly dependant on individual_index class:
 * It actually indexes individual_class for all populations for a species and key
 */
class group_index
{
    public:
        group_index(landscape &myMap, species * pSpe, string key); //Ok
        virtual ~group_index();

        // Counts number of ind in range for each pop
        vector<double> count_ind_range(double min, double max);//Ok
        // Get global min/max of indexed value 
        double get_rangeMin() { return globMin; } //Ok
        double get_rangeMax() { return globMax; } //Ok
        double get_range() { return abs(globMax - globMin);}

    protected:


    private:
        string id;
        double globMin;
        double globMax;
        //I vector<individual_index*> index;
        map<int, individual_index*> indexMap;
        int cellNumber; // number of cells on the map, even the empty ones
};

#endif // GROUP_INDEX_H

