root/vtcross/branches/nikhil/crossmodel2/src/cognitive_engines/CBR_CE/CBR_CE.h @ 563

Revision 563, 3.8 KB (checked in by nikhil, 14 years ago)

final codes

Line 
1/*
2 Copyright 2009 Virginia Polytechnic Institute and State University 
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7 
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/*! This file provides a default implementation for a case-based-reasoning based
18 * cognitive engine.
19 */
20
21#ifndef CBR_CE_H
22#define CBR_CE_H
23
24#include <cstdlib>
25#include <cstring>
26#include <stdint.h>
27#include <cmath>
28#include <string>
29
30#include "vtcross/cbr.h"
31#include "vtcross/cognitive_engine.h"
32#include "vtcross/common.h"
33#include "vtcross/containers.h"
34#include "vtcross/debug.h"
35#include "vtcross/error.h"
36#include "vtcross/socketcomm.h"
37
38
39//typedef float (*array)[radioInfo->numParameters][radioInfo->numUtilities];
40
41class CBR_CE : public CognitiveEngine
42{
43    public:
44
45        /*! Default constructor. */
46        CBR_CE() : CognitiveEngine(){};
47        /*! Default destructor. */
48        ~CBR_CE(){};
49
50        /*! \brief Preferred constructor.
51         *
52         * Overloaded constructor that creates a cognitive engine object and
53         * connects it to either the shell or an SML, depening on the SML bool.
54         *
55         * The 'numFields' parameter sets how large the parameter, observable,
56         * and utility arrays should be upon instantiation.
57         */
58        CBR_CE(const char* serverName, const char* serverPort, \
59                const int32_t numFields, const bool SML);
60
61        /*! \brief Request that the CE optimize a set of parameters.
62         *
63         * Find the most optimal set of transmission parameters given certain
64         * observables and possibly a service if the SML component is present
65         * and active. */
66        Parameter *GetSolution(Observable *observables, \
67                Parameter *currentParameters, Utility *utilities);
68
69        /*! \brief Receive feedback from the radio
70         *
71         * Receive a feedback from the radio regarding the performance of a
72         * certain set of parameters, possibly associated with a service.
73         *
74         * Feedback is a single set of performance statistics that is achieved
75         * corresponding to a specific set of transmission parameters.  Feedback
76         * helps a Cognitive Engine make better future decisions based upon
77         * more accurate performance statistics.
78         */
79        void ReceiveFeedback(Observable *observables,Parameter *parameters, Utility *utilities);
80
81        /*! \brief Initialize the CE and prepare it for operation.
82         *
83         * BuildCognitiveEngine performs the CE implementation specific work
84         * that defines the internals of a CE.  For example, a CBR CE engine
85         * would build the case-base reasoner or create the database, a neural
86         * network based CE may perform the initial training, a GA based CE
87         * may build the chromosome structure.
88         */
89        void BuildCognitiveEngine();
90
91        /*! \brief Each of these functions responds to a specific command.
92         *
93         * These functions are left principally un-implemented. It is the duty
94         * of child classes to implement these functions, as they define the
95         * cognitive engine's functionality.
96         */
97
98        void PerformUpdatePerformance();
99        void PerformRequestOptimization();
100
101        void PerformResetEngineCognitive();
102        void PerformShutdownEngineCognitive();
103        void FineTune();
104
105        CBR *myCBR1;
106        CBR *myCBR2;
107
108
109};
110
111#endif
Note: See TracBrowser for help on using the browser.