00001 /* 00002 $Id: derandom_time.h,v 1.3 2004/12/12 23:44:44 pecos Exp $ 00003 */ 00004 00005 /* ********* 00006 * 00007 * This file is part of: 00008 * NePSing, Network Protocol Simulator next generation 00009 * 00010 * Copyright (C) 2004 Tommaso Pecorella <tpecorella@mac.com> 00011 * 00012 * This library is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU Lesser General Public 00014 * License as published by the Free Software Foundation; either 00015 * version 2.1 of the License, or (at your option) any later version. 00016 * 00017 * This library is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 * Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this library; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 * 00026 ********* */ 00027 00034 #ifndef ___DETIME_RANDOM_H___ 00035 #define ___DETIME_RANDOM_H___ 00036 00037 00038 #include <stdlib.h> 00039 #include <math.h> 00040 00041 #include "rndgen.h" 00042 #include "detime.h" 00043 00048 00049 // base classes w initializers 00050 00052 00056 class UniformDETimeRndGen 00057 { 00058 protected: 00059 DETime base; 00060 long int range; 00061 00062 public: 00063 UniformDETimeRndGen(DETime _low = time_int(0), 00064 DETime _high = time_int(1) 00065 ); 00066 DETime get(); 00067 }; 00068 00069 00071 00075 class ExponentialDETimeRndGen 00076 { 00077 protected: 00078 double mean; 00079 00080 public: 00081 ExponentialDETimeRndGen(DETime _mean = time_int(1) 00082 ); 00083 DETime get(); 00084 }; 00085 00087 00088 #endif 00089 00090 /* 00091 $Log: derandom_time.h,v $ 00092 Revision 1.3 2004/12/12 23:44:44 pecos 00093 Added Copyright message - LGPL 00094 00095 Revision 1.2 2004/12/11 23:53:25 pecos 00096 Added DoxyGen comments 00097 00098 Revision 1.1.1.1 2004/07/08 16:59:33 pecos 00099 NePSing framework 00100 00101 Revision 1.2 1999/05/28 23:54:48 pecos 00102 no message 00103 00104 Revision 1.1.1.1 1999/05/24 15:59:57 inesis 00105 INeSiS Project 00106 00107 Revision 1.1.1.1 1999/05/24 15:17:20 inesis 00108 INeSiS Project 00109 00110 Revision 1.2 1999/01/26 11:24:23 pecos 00111 *** empty log message *** 00112 00113 Revision 1.2 1998/09/29 18:56:53 nanni 00114 *** empty log message *** 00115 00116 Revision 1.1 1998/09/15 15:20:24 ronga 00117 Initial revision 00118 00119 */ 00120