forked from UTulsa-Research/ag_gen
Fixing Edge Merging
This commit is contained in:
parent
8da4113404
commit
7c575b14bf
BIN
build/ag_gen
BIN
build/ag_gen
Binary file not shown.
@ -691,7 +691,6 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
AGGenInstance postinstance;
|
AGGenInstance postinstance;
|
||||||
|
|
||||||
std::cout << "Generating Attack Graph: " << std::flush;
|
|
||||||
AGGen gen(_instance);//use AGGen class to instantiate an obj with the name gen! _instance obj as the parameter! constructor defined in ag_gen.cpp
|
AGGen gen(_instance);//use AGGen class to instantiate an obj with the name gen! _instance obj as the parameter! constructor defined in ag_gen.cpp
|
||||||
|
|
||||||
if (mpi_subgraphing)
|
if (mpi_subgraphing)
|
||||||
|
|||||||
@ -554,6 +554,23 @@ void state_merge(std::vector<Factbase> node_factbases, std::vector<Edge> node_ed
|
|||||||
i_alpha = i_usage/tot_sys_mem;
|
i_alpha = i_usage/tot_sys_mem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
//Each MPI Node has its own copy of states and factbases: we need to correct it with the Root's IDs
|
||||||
|
auto old_id = fb.get_id();
|
||||||
|
fb.reset_curr_id(last_known_id+1);
|
||||||
|
fb.set_id();
|
||||||
|
auto new_id = fb.get_id();
|
||||||
|
last_known_id = new_id;
|
||||||
|
for(auto ed: node_edges){
|
||||||
|
if (ed.get_from_id() == old_id){
|
||||||
|
ed.force_from_id(new_id);
|
||||||
|
}
|
||||||
|
if (ed.get_to_id() == old_id){
|
||||||
|
ed.force_to_id(new_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//This does add duplicate edges - taken care of through graphviz' "strict" graphing
|
//This does add duplicate edges - taken care of through graphviz' "strict" graphing
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user