Changeset 530 for vtcross/trunk/src/include
- Timestamp:
- 01/04/10 15:14:16 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/include/vtcross/cognitive_engine.h
r518 r530 27 27 /*! \brief Cognitive Engine class declaration. 28 28 * 29 * All public functions are inherited from parent classes. Please see parent 30 * class definitions for function documentation. 29 * This is the declaration for the default cognitive engine class. Note that 30 * most of the below functions are implemented in CognitiveEngine.cpp - however, 31 * the functionality is very non-specific. 32 * 33 * Each of the 'Perform*' functions are left un-implemented, for the most part. 34 * 35 * The purpose of this class is to act as a non-abstract parent class. 36 * Cognitive Engines should be built by publically inherting from this class, 37 * and overloading the 'Perform*' functions - thus creating new and specific 38 * cognitive engine functionality, without the need to rewrite or copy/paste the 39 * rest of the code. 40 * 41 * Note, however, that all functions are virtual. Any function may be 42 * overloaded by the child class, if desired. 31 43 */ 32 44 class CognitiveEngine : public Engine … … 47 59 const bool SML); 48 60 49 v oid SendComponentType();50 v oid ConnectToRemoteComponent(const char* serverName, \61 virtual void SendComponentType(); 62 virtual void ConnectToRemoteComponent(const char* serverName, \ 51 63 const char* serverPort, const bool SML); 52 v oid WaitForSignal();53 v oid Shutdown();54 v oid Reset();55 v oid RegisterComponent();56 v oid DeregisterComponent();64 virtual void WaitForSignal(); 65 virtual void Shutdown(); 66 virtual void Reset(); 67 virtual void RegisterComponent(); 68 virtual void DeregisterComponent(); 57 69 58 v oid RegisterServices();59 v oid DeregisterServices();70 virtual void RegisterServices(); 71 virtual void DeregisterServices(); 60 72 61 private:62 73 /*! \brief Receive radio XML configuration. 63 74 * … … 65 76 * (the CE will not always be local to the radio). This gets passed 66 77 * through either the Shell or the SML. */ 67 v oid ReceiveRadioConfiguration();78 virtual void ReceiveRadioConfiguration(); 68 79 69 80 /*! \brief Receive an 'experience' report from the radio. … … 72 83 * for a CE just starting up so that it has a moving start regarding 73 84 * parameter optimization. */ 74 v oid ReceiveExperience();85 virtual void ReceiveExperience(); 75 86 76 87 /*! \brief Request that the CE optimize a set of parameters. … … 79 90 * observables and possibly a service if the SML component is present 80 91 * and active. */ 81 Parameter *GetSolution(Observable *observables, \92 virtual Parameter *GetSolution(Observable *observables, \ 82 93 Parameter *currentParameters); 83 Parameter *GetSolution(Observable *observables, \94 virtual Parameter *GetSolution(Observable *observables, \ 84 95 Parameter *currentParameters, std::string service); 85 96 … … 94 105 * more accurate performance statistics. 95 106 */ 96 v oid ReceiveFeedback(Observable *observables,Parameter *parameters);97 v oid ReceiveFeedback(Observable *observables, Parameter *parameters, \107 virtual void ReceiveFeedback(Observable *observables,Parameter *parameters); 108 virtual void ReceiveFeedback(Observable *observables, Parameter *parameters, \ 98 109 std::string service); 99 110 … … 107 118 * may build the chromosome structure. 108 119 */ 109 v oid BuildCognitiveEngine();120 virtual void BuildCognitiveEngine(); 110 121 122 /*! \brief Each of these functions responds to a specific command. 123 * 124 * These functions are left principally un-implemented. It is the duty 125 * of child classes to implement these functions, as they define the 126 * cognitive engine's functionality. 127 */ 128 virtual void PerformUpdatePerformance(); 129 virtual void PerformRequestOptimizationService(); 130 virtual void PerformRequestOptimization(); 131 virtual void PerformQueryComponentType(); 132 virtual void PerformConnectSML(); 133 virtual void PerformDisconnectSML(); 134 virtual void PerformResetEngineCognitive(); 135 virtual void PerformShutdownEngineCognitive(); 136 111 137 /*! \brief Keept track of what this CE is connected to. 112 138 * … … 118 144 bool SML_present; 119 145 int32_t commandSocketFD; 120 146 121 147 // TODO Need a description for these fields. Are these radio utilites, 122 148 // parameters, and observables global to the whole system?