@@ -355,6 +355,7 @@ set<int> LocalizeViaNobody(LogData *data, int ntraces, string fail_file,
355
355
356
356
map<Flow *, map<int , int >> path_per_link_per_flow;
357
357
map<Flow *, int > min_path_per_link_per_flow;
358
+ int min_path_per_link = 1000 ;
358
359
for (Flow *flow : data[0 ].flows ) {
359
360
vector<Path *> *flow_paths = flow->GetPaths (max_finish_time_ms);
360
361
for (Path *path : *flow_paths) {
@@ -367,10 +368,12 @@ set<int> LocalizeViaNobody(LogData *data, int ntraces, string fail_file,
367
368
path_per_link_per_flow[flow][link_id] += 1 ;
368
369
}
369
370
}
370
- auto [_, min_value] = (*min_element (path_per_link_per_flow[flow].begin (), path_per_link_per_flow[flow].end ()));
371
- min_path_per_link_per_flow[flow] = min_value;
371
+ for (auto it = path_per_link_per_flow[flow].begin (); it != path_per_link_per_flow[flow].end (); ++it) {
372
+ if (it->second <= min_path_per_link){
373
+ min_path_per_link = it->second ;
374
+ }
375
+ }
372
376
}
373
- auto [_, min_path_per_link] = (*min_element (min_path_per_link_per_flow.begin (), min_path_per_link_per_flow.end ()));;
374
377
375
378
for (int ii = 1 ; ii < ntraces; ii++) {
376
379
set<int > new_localized_devices;
@@ -440,8 +443,8 @@ int IsProblemSolved(LogData *data, double max_finish_time_ms, const int min_path
440
443
cout << " Old equation: " << float (failed_flows)/total_flows << " <= " << failure_threshold / shortest_paths << endl;
441
444
cout << " New equation: " << float (failed_flows) << " <= " << mean - 3 *std_dev << endl;
442
445
443
- if (float (failed_flows) / total_flows <= failure_threshold / shortest_paths) {
444
- // if (failed_flows <= mean - 3*std_dev) {
446
+ // if (float(failed_flows) / total_flows <= failure_threshold / shortest_paths) {
447
+ if (failed_flows <= mean - 3 *std_dev) {
445
448
return 1 ;
446
449
}
447
450
return 0 ;
0 commit comments