diag_attrdiagstate.h
Go to the documentation of this file.
1/** @file diag_attrdiagstate.h State estimates for the current status of the generator (as state attributes). */
2
3#ifndef DIAG_ATTRDIAGSTATE_H
4#define DIAG_ATTRDIAGSTATE_H
5
6#include <vector>
7#include <map>
8#include <set>
9#include "corefaudes.h"
10#include "diag_attrlabelset.h"
12#include "diag_debug.h"
13
14namespace faudes {
15
16/**
17 * Implements state estimates for the current status of the generator.
18 * @ingroup DiagnosisPlugIn
19 */
20
22
24
25private:
26 /**
27 The diagnoser state attribute is a map of state indices of the original generator
28 to their failure label sets. The whole map represents one state label of one particular state.
29 */
31
32public:
33 /** Default constructor. */
35
36 /** Destructor. */
38
39 /**
40 * Test for default value.
41 *
42 * @return
43 * True for default value.
44 */
45 bool IsDefault(void) const;
46
47 /**
48 * Delete the mDiagnoserStateMap.
49 */
50 virtual void Clear(void);
51
52 /**
53 * Get mDiagnoserStateMap.
54 * @return
55 * mDiagnoserStateMap
56 */
57 const TaIndexSet<DiagLabelSet>& DiagnoserStateMap(void) const;
58
59 /**
60 * Get pointer to mDiagnoserStateMap.
61 *
62 * @return
63 * Pointer to mDiagnoserStateMap
64 */
65 const TaIndexSet<DiagLabelSet>* DiagnoserStateMapp(void) const;
66
67 /**
68 * Set mDiagnoserStateMap.
69 *
70 * @param newDiagStateMap
71 * New DiagnoserStateMap
72 */
73 void DiagnoserStateMap(const TaIndexSet<DiagLabelSet>& newDiagStateMap);
74
75 /**
76 * Add single value of state estimate to mDiagnoserStateMap.
77 *
78 * @param state
79 * Index of generator state estimate.
80 * @param label
81 * Index of associated failure label.
82 */
83 void AddStateLabelMapping(Idx state, Idx label);
84
85 /**
86 * Add state estimates to mDiagnoserStateMap.
87 *
88 * @param gstate
89 * Index of generator state estimate.
90 * @param labels
91 * Index of associated failure labels.
92 */
93 void AddStateLabelMap(Idx gstate, const DiagLabelSet& labels);
94
95 /**
96 * Pretty printable string of mDiagnoserStateMap.
97 *
98 * @return
99 * String representation of mDiagnoserStateMap.
100 */
101 std::string Str(void) const;
102
103 /**
104 * Check whether state estimate exists in mDiagnoserStateMap.
105 *
106 * @param state
107 * Index of state to check.
108 * @return
109 * True if state exists.
110 */
111 bool ExistsState(Idx state) const;
112
113
114 protected:
115
116 /**
117 * Copy attribute members
118 * @param rSrc
119 * Source to copy from
120 */
121 void DoAssign(const AttributeDiagnoserState& rSrc);
122
123 /**
124 * Test equality
125 * @param rOther
126 * Attribute to compare with
127 */
128 bool DoEqual(const AttributeDiagnoserState& rOther) const;
129
130 /**
131 * Write mDiagnoserStateMap to TokenWriter.
132 *
133 * @param rTw
134 * Reference to TokenWriter
135 * @param rLabel
136 * Is ignored. Label of the section is "StateEstimates".
137 * @param pContext
138 * Write context to provide contextual information
139 */
140 void DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const;
141
142 /**
143 * Write mDiagnoserStateMap to TokenWriter.
144 *
145 * @param rTw
146 * Reference to TokenWriter
147 * @param rLabel
148 * Is ignored. Label of the section is "StateEstimates".
149 * @param pContext
150 * Write context to provide contextual information
151 */
152 void DoXWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const;
153
154 /**
155 * Read mDiagnoserStateMap from TokenReader.
156 *
157 * @param rTr
158 * Reference to TokenReader
159 * @param rLabel
160 * Is ignored. Label of the section is "StateEstimates".
161 * @param pContext
162 * Read context to provide contextual information
163 */
164 void DoRead(TokenReader &rTr, const std::string &rLabel, const Type *pContext);
165
166}; // class DiagnoserAttribute
167
168} // namespace faudes
169
170#endif
#define FAUDES_API
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
Definition cfl_types.h:879
TaIndexSet< DiagLabelSet > mDiagnoserStateMap
uint32_t Idx

libFAUDES 2.33k --- 2025.09.16 --- c++ api documentaion by doxygen