include/plaws/NonZeroPoissonLaw.hpp

Go to the documentation of this file.
00001 // NonZeroPoissonLaw.hpp: this file is part of the REGAL project.
00002 //
00003 // REGAL : Random and Exhaustive Generators for Automata - Library
00004 //
00005 // Copyright (C) 2007 Julien DAVID.
00006 //
00007 // This program is free software; you can redistribute it and/or
00008 // modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 2
00010 // of the License, or (at your option) any later version.
00011 //
00012 // The complete GNU General Public Licence Notice can be found as the
00013 // `COPYING' file in the root directory.
00014 //
00015 //
00016 #ifndef NONZEROPOISSONLAW
00017 #define NONZEROPOISSONLAW
00018 
00019 #include"DiscreteProbabilityLaw.hpp"
00020 
00021 namespace regal{
00022 
00023   namespace plaws{
00024     
00025     class NonZeroPoissonLaw: public DiscreteProbabilityLaw{
00026     private:
00027       
00028       void updateProbability(const int & k){
00029         this->p=this->x*this->p/k;
00030       }
00031       
00032       double initProbability(){
00033         return this->x/(expl(this->x)-1);
00034       }
00035       
00036       int initCounter(){return 1;}
00037       
00038       
00039     public:
00040       
00045       NonZeroPoissonLaw(const double & lambda):DiscreteProbabilityLaw::DiscreteProbabilityLaw(lambda){      
00046       }
00047       
00051       ~NonZeroPoissonLaw(){
00052         verbose("Destruction of a Poisson Law");
00053       }
00054     };
00055     
00056   }
00057   
00058 }
00059 
00060 #endif
00061   

Generated on Mon Sep 29 16:33:58 2008 for REGAL by  doxygen 1.5.1