From: <ma...@us...> - 2012-02-07 14:31:12
|
Revision: 1310 http://scstudio.svn.sourceforge.net/scstudio/?rev=1310&view=rev Author: madzin Date: 2012-02-07 14:31:02 +0000 (Tue, 07 Feb 2012) Log Message: ----------- Fix bug in time find flow - ID: 3480535 Modified Paths: -------------- trunk/src/membership/membership_alg.cpp trunk/tests/membership/CMakeLists.txt Added Paths: ----------- trunk/tests/membership/test_bmsc36.mpr trunk/tests/membership/test_bmsc36.mpr.resutl trunk/tests/membership/test_hmsc36.mpr Modified: trunk/src/membership/membership_alg.cpp =================================================================== --- trunk/src/membership/membership_alg.cpp 2012-02-06 22:56:23 UTC (rev 1309) +++ trunk/src/membership/membership_alg.cpp 2012-02-07 14:31:02 UTC (rev 1310) @@ -364,12 +364,15 @@ return true; } + //If this is the first computed result and the time constraints are corupted if(c->get_result() == NULL) { c->update_result(); return false; } + //If there is some computed result, it is necessary to compare these computed results and + //store result with smoler amount of corupted intervals. if(c->get_not_covered_intervals().size() < c->get_result()->get_corupted_intervals_size().first) c->update_result(); else @@ -401,8 +404,19 @@ if (end != NULL) { + //TODO refactoring; check_time_constraints returns true also in case that the was corupted interval + // it returns false e.g. can decide which event is minimal/maximal. if(check_end_node(c, end, b) && check_time_constraints(c)) - return store_result(c); + { + if(store_result(c)) + return true; + else + { + c->top_pop_path(); + c->pop_time_stacks(); + return false; + } + } else return false; } Modified: trunk/tests/membership/CMakeLists.txt =================================================================== --- trunk/tests/membership/CMakeLists.txt 2012-02-06 22:56:23 UTC (rev 1309) +++ trunk/tests/membership/CMakeLists.txt 2012-02-07 14:31:02 UTC (rev 1310) @@ -255,3 +255,4 @@ ADD_MEMBER_TEST(bmsc_spec4.mpr bmsc_spec4_pat.mpr 1) ADD_MEMBER_TEST(bmsc_spec5.mpr bmsc_spec5_pat.mpr 1) +ADD_MEMBER_TEST(test_hmsc36.mpr test_bmsc36.mpr 1) Added: trunk/tests/membership/test_bmsc36.mpr =================================================================== --- trunk/tests/membership/test_bmsc36.mpr (rev 0) +++ trunk/tests/membership/test_bmsc36.mpr 2012-02-07 14:31:02 UTC (rev 1310) @@ -0,0 +1,14 @@ +mscdocument Drawing1; +msc Page_1; +inst A; +inst B; +A: instance; +label e0; +out ask,0 to B; +time e1 [0,7); +endinstance; +B: instance; +label e1; +in ask,0 from A; +endinstance; +endmsc; Added: trunk/tests/membership/test_bmsc36.mpr.resutl =================================================================== --- trunk/tests/membership/test_bmsc36.mpr.resutl (rev 0) +++ trunk/tests/membership/test_bmsc36.mpr.resutl 2012-02-07 14:31:02 UTC (rev 1310) @@ -0,0 +1,43 @@ +Flow "Page_1" found. +Diagram with found flow highlighted. +mscdocument test_hmsc36; +msc HMSC; +/* PATH */ +initial connect L0,/* PATH */ + L1; +L0: reference MSC01 connect L2; +/* PATH */ +/* ATTRIBUTES: [membership_counter 1] */ +L1: reference MSC02/* PATH */ + connect/* PATH */ + L2; +/* PATH */ +L2: final/* PATH */ +; +endmsc; +msc MSC01; +inst A; +inst B; +A: instance; +label e0; +out ask,0 to B; +time e1 [10,11); +endinstance; +B: instance; +label e1; +in ask,0 from A; +endinstance; +endmsc; +msc MSC02; +inst A; +inst B; +A: instance; +label e0; +out ask,0 to B; +time e1 [0,7); +endinstance; +B: instance; +label e1; +in ask,0 from A; +endinstance; +endmsc; Added: trunk/tests/membership/test_hmsc36.mpr =================================================================== --- trunk/tests/membership/test_hmsc36.mpr (rev 0) +++ trunk/tests/membership/test_hmsc36.mpr 2012-02-07 14:31:02 UTC (rev 1310) @@ -0,0 +1,33 @@ +mscdocument Drawing1; +msc HMSC; +initial connect L0, L1; +L0: reference MSC01 connect L2; +L1: reference MSC02 connect L2; +L2: final; +endmsc; +msc MSC01; +inst A; +inst B; +A: instance; +label e0; +out ask,0 to B; +time e1 [10,11); +endinstance; +B: instance; +label e1; +in ask,0 from A; +endinstance; +endmsc; +msc MSC02; +inst A; +inst B; +A: instance; +label e0; +out ask,0 to B; +time e1 [0,7); +endinstance; +B: instance; +label e1; +in ask,0 from A; +endinstance; +endmsc; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |