Index: /vtcross/trunk/src/cognitive_engines/CBR_CE/CognitiveEngine.cpp
===================================================================
--- /vtcross/trunk/src/cognitive_engines/CBR_CE/CognitiveEngine.cpp	(revision 468)
+++ /vtcross/trunk/src/cognitive_engines/CBR_CE/CognitiveEngine.cpp	(revision 473)
@@ -19,4 +19,5 @@
 #include <stdint.h>
 #include <cmath>
+#include <string>
 
 #include "vtcross/cbr.h"
@@ -28,4 +29,6 @@
 #include "vtcross/socketcomm.h"
 
+using namespace std;
+
 static CBR *myCBR;
 
@@ -85,5 +88,4 @@
         ReceiveRadioConfiguration();
         ReceiveExperience();
-        
         RegisterServices();
     }
@@ -109,21 +111,21 @@
     float valList[numberColumns];
     float obsVals[numberColumns];
-    char *nameList[numberColumns];
-    char *obsList[obsColumns];
+    string nameList[numberColumns];
+    string obsList[obsColumns];
 
     size_t columnObsIndex = 0;
     for (size_t i = 0; i < radioInfo->numObservables; i++){
-        obsList[columnObsIndex] = (char*)observables[i].name.c_str();
+        obsList[columnObsIndex] = observables[i].name;
         columnObsIndex++;
     }  
-    obsList[columnObsIndex] = (char *) "utility";
+    obsList[columnObsIndex] = "utility";
 
     size_t columnIndex = 0;
     for (size_t i = 0; i < radioInfo->numParameters; i++){
-        nameList[columnIndex] = (char*)parameters[i].name.c_str();
+        nameList[columnIndex] = (char*)parameters[i].name;
         columnIndex++;
     }   
     for (size_t i = 0; i < radioInfo->numUtilities; i++){
-        nameList[columnIndex] = (char*)uList[i].name.c_str();
+        nameList[columnIndex] = (char*)uList[i].name;
         columnIndex++;
     }   
@@ -636,8 +638,8 @@
     LOG("Cognitive Engine:: Generating solution.\n");
 
-    char *searchNames[radioInfo->numUtilities];
+    string searchNames[radioInfo->numUtilities];
 
     for(size_t i = 0; i < radioInfo->numUtilities; i++) {
-        searchNames[i] = (char*)observables[i].name.c_str();
+        searchNames[i] = (char*)observables[i].name;
     }
 
@@ -648,8 +650,6 @@
     }
 
-    uint32_t numberColumns = 
-        radioInfo->numUtilities +
-        radioInfo->numParameters +
-        radioInfo->numObservables + 1;
+    uint32_t numberColumns = radioInfo->numUtilities + radioInfo->numParameters \
+                             + radioInfo->numObservables + 1;
     
     float returnValues[numberColumns];
@@ -723,24 +723,24 @@
     returnValues[returnValueIndex] = 0;
 
-    char *allNames[numberColumns];
+    string allNames[numberColumns];
     size_t allNameIndex = 0;
     for(size_t i = 0; i < radioInfo->numUtilities; i++) {
-        allNames[allNameIndex] = (char*)uList[i].name.c_str();
+        allNames[allNameIndex] = (char*)uList[i].name;
         returnValues[allNameIndex] = uList[i].target;
         allNameIndex++;
     }
     for(size_t i = 0; i < radioInfo->numParameters; i++) {
-        allNames[allNameIndex] = (char*)pList[i].name.c_str();
+        allNames[allNameIndex] = (char*)pList[i].name;
         allNameIndex++;
     }
     for(size_t i = 0; i < radioInfo->numObservables; i++) {
-        allNames[allNameIndex] = (char*)oList[i].name.c_str();
+        allNames[allNameIndex] = (char*)oList[i].name;
         returnValues[allNameIndex] = 0;
         allNameIndex++;
     }
-    allNames[allNameIndex] = (char *)"utility";
+    allNames[allNameIndex] = "utility";
 
     // Add row to CBR. 
-    myCBR->AddRow(allNames, returnValues, returnValueIndex+1);
+    myCBR->AddRow(allNames, returnValues, returnValueIndex + 1);
 
     return pList;
@@ -769,28 +769,26 @@
 CognitiveEngine::BuildCognitiveEngine()
 {
-    char filename[] = {"ex1"};
-    char tablename[] = {"data"};
-
-    uint32_t numberColumns = 
-        radioInfo->numUtilities +
-        radioInfo->numParameters +
-        radioInfo->numObservables + 1;
-
-    char *cols[numberColumns];
+    string filename = "ex1";
+    string tablename = "data";
+
+    uint32_t numberColumns = radioInfo->numUtilities + radioInfo->numParameters \
+                             + radioInfo->numObservables + 1;
+
+    string cols[numberColumns];
 
     size_t columnIndex = 0;
     for (size_t i = 0; i < radioInfo->numUtilities; i++){
-        cols[columnIndex] = (char*)uList[i].name.c_str();
+        cols[columnIndex] = (char*)uList[i].name;
         columnIndex++;
     }   
     for (size_t i = 0; i < radioInfo->numParameters; i++){
-        cols[columnIndex] = (char*)pList[i].name.c_str();
+        cols[columnIndex] = (char*)pList[i].name;
         columnIndex++;
     }   
     for (size_t i = 0; i < radioInfo->numObservables; i++){
-        cols[columnIndex] = (char*)oList[i].name.c_str();
+        cols[columnIndex] = (char*)oList[i].name;
         columnIndex++;
     }   
-    cols[columnIndex] = (char *) "utility";
+    cols[columnIndex] = "utility";
 
     myCBR = new CBR(filename, tablename, cols, numberColumns);
