41 for(predictmap::const_iterator it = _predictmap.begin(); it != _predictmap.end(); ++it)
44 const std::string eid = it->first.getString();
49 const float& f = it->second;
51 ss << f << std::flush;
62 for(predictmap::const_iterator it = _predictmap.begin(); it != _predictmap.end(); ++it)
64 const std::string eid = it->first.getString();
67 const float& f = it->second;
70 ss << f << std::flush;
86 while(elements_read < map_size)
93 std::vector<char> eid_cstr(eid_len.get<
size_t>());
96 stream.read(&eid_cstr[0], eid_cstr.size());
110 std::vector<char> f_cstr(float_len.get<
size_t>());
113 stream.read(&f_cstr[0], f_cstr.size());
116 std::stringstream ss(std::string(f_cstr.begin(), f_cstr.end()));
128 _predictmap[eid] = f;
140 predictmap::const_iterator it;
141 if ((it = _predictmap.find(neighbor)) != _predictmap.end())
151 _predictmap[neighbor] = value;
166 p_ab = p_encounter_first;
172 for (predictmap::const_iterator it = dpm._predictmap.begin(); it != dpm._predictmap.end(); ++it)
175 const float &p_bc = it->second;
178 if (host_b.
sameHost(host_c))
continue;
183 predictmap::iterator dp_it;
184 if ((dp_it = _predictmap.find(host_c)) != _predictmap.end()) {
185 dp_it->second = max(dp_it->second, p_ab * p_bc * _beta);
187 _predictmap[host_c] = p_ab * p_bc * _beta;
197 if (current_time <= _lastAgingTime)
return;
201 predictmap::iterator it;
202 for(it = _predictmap.begin(); it != _predictmap.end();)
210 it->second *= pow(_gamma, k.
get<
int>());
212 if(it->second < p_first_threshold)
214 _predictmap.erase(it++);
220 _lastAgingTime = current_time;
225 predictmap::const_iterator it;
226 for (it = _predictmap.begin(); it != _predictmap.end(); ++it)
228 stream << it->first.getString() <<
": " << it->second << std::endl;