Commit 3cb93a32 authored by Jonas Seidel's avatar Jonas Seidel

Graph Selectors cont + Graph out fix + Switch to attribute from set indexing

parent 34e61191
......@@ -2,6 +2,7 @@
#include "Graph.ipp"
#include "Graph_fringe_operations.ipp"
#include "Graph_select_operations.ipp"
#include "Graph_path_operations.ipp"
#include "Graph_special_members_and_operators.ipp"
#include "Graph_advanced.ipp"
......
......@@ -60,7 +60,7 @@ Node* Graph::tip_sources(random_attribute_generator edge_attribute_generator, ra
s = this->add_node(name.str(), node_attribute_generator.next());
for(Node* n : sources){
std::stringstream name;
name << n->description() << "_" << s->description();
name << s->description() << "_" << n->description();
this->add_edge(s, n, name.str(), edge_attribute_generator.next());
}
}else if(sources.size() == 1){
......
......@@ -10,19 +10,19 @@ maintenance_problem_generator::maintenance_problem_generator(random_graph_genera
Maintenance_Problem maintenance_problem_generator::next(){
std::pair<std::pair<Node*,Node*>, Graph> stg = this->_graph_generator.next_acyclic_2_tips();
std::set<Edge*> critical_edges;
random_set_element_generator<Edge*> set_gen (&stg.second.edges());
for(size_t i = 0; i < this->_number_of_critical_edges; i++){
Edge* curr = set_gen.next();
while(critical_edges.find(curr) != critical_edges.end()){
auto attribute_search = curr->attribute("Selected");
while(!attribute_search.first){
set_gen >> curr;
attribute_search = curr->attribute("Selected");
}
critical_edges.insert(curr);
curr->attribute_throwing("Selected").value() = true;
}
return Maintenance_Problem(stg.second, stg.first.first, stg.first.second, critical_edges, this->_length_of_interval);
return Maintenance_Problem(stg.second, stg.first.first, stg.first.second, this->_length_of_interval);
}
void maintenance_problem_generator::operator>>(Maintenance_Problem& mp){
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment