include/plaws/BernouilliLaw.hpp

Go to the documentation of this file.
00001 // BernouilliLaw.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 BERNOUILLILAW
00017 #define BERNOUILLILAW
00018 
00019 
00020 #include"DiscreteProbabilityLaw.hpp"
00021 
00022 namespace regal{
00023   
00024   namespace plaws{
00025     
00026     class BernouilliLaw: public DiscreteProbabilityLaw{
00027       
00028     private:
00029       int * probabilityTab;
00030       
00031       virtual void updateProbability(const int & k){
00032         this->p=probabilityTab[k];
00033       }
00034       
00035       virtual double initProbability(){
00036         return probability[0];;
00037       }
00038       
00039     public:
00040       
00041       
00046       BernouilliLaw(const int * tab):DiscreteProbabilityLaw::DiscreteProbabilityLaw(0.){
00047         probabilityTab=tab;
00048       }
00049       
00053       ~BernouilliLaw(){
00054         verbose("Destruction of a Bernouilli Law");
00055       }
00056     };
00057     
00058   }
00059 
00060 }
00061   
00062 #endif
00063   

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