⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 policy.hpp

📁 一个非常好的人工智能开发工具开源软件
💻 HPP
字号:
/*** *** See the file "L2_RTI_EO1/disclaimers-and-notices-L2.txt" for  *** information on usage and redistribution of this file,  *** and for a DISCLAIMER OF ALL WARRANTIES. ***/#ifndef Policy_H#define Policy_H#include "Logging.hpp"#include "RTIMessage.hpp"// Setting which determines how many steady state observations may accumulate// before a diagnosis is triggered. Note that these must be distinct // observables, as opposed to different values for the same observable.#define MAX_STEADY_STATE_OBSERVATIONS 10// Flags a timeout for an observation. Observation and command timeouts need// different treatment. Timer expirations for commands result in a transition // from a transient mode, those for observations do not. Both result in a diagnosis.#define OBSERVATION_TIMEOUT -1/** * Serves the RTITask by determining when to send to L2 commands, observations * and requests for diagnoses. * \ingroup RTI */class Policy { public:  /** Default constructor initializes member variables. */  Policy( void );  /** Destructor does nothing yet. */  ~Policy( void );  /** Return the number of timers that have not ended. */  unsigned outstandingTimerCount() const { return outstandingTimers; }  /**   * What RTITask does when it receives a command.   * \param monitor a message from SCL to the RTITask   */  void commandPolicy(const MONITOR_DATA& monitor );  /**   * What RTITask does when it receives an observation.   * \param monitor a message from SCL to the RTITask   */  void observationPolicy(const MONITOR_DATA& monitor );  /**   * What RTITask does when it receives a timeout.   * \param monitor   */  void timeoutPolicy(const MONITOR_DATA& monitor );  // HeartbeatData contains L2 counters, indicators, and task status.  HeartbeatData beat;  // Generate the heartbeat message and request the next heartbeat timer.  void heartbeatPolicy(const MONITOR_DATA& monitor);private:  // Task status for the HeartbeatData.   unsigned short taskStatus( const char taskName [L2_TASK_NAME_MAX_LENGTH] ); /**   * Send the RTIMessage to the L2Task.   * \param a message to the L2Task   * \return what msgQSend returns, 0 on success and ERROR on failure   */  int send(const RTIMessage& message);  /**   * Send the command to L2 and report it to the Reporter task.   * \param a message to the L2Task specifying a command   */  void sendCommand(const RTIMessage& msg );  /**   * Send the observation to L2 and report it.   * \param obs a message to the L2Task specifying an observation   */  void sendObservation(const RTIMessage& obs );// REDUNDANTvoid sendToDispatcher(const RTIMessage&			      livingstoneMessage);  /**   * Get L2 to perform a find-candidates operation and report it   * \param time a clock time tag   */  void requestFindCandidates(const TIME_TAG& time );  /**   * Get the Reporter to report that a diagnosis has occurred.   * \param time a clock time tag   */  void reportFindCandidates(const TIME_TAG& time );  /**   * Get the Reporter to send the Candidate set to telemetry.   * \param time a clock time tag   */  void reportDiagnosis(const TIME_TAG& time );  /** A no-op. */  void reportFullState( void );  /** The number of requested timers that haven't yet timed out. */  unsigned outstandingTimers;  /** The number of observations that have changed without being commanded. */  unsigned spontaneousObservations;};#endif /* Policy_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -