pd_test.cppGo to the documentation of this file.00001 /** @file pd_test.cpp Example plugin */ 00002 00003 #include "pd_test.h" 00004 #include <stack> 00005 00006 namespace faudes { 00007 00008 00009 // we use the alternative accessibility algorithm from tutorial 6 00010 // for our example plugin. 00011 00012 void TestAlternativeAccessible(Generator& rGen) { 00013 std::cout << "test!" << std::endl; 00014 00015 // // create a todo stack for state indices 00016 // std::stack<Idx> todo; 00017 // // create an empty StateSet for the set of accessible state 00018 // StateSet accessible_states; 00019 // // iterator for a StateSet 00020 // StateSet::Iterator sit; 00021 // // initialize the algorithm by pushing all initial states on the todo stack 00022 // for (sit = rGen.InitStatesBegin(); sit != rGen.InitStatesEnd(); ++sit) { 00023 // todo.push(*sit); 00024 // } 00025 // // process the todo stack until it's empty 00026 // while (not todo.empty()) { 00027 // // get and delete the next state index from the todo stack 00028 // const Idx current = todo.top(); 00029 // todo.pop(); 00030 // // insert the current state in the set of accessible states 00031 // accessible_states.Insert(current); 00032 // // create transition iterator for the states of the current state 00033 // TransSet::Iterator tit = rGen.TransRelBegin(current); 00034 // TransSet::Iterator tit_end = rGen.TransRelEnd(current); 00035 // // push successor states ton todo stack if not already discovered 00036 // while (tit != tit_end) { 00037 // if (not accessible_states.Exists(tit->X2)) { 00038 // todo.push(tit->X2); 00039 // } 00040 // ++tit; 00041 // } 00042 // } 00043 // // delete the states and transitions which are not accessible 00044 // rGen.DelStates(rGen.States() - accessible_states); 00045 } 00046 00047 00048 } // namespace faudes libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen |