#ifndef __RANDOM_H_
#define __RANDOM_H_

#include "Parameters.h"
#include <boost/noncopyable.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>

class Random : boost::noncopyable {
  protected:
    Random();
    virtual ~Random();

    static Random *instance;
    template<typename ReturnType>
    static ReturnType getSeed() {
      boost::posix_time::ptime timer( boost::posix_time::microsec_clock::local_time() );

      const ReturnType prime = static_cast<ReturnType>( 1607u );
      const ReturnType time = static_cast<ReturnType>( timer.time_of_day().fractional_seconds() );
      const ReturnType rank = static_cast<ReturnType>( 1 + Parameters::getInstance()->getRank() );
      return ( time + ( prime*rank ) );
    }

  public:
    static Random * getInstance();
    static void deleteInstance();
    virtual bool getBit() = 0;
    virtual FloatType get01() = 0;
    virtual FloatType getFloat( FloatType from, FloatType to ) = 0;
    virtual int getInt( int from, int to ) = 0;
};

#endif /* __RANDOM_H_ */
