-
Notifications
You must be signed in to change notification settings - Fork 1
/
GraphOutputLab.h
66 lines (55 loc) · 1.78 KB
/
GraphOutputLab.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef __GRAPHOUTPUTLAB_H
#define __GRAPHOUTPUTLAB_H
#include <string>
#include "GraphOutput.h"
#include "Graph.h"
/** \brief Suitable for writing to a ".lab" file.
*
* The written file contains all state labels.
* The format can directly be read by MRMC.
*
* There are basically two state labels in this file.
* The "reach" label marks all interesting States, so that MRMC can check
* the propability to reach one of these States.
*
* If Graph::getSearchForAbsorbingStates yields true, then a second label,
* "absorbing", will be created, that marks all States, that have either no
* outgoing Transition, or only has one Transition, that just leads back to
* the same State.
* If no such States exist, the label will not be deklared.
*
* This file has the header
* \verbatim
* #DECLARATION
* reach
* absorbing
* #END \endverbatim
* Where absorbing is only introduces, if there is at least one absorbing State.
*
* The following lines have the form
* \verbatim
* <stateNr> <label> [<label>] \endverbatim
* Where label may be one of "reach" and "absorbing".
*
* This class handles the "lab" format.
*/
class GraphOutputLab : public GraphOutput {
public:
/// See GraphOutput::writeToFile
void writeToFile(Graph* graph, const std::string &format,
const std::string &filename);
/// Destructor
~GraphOutputLab();
private:
struct registerClass {
registerClass() {
GraphOutput* o = new GraphOutputLab();
Graph::registerOutput("lab", o);
}
};
static registerClass registerObject;
static const unsigned short stateNumberOffset = 1;
static const char* reachLabel;
static const char* absorbingLabel;
};
#endif