00001 #include "Headers.h"
00002 #include "ModelBandwidthUniform.h"
00003 #include "Rand.h"
00004
00005 CModelBandwidthUniform::CModelBandwidthUniform(
00006 __bitrate min,
00007 __bitrate max,
00008 __bitrate unit
00009 )
00010 {
00011 this->min = min;
00012 this->max = max;
00013 this->unit = unit;
00014 }
00015
00016 double CModelBandwidthUniform::Bandwidth(unsigned int peer)
00017 {
00018 return this->unit * ceil((CRand::Generate() * (this->max - this->min) + this->min) / this->unit);
00019 }