32 std::vector<std::string> hotspotvec = cStringTokenizer(coordinator->par(
"Hotspots"),
";").asVector();
33 for( std::vector<std::string>::iterator it = hotspotvec.begin(); it != hotspotvec.end(); ++it ){
34 std::vector<std::string> hstr = cStringTokenizer(it->c_str(),
",").asVector();
35 if( hstr.size() != 4 ) {
36 throw( cException(
"Error parsing Hotspots parameter") );
40 h.
center.
x = convertString<double>( hstr[0] );
41 h.
center.
y = convertString<double>( hstr[1] );
42 h.
radius = convertString<double>( hstr[2] );
50 throw( cException(
"Error: Hotspot is outside the playground!") );
53 throw( cException(
"Error: Hotspot probabilities add up to > 1!") );
59 if( (
double) coordinator->par(
"HotspotStayTime") == (double) 0.0 ) {
64 target.
x = uniform(0.0, areaDimension);
65 target.
y = uniform(0.0, areaDimension);
71 for( std::vector<Hotspot>::iterator it =
hotspots.begin(); it !=
hotspots.end(); ++it) {
73 if( dist < minDist ) minDist = dist;
99 double rnd = uniform(0, 1);
102 if( rnd <= 0 )
break;
117 double r = uniform( 0, 1 );
118 double theta = uniform( 0, 2*M_PI );
119 dev.
x = sqrt( r ) * cos( theta );
120 dev.
y = sqrt( r ) * sin( theta );