00001 /******************************************************************* 00002 * File: Exponential.h 00003 * Description: 00004 * Author: Subhasis Ray 00005 * E-mail: ray.subhasis@gmail.com 00006 * Created: 2007-11-01 08:59:47 00007 ********************************************************************/ 00008 /********************************************************************** 00009 ** This program is part of 'MOOSE', the 00010 ** Messaging Object Oriented Simulation Environment, 00011 ** also known as GENESIS 3 base code. 00012 ** copyright (C) 2003-2005 Upinder S. Bhalla. and NCBS 00013 ** It is made available under the terms of the 00014 ** GNU General Public License version 2 00015 ** See the file COPYING.LIB for the full notice. 00016 **********************************************************************/ 00017 00018 #ifndef _EXPONENTIAL_H 00019 #define _EXPONENTIAL_H 00020 #include "Probability.h" 00021 enum ExponentialGenerator 00022 { 00023 LOGARITHMIC, 00024 RANDOM_MINIMIZATION 00025 }; 00026 00027 00028 class Exponential: public Probability 00029 { 00030 public: 00031 Exponential(double mean); 00032 Exponential( ExponentialGenerator generator, double mean); 00033 00034 double getMean() const; 00035 double getVariance() const; 00036 double getNextSample() const; 00037 private: 00038 double mean_; 00039 double (*generator_)(double); 00040 static double logarithmic(double mean); 00041 static double randomMinimization(double mean); 00042 00043 00044 }; 00045 00046 00047 00048 #endif