diag_attrdiagstate.h

Go to the documentation of this file.
00001 /** @file diag_attrdiagstate.h State estimates for the current status of the generator (as state attributes). */
00002 
00003 #ifndef DIAG_ATTRDIAGSTATE_H
00004 #define DIAG_ATTRDIAGSTATE_H
00005 
00006 #include <vector>
00007 #include <map>
00008 #include <set>
00009 #include "corefaudes.h"
00010 #include "diag_attrlabelset.h"
00011 #include "diag_attrfailureevents.h"
00012 #include "diag_debug.h"
00013 
00014 namespace faudes {
00015 
00016 /** 
00017  * Implements state estimates for the current status of the generator.
00018  *  @ingroup DiagnosisPlugIn
00019  */
00020 
00021 class AttributeDiagnoserState : public AttributeFlags {
00022 
00023 FAUDES_TYPE_DECLARATION(Void,AttributeDiagnoserState,AttributeFlags)
00024 
00025 private:
00026   /**
00027      The diagnoser state attribute is a map of state indices of the original generator
00028      to their failure label sets. The whole map represents one state label of one particular state.
00029   */
00030   TaIndexSet<DiagLabelSet> mDiagnoserStateMap;
00031   
00032 public:
00033   /** Default constructor. */
00034   AttributeDiagnoserState(void);
00035   
00036   /** Destructor. */
00037   ~AttributeDiagnoserState(void);
00038 
00039   /**
00040    * Test for default value.
00041    *
00042    * @return
00043    *   True for default value.
00044    */
00045   bool IsDefault(void) const;
00046   
00047   /**
00048    * Delete the mDiagnoserStateMap.
00049    */
00050   virtual void Clear(void);
00051   
00052   /**
00053    * Get mDiagnoserStateMap.
00054    * @return
00055    *  mDiagnoserStateMap
00056    */
00057   const TaIndexSet<DiagLabelSet>& DiagnoserStateMap(void) const;
00058   
00059   /**
00060    *  Get pointer to mDiagnoserStateMap.
00061    *
00062    *  @return
00063    *    Pointer to mDiagnoserStateMap
00064    */
00065   const TaIndexSet<DiagLabelSet>* DiagnoserStateMapp(void) const;
00066   
00067   /**
00068    *  Set mDiagnoserStateMap.
00069    *
00070    *  @param newDiagStateMap
00071    *    New DiagnoserStateMap
00072    */
00073   void DiagnoserStateMap(const TaIndexSet<DiagLabelSet>& newDiagStateMap);
00074   
00075   /**
00076    * Add single value of state estimate to mDiagnoserStateMap.
00077    *
00078    * @param state
00079    *   Index of generator state estimate.
00080    * @param label
00081    *   Index of associated failure label.
00082    */
00083   void AddStateLabelMapping(Idx state, Idx label);
00084 
00085   /**
00086    * Add state estimates to mDiagnoserStateMap. 
00087    *
00088    * @param gstate
00089    *   Index of generator state estimate.
00090    * @param labels
00091    *    Index of associated failure labels.
00092    */
00093   void AddStateLabelMap(Idx gstate, const DiagLabelSet& labels);
00094   
00095   /**
00096    *  Pretty printable string of mDiagnoserStateMap.
00097    *
00098    *  @return
00099    *    String representation of mDiagnoserStateMap.
00100    */
00101   std::string Str(void) const;
00102 
00103   /**
00104    *  Check whether state estimate exists in mDiagnoserStateMap.
00105    *
00106    *  @param state
00107    *    Index of state to check.
00108    *  @return
00109    *    True if state exists.  
00110    */
00111   bool ExistsState(Idx state) const;
00112   
00113 
00114  protected:
00115 
00116   /**
00117    *  Copy attribute members
00118    *  @param rSrc 
00119    *    Source to copy from
00120    */
00121   void DoAssign(const AttributeDiagnoserState& rSrc); 
00122 
00123   /**
00124    *  Test equality
00125    *  @param rOther 
00126    *    Attribute to compare with
00127    */
00128   bool DoEqual(const AttributeDiagnoserState& rOther) const; 
00129 
00130   /**
00131    *  Write mDiagnoserStateMap to TokenWriter.
00132    *
00133    *  @param rTw
00134    *    Reference to TokenWriter
00135    *  @param rLabel
00136    *    Is ignored. Label of the section is "StateEstimates".
00137    *  @param pContext
00138    *    Write context to provide contextual information
00139    */  
00140   void DoWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const;
00141 
00142   /**
00143    *  Write mDiagnoserStateMap to TokenWriter.
00144    *
00145    *  @param rTw
00146    *    Reference to TokenWriter
00147    *  @param rLabel
00148    *    Is ignored. Label of the section is "StateEstimates".
00149    *  @param pContext
00150    *    Write context to provide contextual information
00151    */  
00152   void DoXWrite(TokenWriter& rTw, const std::string& rLabel, const Type* pContext) const;
00153 
00154   /**
00155    *  Read mDiagnoserStateMap from TokenReader.
00156    *
00157    *  @param rTr
00158    *    Reference to TokenReader
00159    *  @param rLabel
00160    *    Is ignored. Label of the section is "StateEstimates".
00161    *  @param pContext
00162    *    Read context to provide contextual information
00163    */  
00164   void DoRead(TokenReader &rTr, const std::string &rLabel, const Type *pContext);
00165   
00166 }; // class DiagnoserAttribute
00167 
00168 } // namespace faudes
00169 
00170 #endif

libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen