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;
161 float neighbor_dp = p_encounter_first;
164 neighbor_dp = this->
get(origin);
170 for (predictmap::const_iterator it = dpm._predictmap.begin(); it != dpm._predictmap.end(); ++it)
176 predictmap::iterator dp_it;
177 if((dp_it = _predictmap.find(it->first)) != _predictmap.end())
180 dp = max(dp, neighbor_dp * it->second * _beta);
182 if(dp_it != _predictmap.end())
185 _predictmap[it->first] = dp;
195 if (current_time <= _lastAgingTime)
return;
199 predictmap::iterator it;
200 for(it = _predictmap.begin(); it != _predictmap.end();)
208 it->second *= pow(_gamma, k.
get<
int>());
210 if(it->second < p_first_threshold)
212 _predictmap.erase(it++);
218 _lastAgingTime = current_time;
223 predictmap::const_iterator it;
224 for (it = _predictmap.begin(); it != _predictmap.end(); ++it)
226 stream << it->first.getString() <<
": " << it->second << std::endl;