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 /** Copy constructor. */
38
39 /** Destructor. */
41
42 /**
43 * Test for default value.
44 *
45 * @return
46 * True for default value.
47 */
48 bool IsDefault(void) const;
49
50 /**
51 * Delete the mDiagnoserStateMap.
52 */
53 virtual void Clear(void);
54
55 /**
56 * Get mDiagnoserStateMap.
57 * @return
58 * mDiagnoserStateMap
59 */
60 const TaIndexSet<DiagLabelSet>& DiagnoserStateMap(void) const;
61
62 /**
63 * Get pointer to mDiagnoserStateMap.
64 *
65 * @return
66 * Pointer to mDiagnoserStateMap
67 */
68 const TaIndexSet<DiagLabelSet>* DiagnoserStateMapp(void) const;
69
70 /**
71 * Set mDiagnoserStateMap.
72 *
73 * @param newDiagStateMap
74 * New DiagnoserStateMap
75 */
76 void DiagnoserStateMap(const TaIndexSet<DiagLabelSet>& newDiagStateMap);
77
78 /**
79 * Add single value of state estimate to mDiagnoserStateMap.
80 *
81 * @param state
82 * Index of generator state estimate.
83 * @param label
84 * Index of associated failure label.
85 */
86 void AddStateLabelMapping(Idx state, Idx label);
87
88 /**
89 * Add state estimates to mDiagnoserStateMap.
90 *
91 * @param gstate
92 * Index of generator state estimate.
93 * @param labels
94 * Index of associated failure labels.
95 */
96 void AddStateLabelMap(Idx gstate, const DiagLabelSet& labels);
97
98 /**
99 * Pretty printable string of mDiagnoserStateMap.
100 *
101 * @return
102 * String representation of mDiagnoserStateMap.
103 */
104 std::string Str(void) const;
105
106 /**
107 * Check whether state estimate exists in mDiagnoserStateMap.
108 *
109 * @param state
110 * Index of state to check.
111 * @return
112 * True if state exists.
113 */
114 bool ExistsState(Idx state) const;
115
116
117 protected:
118
119 /**
120 * Copy attribute members
121 * @param rSrc
122 * Source to copy from
123 */
124 void DoCopy(const AttributeDiagnoserState& rSrc);
125
126 /**
127 * Move attribute members
128 * @param rSrc
129 * Source to tahe from
130 */
131 void DoMove(AttributeDiagnoserState& rSrc);
132
133 /**
134 * Test equality
135 * @param rOther
136 * Attribute to compare with
137 */
138 bool DoEqual(const AttributeDiagnoserState& rOther) const;
139
140 /**
141 * Write mDiagnoserStateMap to TokenWriter.
142 *
143 * @param rTw
144 * Reference to TokenWriter
145 * @param rLabel
146 * Is ignored. Label of the section is "StateEstimates".
147 * @param pContext
148 * Write context to provide contextual information
149 */
150 void DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const;
151
152 /**
153 * Write mDiagnoserStateMap to TokenWriter.
154 *
155 * @param rTw
156 * Reference to TokenWriter
157 * @param rLabel
158 * Is ignored. Label of the section is "StateEstimates".
159 * @param pContext
160 * Write context to provide contextual information
161 */
162 void DoXWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const;
163
164 /**
165 * Read mDiagnoserStateMap from TokenReader.
166 *
167 * @param rTr
168 * Reference to TokenReader
169 * @param rLabel
170 * Is ignored. Label of the section is "StateEstimates".
171 * @param pContext
172 * Read context to provide contextual information
173 */
174 void DoRead(TokenReader &rTr, const std::string &rLabel, const Type *pContext);
175
176}; // class DiagnoserAttribute
177
178} // namespace faudes
179
180#endif
#define FAUDES_API
#define FAUDES_TYPE_DECLARATION(ftype, ctype, cbase)
Definition cfl_types.h:918
TaIndexSet< DiagLabelSet > mDiagnoserStateMap
uint32_t Idx

libFAUDES 2.34e --- 2026.03.16 --- c++ api documentaion by doxygen