00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef EORANDOMREALWEIGHTUP_H
00012 #define EORANDOMREALWEIGHTUP_H
00013
00014
00015 #include <eoWeightUpdater.h>
00016 #include <utils/eoRNG.h>
00017
00018
00022 class eoRandomRealWeightUp:public eoWeightUpdater<double>
00023 {
00024 public:
00025
00031 eoRandomRealWeightUp(
00032 double _min,
00033 double _max
00034 ):min(_min),max(_max)
00035 {
00036
00037 if (min > max)
00038 {
00039 std::string s;
00040 s.append (" min > max in eoRandomRealWeightUp");
00041 throw std::runtime_error (s);
00042 }
00043 }
00044
00049 void operator() (double & _weight)
00050 {
00051 _weight=rng.uniform(max-min)+min;
00052 }
00053
00054
00055 protected:
00056 double min,max;
00057
00058 };
00059
00060
00061
00062 #endif