About
User Reference
C++ API
luafaudes
Developer
Links
libFAUDES online
libFAUDES
C++ API
Sections
Sets
Generators
Functions
PlugIns
Tutorials
Index
Classes
Files
pd_test.cpp
Go to the documentation of this file.
1
/** @file pd_test.cpp Example plugin */
2
3
#include "
pd_test.h
"
4
#include <stack>
5
6
namespace
faudes {
7
8
9
// we use the alternative accessibility algorithm from tutorial 6
10
// for our example plugin.
11
12
void
TestAlternativeAccessible
(
Generator
& rGen) {
13
std::cout <<
"test!"
<< std::endl;
14
15
// // create a todo stack for state indices
16
// std::stack<Idx> todo;
17
// // create an empty StateSet for the set of accessible state
18
// StateSet accessible_states;
19
// // iterator for a StateSet
20
// StateSet::Iterator sit;
21
// // initialize the algorithm by pushing all initial states on the todo stack
22
// for (sit = rGen.InitStatesBegin(); sit != rGen.InitStatesEnd(); ++sit) {
23
// todo.push(*sit);
24
// }
25
// // process the todo stack until it's empty
26
// while (not todo.empty()) {
27
// // get and delete the next state index from the todo stack
28
// const Idx current = todo.top();
29
// todo.pop();
30
// // insert the current state in the set of accessible states
31
// accessible_states.Insert(current);
32
// // create transition iterator for the states of the current state
33
// TransSet::Iterator tit = rGen.TransRelBegin(current);
34
// TransSet::Iterator tit_end = rGen.TransRelEnd(current);
35
// // push successor states ton todo stack if not already discovered
36
// while (tit != tit_end) {
37
// if (not accessible_states.Exists(tit->X2)) {
38
// todo.push(tit->X2);
39
// }
40
// ++tit;
41
// }
42
// }
43
// // delete the states and transitions which are not accessible
44
// rGen.DelStates(rGen.States() - accessible_states);
45
}
46
47
48
}
// namespace faudes
libFAUDES 2.24g
--- 2014.09.15 --- c++ api documentaion by
doxygen
>>
C++ API
Introduction
Sets
Generators
Functions
PlugIns
Tutorials
Classes
Files
Top of Page