diff --git a/src/RdPBDD.cpp b/src/RdPBDD.cpp index a0ee4e686b030fb3f67bdb2fb72c269620cff164..f4d7e8ce80e8751335487c3ebf50ce86f6314f59 100644 --- a/src/RdPBDD.cpp +++ b/src/RdPBDD.cpp @@ -648,10 +648,10 @@ void RdPBDD::complete_sog(MDGraph &g, map<int, int> tranobs) { g.insert(c); // cout << "premier agregat construit " << endl; g.nbMarking += bdd_pathcount(c->class_state); - for (auto f : fire) { - // cout << "le nb de fires de"<<c->class_state.id()<<" est " << fire.size() - // << " : t" << f+1 << endl; - } + // for (auto f : fire) { + // cout << "le nb de fires de"<<c->class_state.id()<<" est " << fire.size() + // << " : t" << f+1 << endl; + // } while (!st.empty()) { // cout<<"il reste des elmts dans st " <<endl; Pair e = st.top(); @@ -708,10 +708,10 @@ void RdPBDD::complete_sog(MDGraph &g, map<int, int> tranobs) { { // cout << "nouvel agregat " << endl; fire = firable_obs(Complete_meta_state); - for (auto f : fire) { - // cout << "le nb de fires de "<<reached_class->class_state.id()<<" - // est " << fire.size() << " : t" << f+1 << endl; - } + // for (auto f : fire) { + // cout << "le nb de fires de "<<reached_class->class_state.id()<<" + // est " << fire.size() << " : t" << f+1 << endl; + // } // st.push(Pair(couple(reached_class, Complete_meta_state), fire)); nbmetastate++; e.first.first->Successors.insert(e.first.first->Successors.begin(), diff --git a/src/main.cpp b/src/main.cpp index b3dd573f1ccf5a81a786e618cb1bf0a531b4c479..5365cf2af69cf6cea2872fe23b7eeb40ed6a1714 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -45,8 +45,8 @@ void print_stats(const set<vector<int>> abstract_paths) { sum_transtions += path.size(); } - int nb_paths = abstract_paths.size(); - float average = sum_transtions / (nb_paths); + float nb_paths = abstract_paths.size(); + float average = sum_transtions / nb_paths; float std_deviation = 0; for (auto path : abstract_paths) { @@ -196,7 +196,6 @@ void generate_all_paths(const string& net_file, const string& output_folder, int main(int argc, char** argv) { CLI::App app{ "sogMBT: Symbolic Observation Graph-Based Generation of Test Paths"}; - app.require_subcommand(1); string input_file = ""; app.add_option("--input-net", input_file, "Petri net file") @@ -210,43 +209,21 @@ int main(int argc, char** argv) { ->required() ->check(CLI::ExistingDirectory); - CLI::App* reach = - app.add_subcommand("reachability", - "Generate the reachability graph in dot format") - ->fallthrough(); - - CLI::App* sog = - app.add_subcommand( - "sog", - "Generate the full SOG corresponding to observable transitions") - ->fallthrough(); - - CLI::App* generate = - app.add_subcommand( - "generate", - "Generate test paths using a transition coverage criteria") - ->fallthrough(); - std::string obs_file; CLI::Option* opt_transitions = - generate - ->add_option("--obs-file", obs_file, - "Cover transitions from file [default: all transitions]") + app.add_option("--obs-file", obs_file, + "Cover transitions from file [default: all transitions]") ->type_name("Path") ->check(CLI::ExistingFile); - // reach->callback([&]() {}); - // sog->callback([&]() {}); - generate->callback([&]() { - if (*opt_transitions) { - generate_paths_from_file(input_file, obs_file, output_folder); - } else { - generate_all_paths(input_file, output_folder); - } - }); - // parse arguments CLI11_PARSE(app, argc, argv); + if (*opt_transitions) { + generate_paths_from_file(input_file, obs_file, output_folder); + } else { + generate_all_paths(input_file, output_folder); + } + return 0; }