From: <koc...@us...> - 2010-03-12 10:19:35
|
Revision: 698 http://scstudio.svn.sourceforge.net/scstudio/?rev=698&view=rev Author: kocianon Date: 2010-03-12 10:19:27 +0000 (Fri, 12 Mar 2010) Log Message: ----------- hmsc tightening - windows compilation fix Modified Paths: -------------- trunk/src/check/time/CMakeLists.txt trunk/src/check/time/tightening.h trunk/src/check/time/traverse_erase.cpp trunk/src/check/time/traverse_erase.h trunk/src/data/msc.h trunk/tests/CMakeLists.txt Modified: trunk/src/check/time/CMakeLists.txt =================================================================== --- trunk/src/check/time/CMakeLists.txt 2010-03-12 06:05:28 UTC (rev 697) +++ trunk/src/check/time/CMakeLists.txt 2010-03-12 10:19:27 UTC (rev 698) @@ -5,6 +5,8 @@ time_pseudocode.h time_consistency.cpp time_consistency.h + traverse_erase.cpp + traverse_erase.h tightening.cpp tightening.h constraint_syntax.cpp @@ -14,10 +16,10 @@ hmsc_all_paths.cpp find_block.cpp find_block.h + hmsc_block_paths.cpp hmsc_block_paths.h - hmsc_block_paths.cpp - traverse_erase.h - traverse_erase.cpp + + ) TARGET_LINK_LIBRARIES(sctime Modified: trunk/src/check/time/tightening.h =================================================================== --- trunk/src/check/time/tightening.h 2010-03-12 06:05:28 UTC (rev 697) +++ trunk/src/check/time/tightening.h 2010-03-12 10:19:27 UTC (rev 698) @@ -25,6 +25,7 @@ #include "data/transformer.h" #include "hmsc_all_paths.h" #include "hmsc_block_paths.h" +#include "traverse_erase.h" #include <vector> @@ -193,6 +194,8 @@ { HMscDuplicator duplicator; HMscPtr result = duplicator.duplicate(h); + // EraseAllConstraints erase; + // erase.erase_all_constraints(result); BMscGraphDuplicator graph_dup; HMscPtr bmsc_graph = graph_dup.duplicate_hmsc(result); @@ -230,8 +233,8 @@ continue; BMscPtr in = ref->get_bmsc(); bmsc_to_count[in.get()]++; // @Warning initial integer number = 0? - const TimeRelationRefNodePtrSet* top = &ref->get_time_relations_top(); - const TimeRelationRefNodePtrSet* bottom = &ref->get_time_relations_bottom(); + TimeRelationRefNodePtrSet* top = &(ref->get_time_relations_top()); + TimeRelationRefNodePtrSet* bottom = &(ref->get_time_relations_bottom()); if(top->size()>0) { @@ -252,7 +255,7 @@ } // open/close relations - for(TimeRelationRefNodePtrSet::iterator it=top->begin();it!=top->end();it++) + for(TimeRelationRefNodePtrSet::const_iterator it=top->begin();it!=top->end();it++) { if(open_rel.find(it->get()) != open_rel.end()) { @@ -272,6 +275,7 @@ other = &((*it)->get_ref_node_a()->get_time_relations_bottom()); } b_matrix.fill(a,rel_to_event[other],(*it)->get_interval_set()); + b_matrix.tied_rel_to_cell(*it,a, rel_to_event[other]); } else open_rel.insert((*it).get()); @@ -316,6 +320,7 @@ other = &((*it)->get_ref_node_a()->get_time_relations_bottom()); } b_matrix.fill(rel_to_event[other],a,(*it)->get_interval_set()); + b_matrix.tied_rel_to_cell(*it,rel_to_event[other],a); } else open_rel.insert((*it).get()); @@ -362,7 +367,7 @@ for(std::map<TimeRelation*, std::pair<unsigned,unsigned> >::iterator it=relations.begin();it!=relations.end();it++) { TimeRelation* copy = it->first; - if(copy->get_original()==NULL || copy->get_original()->get_original()!=NULL) + if(copy->get_original()==NULL || copy->get_original()->get_original()==NULL) throw std::runtime_error("To close to original time relation, something went wrong"); while(copy->get_original()->get_original()!=NULL) Modified: trunk/src/check/time/traverse_erase.cpp =================================================================== --- trunk/src/check/time/traverse_erase.cpp 2010-03-12 06:05:28 UTC (rev 697) +++ trunk/src/check/time/traverse_erase.cpp 2010-03-12 10:19:27 UTC (rev 698) @@ -36,10 +36,10 @@ void TraverseErase::traverse_erase_bmsc(BMscPtr bmsc) { - DFSEventsTraverser* trav_bmsc_erase= new DFSEventsTraverser(); - BmscTraverseErase* my_bmsc_trav= new BmscTraverseErase(); - trav_bmsc_erase->add_white_event_found_listener(my_bmsc_trav); - trav_bmsc_erase->traverse(bmsc); + DFSEventsTraverser trav_bmsc_erase; + BmscTraverseErase my_bmsc_trav; + trav_bmsc_erase.add_white_event_found_listener(&my_bmsc_trav); + trav_bmsc_erase.traverse(bmsc); } void BmscTraverseErase::on_white_event_found(Event* e) Modified: trunk/src/check/time/traverse_erase.h =================================================================== --- trunk/src/check/time/traverse_erase.h 2010-03-12 06:05:28 UTC (rev 697) +++ trunk/src/check/time/traverse_erase.h 2010-03-12 10:19:27 UTC (rev 698) @@ -1,3 +1,5 @@ +#ifndef _TRAVERSE_ERASE_H_ +#define _TRAVERSE_ERASE_H_ #include "data/dfs_bmsc_graph_traverser.h" //hmsc traverser #include "data/dfs_events_traverser.h" @@ -17,7 +19,7 @@ void traverse_erase_bmsc(BMscPtr bmsc); }; -class SCMSC_EXPORT BmscTraverseErase:public WhiteEventFoundListener//dfs event traverser +class SCTIME_EXPORT BmscTraverseErase:public WhiteEventFoundListener //dfs event traverser { public: BmscTraverseErase() @@ -37,10 +39,10 @@ void erase_all_constraints(HMscPtr hmsc) { - DFSBMscGraphTraverser* trav_erase= new DFSBMscGraphTraverser(); - TraverseErase* my_trav= new TraverseErase(); - trav_erase->add_white_node_found_listener(my_trav); - trav_erase->traverse(hmsc); + DFSBMscGraphTraverser trav_erase; + TraverseErase my_trav; + trav_erase.add_white_node_found_listener(&my_trav); + trav_erase.traverse(hmsc); } }; @@ -48,3 +50,4 @@ +#endif // _TRAVERSE_ERASE_H_ Modified: trunk/src/data/msc.h =================================================================== --- trunk/src/data/msc.h 2010-03-12 06:05:28 UTC (rev 697) +++ trunk/src/data/msc.h 2010-03-12 10:19:27 UTC (rev 698) @@ -1065,11 +1065,20 @@ return m_time_relation_set_top; } + TimeRelationRefNodePtrSet& get_time_relations_top() + { + return m_time_relation_set_top; + } + const TimeRelationRefNodePtrSet& get_time_relations_bottom() const { return m_time_relation_set_bottom; } + TimeRelationRefNodePtrSet& get_time_relations_bottom() + { + return m_time_relation_set_bottom; + } #endif }; Modified: trunk/tests/CMakeLists.txt =================================================================== --- trunk/tests/CMakeLists.txt 2010-03-12 06:05:28 UTC (rev 697) +++ trunk/tests/CMakeLists.txt 2010-03-12 10:19:27 UTC (rev 698) @@ -70,7 +70,6 @@ scmsc sctime scpseudocode - scorder ) ADD_TEST(find_block ${EXECUTABLE_OUTPUT_PATH}/find_block_test) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |