Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1997
  6. //
  7. // File: infer.h
  8. //
  9. //--------------------------------------------------------------------------
  10. //
  11. // infer.h: inference engine declarations
  12. //
  13. #ifndef _INFER_H_
  14. #define _INFER_H_
  15. #include "gmobj.h"
  16. ////////////////////////////////////////////////////////////////////
  17. ////////////////////////////////////////////////////////////////////
  18. //
  19. // GOBJMBN_INFER_ENGINE: A generic superclass for inference engines
  20. // operating against a belief network.
  21. //
  22. ////////////////////////////////////////////////////////////////////
  23. ////////////////////////////////////////////////////////////////////
  24. class GOBJMBN_INFER_ENGINE: public MBNET_MODIFIER
  25. {
  26. public:
  27. GOBJMBN_INFER_ENGINE (
  28. MBNET & model, // The model over which to infer
  29. REAL rEstimatedMaximumSize = -1.0, // Max size estimate; < 0 indicates "don't care"
  30. int iInferEngID = 0 ) // Inference engine identifier
  31. : MBNET_MODIFIER(model),
  32. _iInferEngID( iInferEngID ),
  33. _rEstMaxSize(rEstimatedMaximumSize)
  34. {}
  35. virtual ~ GOBJMBN_INFER_ENGINE () {}
  36. virtual INT EType () const
  37. { return EBNO_INFER_ENGINE; }
  38. // Perform any creation-time operations
  39. virtual void Create () = 0;
  40. // Perform any special destruction
  41. virtual void Destroy () = 0;
  42. // Reload or reinitialize as necessary
  43. virtual void Reload () = 0;
  44. // Accept evidence on a node
  45. virtual void EnterEvidence ( GNODEMBN * pgnd, const CLAMP & clamp ) = 0;
  46. // Return stored evidence against a node
  47. virtual void GetEvidence ( GNODEMBN * pgnd, CLAMP & clamp ) = 0;
  48. // Perform full inference
  49. virtual void Infer () = 0;
  50. // Return the vector of beliefs for a node
  51. virtual void GetBelief ( GNODEMBN * pgnd, MDVCPD & mdvBel ) = 0;
  52. virtual void Dump () = 0;
  53. INT IInferEngId () const { return _iInferEngID; }
  54. protected:
  55. INT _iInferEngID; // This junction tree's identifier
  56. REAL _rEstMaxSize; // Maximum size estimate
  57. };
  58. #endif // _INFER_H_