|
From: <lko...@us...> - 2010-09-08 10:46:35
|
Revision: 889
http://scstudio.svn.sourceforge.net/scstudio/?rev=889&view=rev
Author: lkorenciak
Date: 2010-09-08 10:46:28 +0000 (Wed, 08 Sep 2010)
Log Message:
-----------
fixed two bugs
Modified Paths:
--------------
trunk/src/check/time/hmsc_all_paths.cpp
trunk/src/check/time/tightening.h
trunk/tests/time/time_race/CMakeLists.txt
Modified: trunk/src/check/time/hmsc_all_paths.cpp
===================================================================
--- trunk/src/check/time/hmsc_all_paths.cpp 2010-09-08 09:13:49 UTC (rev 888)
+++ trunk/src/check/time/hmsc_all_paths.cpp 2010-09-08 10:46:28 UTC (rev 889)
@@ -38,10 +38,10 @@
}
path_prefix2.pop_back();
//keep poping until hmsc node is reached
- std::cout << "b\n";
+// std::cout << "b\n";
while(!((HMscNode*)(path_prefix2.back())))
path_prefix2.pop_back();
- std::cout << "c\n";
+// std::cout << "c\n";
return; //TODO check- I think it should be here
}
}
Modified: trunk/src/check/time/tightening.h
===================================================================
--- trunk/src/check/time/tightening.h 2010-09-08 09:13:49 UTC (rev 888)
+++ trunk/src/check/time/tightening.h 2010-09-08 10:46:28 UTC (rev 889)
@@ -51,7 +51,6 @@
{
for(size_t i= 0; i<= to;i++)
{
- std::cerr << i << std::endl;
at(i)=((*v_lists)[i])[(*iterators)[i]];
}
@@ -98,7 +97,7 @@
void init()
{
if(lists.size() == 0)
- throw std::runtime_error("Lists size is zero.");
+ return ;
if(ini)
throw std::runtime_error("Already allocated!");
else
@@ -245,6 +244,7 @@
TimeRelationRefNodePtrSet* top = &(ref->get_time_relations_top());
TimeRelationRefNodePtrSet* bottom = &(ref->get_time_relations_bottom());
+
if(top->size()>0)
{
a = new StrictEvent();
@@ -253,7 +253,7 @@
rel_to_event[top] = a;
MinimalEventPList min(in);
- std::vector<std::pair<EventP,EventP> > floor(min.size());
+ std::vector<std::pair<EventP,EventP> > floor;
for(MinimalEventPList::iterator m=min.begin();m!=min.end();m++)
{
Event* copy = dynamic_cast<Event*>(duplicator.get_copy_with_occurence(*m,bmsc_to_count[in.get()]));
@@ -301,7 +301,7 @@
events_to_delete.push_back(a);
rel_to_event[bottom] = a;
MaximalEventPList max(in);
- std::vector<std::pair<EventP,EventP> > floor(max.size());
+ std::vector<std::pair<EventP,EventP> > floor;
for(MaximalEventPList::iterator m=max.begin();m!=max.end();m++)
{
Event* copy = dynamic_cast<Event*>(duplicator.get_copy_with_occurence(*m,bmsc_to_count[in.get()]));
@@ -342,10 +342,12 @@
}
}
b_matrix.build_up();
-
+
+
IntervalSetMatrix result;
result.resize(b_matrix.size1());
-
+
+ combination.init();
if(combination.size()==0){
//tighten the matrix
MscSolveTCSP solve;
@@ -360,12 +362,11 @@
}
} myex;
throw myex;//TODO do something when inconsistent (e.g.exception). For consistency check this should return something reasonable
-
}
return std::make_pair<BMscIntervalSetMatrix,IntervalSetMatrix>(b_matrix,report.m_matrix_result);
}
- combination.init();
+
do
{
// push there [0,0] interval
@@ -376,18 +377,17 @@
MscSolveTCSP solve;
if(b_matrix.get_rel_empty_set().size()!=0) // inconsistent
continue;
-
MscSolveTCSPReport report = solve.solveTCSP(b_matrix);
if(report.csp_mtxs.size()==0) // inconsistent
continue;
IntervalSetMatrix new_result = report.m_matrix_result;
-
for(unsigned i=0;i<new_result.size1();i++)
for(unsigned j=0;j<new_result.size1();j++)
result(i,j) = MscTimeIntervalSetD::set_union(result(i,j),new_result(i,j));
+
//return back previous value
for(size_t i=0;i<combination.size();i++)
{
Modified: trunk/tests/time/time_race/CMakeLists.txt
===================================================================
--- trunk/tests/time/time_race/CMakeLists.txt 2010-09-08 09:13:49 UTC (rev 888)
+++ trunk/tests/time/time_race/CMakeLists.txt 2010-09-08 10:46:28 UTC (rev 889)
@@ -10,6 +10,9 @@
ADD_CHECKER_TEST(sctime "Time Race" race_neg12.mpr 0)
ADD_CHECKER_TEST(sctime "Time Race" race_neg13.mpr 0)
ADD_CHECKER_TEST(sctime "Time Race" race_neg14.mpr 0)
+ADD_CHECKER_TEST(sctime "Time Race" race_neg15.mpr 0)
+ADD_CHECKER_TEST(sctime "Time Race" race_neg16.mpr 0)
+ADD_CHECKER_TEST(sctime "Time Race" race_neg17.mpr 0)
ADD_CHECKER_TEST(sctime "Time Race" race_pos1.mpr 1)
ADD_CHECKER_TEST(sctime "Time Race" race_pos2.mpr 1)
@@ -28,4 +31,8 @@
ADD_CHECKER_TEST(sctime "Time Race" race_pos20.mpr 1)
ADD_CHECKER_TEST(sctime "Time Race" race_pos21.mpr 1)
ADD_CHECKER_TEST(sctime "Time Race" race_pos22.mpr 1)
+ADD_CHECKER_TEST(sctime "Time Race" race_pos23.mpr 1)
+ADD_CHECKER_TEST(sctime "Time Race" race_pos24.mpr 1)
+ADD_CHECKER_TEST(sctime "Time Race" race_pos25.mpr 1)
+ADD_CHECKER_TEST(sctime "Time Race" race_pos26.mpr 1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|