#ifndef __GLOBALSTATISTICS_H_
#define __GLOBALSTATISTICS_H_

#include <boost/dynamic_bitset.hpp>

class GlobalStatistics {
  private:
    static GlobalStatistics *instance;

    GlobalStatistics();
    ~GlobalStatistics();

    int myP;
    boost::dynamic_bitset<> stoppedDemes;
    unsigned int *numConvergedAlleles, totalNumConvergedAlleles;
    unsigned int *numGenerations, totalNumGenerations;
    unsigned int *numEpochs, totalNumEpochs;

  public:
    static GlobalStatistics * getInstance();
    static void deleteInstance();

    bool isDemeStopped( int rank ) const;
    void setDemeStopped( int rank, bool value = true );
    unsigned int getNumStoppedDemes() const;

    unsigned int getNumConvergedAlleles( int rank ) const;
    void setNumConvergedAlleles( int rank, unsigned int value );
    unsigned int getTotalNumConvergedAlleles() const;

    unsigned int getNumGenerations( int rank ) const;
    void setNumGenerations( int rank, unsigned int value );
    unsigned int getTotalNumGenerations() const;

    unsigned int getNumEpochs( int rank ) const;
    void setNumEpochs( int rank, unsigned int value );
    unsigned int getTotalNumEpochs() const;
};

#endif /* __GLOBALSTATISTICS_H_ */
