Changeset 170
- Timestamp:
- 03/21/09 17:06:43 (15 years ago)
- Location:
- vtcross/trunk/src/include/vtcross
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
vtcross/trunk/src/include/vtcross/cbr.h
r161 r170 2 2 // Case-based reasoner 3 3 // 4 // 5 // TODO REDO THIS FILE 4 6 5 7 #ifndef CBR_H -
vtcross/trunk/src/include/vtcross/components.h
r161 r170 24 24 25 25 26 /* Component abstract base class that all component classes should inherit from, 27 * including cognitive and policy engines, and the service management layer. 28 * Defines only functions required by all component types. 29 */ 26 30 class Component 27 31 { 28 32 public: 33 /* Asks the component at the passed socket FD for its component type 34 * string. 35 */ 29 36 virtual void GetRemoteComponentType(int32_t socketFD) = 0; 37 38 39 /* Wait for a command signal containing task instructions. 40 */ 30 41 virtual void WaitForSignal(int32_t socketFD) = 0; 42 43 44 /* Completely shutdown the radio and all operations. 45 */ 31 46 virtual void Shutdown() = 0; 47 48 49 /* Reset the radio and reload all configuration files. 50 * 51 * TODO are we remembering experiences in CEs? 52 */ 32 53 virtual void Reset() = 0; 54 55 56 /* Register or deregister a component with the primary radio shell. 57 */ 33 58 virtual void RegisterComponent(int32_t socketFD) = 0; 34 59 virtual void DeregisterComponent(int32_t socketFD) = 0; … … 36 61 37 62 63 /* Engine abstract base class from which all engine component types should 64 * inherit (e.g. cognitive and policy engines). Inherits all functions from the 65 * ABC Component publically. 66 */ 38 67 class Engine : public Component 39 68 { 40 69 public: 70 /* Register or deregister services that this engine provides with the 71 * service management layer. 72 */ 41 73 virtual void RegisterServices(int32_t socketFD) = 0; 42 74 virtual void DeregisterServices(int32_t socketFD) = 0; … … 44 76 45 77 78 /* Service Management Layer (SML) class declaration. The functions listed here 79 * are required by the VTCROSS API for service-oriented VTCROSS radio 80 * architectures. 81 */ 46 82 class ServiceManagementLayer : public Component 47 83 { … … 58 94 59 95 private: 96 /* Receive the radio configuration settings from the shell and pass them 97 * on to another component. 98 */ 60 99 void TransferRadioConfiguration(); 100 101 102 /* Receive information regarding a completed 'experience' and pass it on 103 * to the appropriate cognitive engine. 104 */ 61 105 void TransferExperience(); 106 107 108 /* Listen for other components registering their available services with 109 * the SML. */ 62 110 void ReceiveServices(); 111 112 113 /* Change the active mission of the radio to a new one and adjust radio 114 * behavoir appropriately. 115 */ 63 116 void SetActiveMission(); 117 118 119 /* List all services provided to the radio by registered components. 120 */ 64 121 void ListServices(); 122 123 124 /* Load/Relead the XML configuration file. 125 */ 65 126 void ReloadConfiguration(); 66 127 void LoadConfiguration(); … … 68 129 69 130 131 /* Policy Engine class declaration. All public functions are inherited from 132 * parent classes. 133 */ 70 134 class PolicyEngine : public Engine 71 135 { … … 85 149 86 150 private: 151 /* Parse and load/reload policies into the policy engine. 152 */ 87 153 void LoadPolicies(); 88 154 void ReloadPolicies(); 155 156 157 /* Return a decision made by the policy engine regarding a certain set 158 * of transmission parameters. 159 */ 89 160 void SendPEDecision(int32_t socketFD, struct Parameter pList[], \ 90 161 struct CE_Info *ce_info, int32_t decision_array[]); 162 163 164 /* Validate a set of transmission parameters received from the radio. 165 */ 91 166 void ValidateParameters(struct Parameter pList[], \ 92 167 struct CE_Info *ce_info, int decision_array[]); … … 94 169 95 170 171 /* Cognitive Engine class declaration. All public functions are inherited from 172 * parent classes. 173 */ 96 174 class CognitiveEngine : public Engine 97 175 { … … 111 189 112 190 private: 191 /* Receive the transmitted radio configuration from the radio itself 192 * (the CE will not always be local to the radio). 193 */ 113 194 void ReceiveRadioConfiguration(int32_t socketFD); 195 196 197 /* Receive an 'experience' report from the radio. 198 */ 114 199 void ReceiveExperience(int32_t socketFD); 200 201 202 /* Find the most optimal set of transmission parameters given certain 203 * observables and possibly a service if the SML component is present 204 * and active. 205 */ 115 206 void GetSolution(Observable *observables); 116 207 void GetSolution(Observable *observables, std::string service); 208 209 210 /* Receive a feedback from the radio regarding the performance of a 211 * certain set of parameters, possibly associated with a service. 212 * 213 * TODO what is the difference between experiences and feedback, 214 * exactly? we should explain that explicitly here. 215 */ 117 216 void ReceiveFeedback(Observable *observables,\ 118 217 Parameter *parameters, Utility *utilities); -
vtcross/trunk/src/include/vtcross/containers.h
r165 r170 17 17 18 18 19 /* TODO initially made all of the string fields std::strings, but this might not 20 * be the best end-decision. Need to evaluate our needs and figure out if 21 * cstrings would do better for us. */ 22 23 24 /* TODO 25 * 26 */ 19 27 struct CE_Info { 20 28 uint32_t numUtilities; … … 26 34 }; 27 35 36 37 /* TODO 38 * 39 */ 28 40 struct Utility { 29 41 std::string name; … … 34 46 }; 35 47 48 49 /* TODO 50 * 51 */ 36 52 struct Affect { 37 53 Utility *u; … … 39 55 }; 40 56 57 58 /* TODO 59 * 60 */ 41 61 struct Parameter { 42 62 std::string name; … … 50 70 }; 51 71 72 73 /* TODO 74 * 75 */ 52 76 struct Observable { 53 77 std::string name; -
vtcross/trunk/src/include/vtcross/libvtcross.h
r161 r170 33 33 bool ParseRadioConfiguration(); 34 34 35 35 36 /* Lists current radio configuration options loaded from the configuration XML 36 37 * file. … … 40 41 */ 41 42 void ListCurrentRadioConfiguration(); 43 42 44 43 45 /* View data from the current status of the radio. … … 52 54 Utilities* GetRadioUtilities(); 53 55 56 54 57 /* View components currently connected to the radio by id. 55 58 * … … 62 65 uint32_t* GetConnectedComponents(); 63 66 67 64 68 /* Look up component information by id. 65 69 * … … 68 72 */ 69 73 Component* GetComponentInformation(uint32_t id); 74 70 75 71 76 /* Given a certain set of observables, ask the radio to find the optimum radio … … 77 82 Parameters* GetOptimalParameters(Observables *radioObservables); 78 83 84 79 85 /* Update the radio regarding its performance for a certain set of transmission 80 86 * parameters, observables, and utilities. … … 85 91 bool UpdateParameterPerformance(Parameters *radioParameters, \ 86 92 Observables *radioObservables, Utilies *radioUtilies); 93 87 94 88 95 /* Deactivate/Activate/Disconnect a component by id. … … 102 109 bool DisconnectSML(uint32_t id); 103 110 111 104 112 /* Shut down the radio. 105 113 * -
vtcross/trunk/src/include/vtcross/socketcomm.h
r161 r170 14 14 15 15 16 /* TODO 17 */ 16 18 void ReadMessage(int32_t socketFD, char* msgBuffer); 19 20 21 /* TODO 22 */ 17 23 int32_t ClientSocket(char* serverName, char* portNumber); 24 25 26 /* TODO 27 */ 18 28 int32_t SendMessage(int32_t socketFD, char* message); 29 30 31 /* TODO 32 */ 19 33 int32_t GetParameter(int32_t socketFD, struct Parameter pList[], \ 20 34 struct CE_Info *ce_info); 35 36 37 /* TODO 38 */ 21 39 int32_t GetRequest(int32_t socketFD, struct Parameter pList[], \ 22 40 struct CE_Info *ce_info);