[TeamTalk 329]: [865] trunk/TeamTalk: This is an intermediate commit.

tk@edam.speech.cs.cmu.edu tk at edam.speech.cs.cmu.edu
Wed Nov 7 00:38:33 EST 2007


An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071107/0c7dd113/attachment-0001.html
-------------- next part --------------
Modified: trunk/TeamTalk/Agents/TeamTalkBackend/TeamTalkBackend.vcproj
===================================================================
--- trunk/TeamTalk/Agents/TeamTalkBackend/TeamTalkBackend.vcproj	2007-11-02 11:47:06 UTC (rev 864)
+++ trunk/TeamTalk/Agents/TeamTalkBackend/TeamTalkBackend.vcproj	2007-11-07 05:38:33 UTC (rev 865)
@@ -43,7 +43,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\Libraries\Galaxy\include;..\..\Libraries\Galaxy\contrib\MITRE\utilities\include;..\..\Libraries\PrimitiveComm;..\..\Libraries\boeingLib\boeing;..\..\Libraries\boeingLib\coralshared;..\Pythia\PythiaDynamicClient"
+				AdditionalIncludeDirectories="&quot;$(OLYMPUS_ROOT)\Libraries\Galaxy\include&quot;;&quot;$(OLYMPUS_ROOT)\Libraries\Galaxy\contrib\MITRE\utilities\include&quot;;..\..\Libraries\PrimitiveComm;..\..\Libraries\boeingLib\boeing;..\..\Libraries\boeingLib\coralshared;&quot;$(OLYMPUS_ROOT)\Agents\Pythia\PythiaDynamicClient&quot;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -66,7 +66,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="wsock32.lib ..\..\Libraries\Galaxy\lib\x86-nt\libgalaxy_debug.lib"
+				AdditionalDependencies="wsock32.lib $(OLYMPUS_ROOT)\Libraries\Galaxy\lib\x86-nt\libgalaxy_debug.lib $(OLYMPUS_ROOT)\Agents\Pythia\PythiaDynamicClient\Debug\PythiaDynamicClient.lib"
 				OutputFile="$(OutDir)/TeamTalkBackend.exe"
 				LinkIncremental="2"
 				GenerateDebugInformation="true"
@@ -127,7 +127,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\Libraries\Galaxy\include;..\..\Libraries\Galaxy\contrib\MITRE\utilities\include;..\..\Libraries\PrimitiveComm;..\..\Libraries\boeingLib\boeing;..\..\Libraries\boeingLib\coralshared;..\Pythia\PythiaDynamicClient"
+				AdditionalIncludeDirectories="&quot;$(OLYMPUS_ROOT)\Libraries\Galaxy\include&quot;;&quot;$(OLYMPUS_ROOT)\Libraries\Galaxy\contrib\MITRE\utilities\include&quot;;..\..\Libraries\PrimitiveComm;..\..\Libraries\boeingLib\boeing;..\..\Libraries\boeingLib\coralshared;&quot;$(OLYMPUS_ROOT)\Agents\Pythia\PythiaDynamicClient&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE"
 				RuntimeLibrary="2"
 				StructMemberAlignment="3"
@@ -148,7 +148,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="..\..\Libraries\Galaxy\lib\x86-nt\libgalaxy.lib ws2_32.lib"
+				AdditionalDependencies="$(OLYMPUS_ROOT)\Libraries\Galaxy\lib\x86-nt\libgalaxy.lib $(OLYMPUS_ROOT)\Agents\Pythia\PythiaDynamicClient\Release\PythiaDynamicClient.lib ws2_32.lib"
 				OutputFile="$(OutDir)/TeamTalkBackend.exe"
 				LinkIncremental="1"
 				IgnoreAllDefaultLibraries="false"

Modified: trunk/TeamTalk/Agents/TeamTalkDM/BindingFilters.cpp
===================================================================
--- trunk/TeamTalk/Agents/TeamTalkDM/BindingFilters.cpp	2007-11-02 11:47:06 UTC (rev 864)
+++ trunk/TeamTalk/Agents/TeamTalkDM/BindingFilters.cpp	2007-11-07 05:38:33 UTC (rev 865)
@@ -68,19 +68,43 @@
 #include "BindingFilters.h"
 #include "DMInterfaces/DMInterface.h"
 #include "DMCore/Core.h"
-#include "DMCore/Inputs/PhoenixInput.h"
+#include "DMCore/Events/PhoenixInput.h"
 
 // D: Filter for transforming an ascii string representation of a date into 
-//    an actual date structure: uses the DateTime4 Hub Galaxt module
-string DateTime4_DateTimeBindingFilter(string sSlotName, string sSlotValue) {
+//    an actual date structure: uses the DateTime Hub Galaxy module
+string DateTimeBindingFilter(string sSlotName, string sSlotValue) {
 
+	bool bGotTime = false;
+
+    string sResult = "{\n";
+
+	// Get the parse of the last utterance
+	CPhoenixInput *parse = (CPhoenixInput*)pInteractionEventManager->GetLastInput();
+
+	string sParseString = "";
+	if (parse->Matches("[4_BusAfterThatRequest]")) {
+		sResult += "period_spec\tnow\n";
+		sResult += "time\t{\n";
+		sResult += "type\tdeparture\n";
+		sResult += "now\ttrue\n";
+		sResult += "}\n}";
+		return sResult;
+	}
+	else {
+//		THIS IS SOMEWHAT OF AN UGLY HACK:
+//      we recreate a Galaxy frame containing the parse from the input,
+//      so that it matches what DateTime expects...
+		sParseString = "{c parse :slots " + 
+			parse->GetStringProperty("[h4_gal_slotsframe]") + "}";
+	}
+
     // call the DateTime.ParseDateTime function and feed it the whole 
     // parse tree 
 	TGIGalaxyCall gcGalaxyCall;
 	gcGalaxyCall.sModuleFunction = "datetime.ParseDateTime";
     gcGalaxyCall.bBlockingCall = true;     
-	gcGalaxyCall.s2sInputs.insert(STRING2STRING::value_type(":Date_Time_Parse", 
-        ((CPhoenixInput *)(pInputManager->GetLastInput()))->PhoenixParseToString()));
+	gcGalaxyCall.s2sInputs.insert(STRING2STRING::value_type(":Date_Time_Parse",
+		sParseString));
     // set the outputs
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":month", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":day", ""));
@@ -88,7 +112,6 @@
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_date", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":start_time", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":end_time", ""));
-    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":time_duration", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":timeperiod_spec", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_time", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":past_date", ""));
@@ -112,70 +135,210 @@
 	GetMessage(&Message, NULL, WM_ACTIONFINISHED, WM_ACTIONFINISHED);
 
     // construct the results string
-    string sResult = "{\n";
-	// start with the date part
-	sResult += "date\t{\n";
     if(gcGalaxyCall.s2sOutputs[":valid_date"] == "true") {
-        if(gcGalaxyCall.s2sOutputs[":month"] != "") 
+		sResult += "date\t{\n";
+
+		if(gcGalaxyCall.s2sOutputs[":month"] != "") 
             sResult += "month\t" + gcGalaxyCall.s2sOutputs[":month"] + "\n";
         if(gcGalaxyCall.s2sOutputs[":day"] != "") 
             sResult += "day\t" + gcGalaxyCall.s2sOutputs[":day"] + "\n";
         if(gcGalaxyCall.s2sOutputs[":year"] != "") 
             sResult += "year\t" + gcGalaxyCall.s2sOutputs[":year"] + "\n";
-        sResult += "valid_date\ttrue\n";
-        if(gcGalaxyCall.s2sOutputs[":past_date"] != "") 
-            sResult += "past_date\t" + gcGalaxyCall.s2sOutputs[":past_date"] + "\n";
         if(gcGalaxyCall.s2sOutputs[":weekday"] != "") 
             sResult += "weekday\t" + gcGalaxyCall.s2sOutputs[":weekday"] + "\n";
+	
+		sResult += "}\n";
     }
-    if(gcGalaxyCall.s2sOutputs[":need_date"] != "") 
-        sResult += "need_date\t" + gcGalaxyCall.s2sOutputs[":need_date"] + "\n";
-    if(gcGalaxyCall.s2sOutputs[":date_exists"] != "") 
-        sResult += "date_exists\t" + gcGalaxyCall.s2sOutputs[":date_exists"] + "\n";
-    if(gcGalaxyCall.s2sOutputs[":ambiguous"] != "") 
-        sResult += "ambiguous\t" + gcGalaxyCall.s2sOutputs[":ambiguous"] + "\n";
-    else 
-        sResult += "ambiguous\tfalse\n";
-    if(gcGalaxyCall.s2sOutputs[":date_choice"] != "") 
-        sResult += "date_choice\t" + gcGalaxyCall.s2sOutputs[":date_choice"] + "\n";
-	// finish the date part
-	sResult += "}\n";
 
-	// start the time part
-	sResult += "time\t{\n";
 	if(gcGalaxyCall.s2sOutputs[":valid_time"] == "true") {
-        // hacks for adapting to the way DateTime4 returns default values in some of the
-        // fields (i.e start_time, end_time)
-        if((gcGalaxyCall.s2sOutputs[":start_time"] != "") &&
-           (gcGalaxyCall.s2sOutputs[":start_time"] != "0") &&
-		   ((atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) % 100) != 1))
-            sResult += "start_time\t" + gcGalaxyCall.s2sOutputs[":start_time"] + "\n";
-        if((gcGalaxyCall.s2sOutputs[":end_time"] != "") &&
-            (gcGalaxyCall.s2sOutputs[":end_time"] != "0") &&
-            ((atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) % 100) != 59) &&
-			((atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) % 100) != 99) &&
-            (gcGalaxyCall.s2sOutputs[":end_time"] != gcGalaxyCall.s2sOutputs[":start_time"]))
-            sResult += "end_time\t" + gcGalaxyCall.s2sOutputs[":end_time"] + "\n";
-        if(gcGalaxyCall.s2sOutputs[":valid_time"] != "") 
-            sResult += "valid_time\ttrue\n";
-        if(gcGalaxyCall.s2sOutputs[":day_skip"] != "") 
-            sResult += "day_skip\t" + gcGalaxyCall.s2sOutputs[":day_skip"] + "\n";
-        if(gcGalaxyCall.s2sOutputs[":past_time"] != "") 
-            sResult += "past_time\t" + gcGalaxyCall.s2sOutputs[":past_time"] + "\n";
-        if(gcGalaxyCall.s2sOutputs[":timeperiod_spec"] != "") 
-            sResult += "timeperiod_spec\t" + gcGalaxyCall.s2sOutputs[":timeperiod_spec"] + "\n";
-    }
-    if(gcGalaxyCall.s2sOutputs[":time_duration"] != "") 
-        sResult += "time_duration\t" + gcGalaxyCall.s2sOutputs[":time_duration"] + "\n";
-    	// finish the time part
+
+		sResult += "time\t{\n";
+
+		// for now, we ignore intervals (i.e. "morning" or "between two and three p m"
+		// and only accept exact times
+		if (gcGalaxyCall.s2sOutputs[":start_time"] == 
+			gcGalaxyCall.s2sOutputs[":end_time"]) {
+
+			if((gcGalaxyCall.s2sOutputs[":start_time"] != "") &&
+				(gcGalaxyCall.s2sOutputs[":start_time"] != "1199")) {
+					// This is a hack to infer am/pm
+					// "six" means 6am when it is 5am and 6pm when it is 5pm
+					time_t l_time;
+					time(&l_time);
+					struct tm s_time;
+					localtime_s(&s_time, &l_time);
+					int i_time = s_time.tm_hour*100 + s_time.tm_min;
+					int dt_time = atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str());
+					if (dt_time >= 1200) dt_time -= 1200;
+					if (i_time < 1200) {
+						// NB: if people say "six" at "6:10am" it still
+						// means "6am" (hence the "-15")
+						if (dt_time < i_time-15) dt_time += 1200;
+					}
+					else {
+						if (dt_time >= i_time-1215) dt_time += 1200;
+					}
+
+					if (gcGalaxyCall.s2sOutputs[":timeperiod_spec"] == "now ") {
+						char tmp[256];
+						sprintf_s(tmp, "value\t%d\n", dt_time);
+						sResult += tmp;
+						sResult += "now\ttrue\n";
+					}
+					else if ((gcGalaxyCall.s2sOutputs[":timeperiod_spec"] == "")&&
+							 (gcGalaxyCall.s2sOutputs[":day"] == "-1")) {
+						char tmp[256];
+						sprintf_s(tmp, "value\t%d\n", dt_time);
+						sResult += tmp;
+						
+					}
+					else {
+						sResult += "value\t" + gcGalaxyCall.s2sOutputs[":start_time"] + "\n";
+					}
+
+					bGotTime = true;
+				}
+		}
+
+		if (bGotTime) {
+			// Is the given time a desired departure or arrival time?
+			if (parse->Matches("[4_ArrivalTime]")||
+				parse->Matches("[3_ArrivalPlace]")||
+				parse->Matches("[DisambiguateArrival]")) {
+				sResult += "type\tarrival\n";
+			}
+			// Default value is departure
+			else {
+				sResult += "type\tdeparture\n";
+			}
+		}
+
+		sResult += "}\n";
+
+	}
+
+	// Adds the time period specifier if there is one
+	if (gcGalaxyCall.s2sOutputs[":timeperiod_spec"] != "") {
+		sResult += "period_spec\t" + gcGalaxyCall.s2sOutputs[":timeperiod_spec"] + "\n";
+	}
+
 	sResult += "}\n";
-	
-	// close it all
-	sResult += "}\n";
 
 
     return sResult;
 }
+//// D: Filter for transforming an ascii string representation of a date into 
+////    an actual date structure: uses the DateTime4 Hub Galaxt module
+//string DateTime4_DateTimeBindingFilter(string sSlotName, string sSlotValue) {
+//
+//    // call the DateTime.ParseDateTime function and feed it the whole 
+//    // parse tree 
+//	TGIGalaxyCall gcGalaxyCall;
+//	gcGalaxyCall.sModuleFunction = "datetime.ParseDateTime";
+//    gcGalaxyCall.bBlockingCall = true;     
+//	gcGalaxyCall.s2sInputs.insert(STRING2STRING::value_type(":Date_Time_Parse", 
+//        ((CPhoenixInput *)(pInputManager->GetLastInput()))->PhoenixParseToString()));
+//
+//    // set the outputs
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":month", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":day", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":year", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_date", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":start_time", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":end_time", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":time_duration", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":timeperiod_spec", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_time", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":past_date", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":day_skip", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":weekday", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":past_time", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":need_date", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":date_exists", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":ambiguous", ""));
+//    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":date_choice", ""));
+//
+//    // retrieve the current thread id
+//    DWORD dwThreadId = GetCurrentThreadId();
+//
+//    // send the message to the Galaxy Interface Thread
+//    PostThreadMessage(g_idDMInterfaceThread, WM_GALAXYCALL,
+//                      (WPARAM)&gcGalaxyCall, dwThreadId);	
+//	
+//	// and wait for a reply
+//	MSG Message;
+//	GetMessage(&Message, NULL, WM_ACTIONFINISHED, WM_ACTIONFINISHED);
+//
+//    // construct the results string
+//    string sResult = "{\n";
+//
+//	// start the time part
+//	sResult += "time\t{\n";
+//	if(gcGalaxyCall.s2sOutputs[":valid_time"] == "true") {
+//        // hacks for adapting to the way DateTime4 returns default values in some of the
+//        // fields (i.e start_time, end_time)
+//        if((gcGalaxyCall.s2sOutputs[":start_time"] != "") &&
+//           (gcGalaxyCall.s2sOutputs[":start_time"] != "0") &&
+//		   ((atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) % 100) != 1) &&
+//		   (atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) > 0) &&
+//		   (atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) < 2400) &&
+//		   ((atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) % 100) != 59) &&
+//		   ((atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) % 100) != 99))
+//            sResult += "start_time\t" + gcGalaxyCall.s2sOutputs[":start_time"] + "\n";
+//        if((gcGalaxyCall.s2sOutputs[":end_time"] != "") &&
+//            (gcGalaxyCall.s2sOutputs[":end_time"] != "0") &&
+//			((atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) % 100) != 1) &&
+// 		    (atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) > 0) &&
+//		    (atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) < 2400) &&
+//            ((atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) % 100) != 59) &&
+//			((atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) % 100) != 99) &&
+//            (gcGalaxyCall.s2sOutputs[":end_time"] != gcGalaxyCall.s2sOutputs[":start_time"]))
+//            sResult += "end_time\t" + gcGalaxyCall.s2sOutputs[":end_time"] + "\n";
+//        if(gcGalaxyCall.s2sOutputs[":timeperiod_spec"] != "") {
+//            string sTimePeriodSpec = Trim(gcGalaxyCall.s2sOutputs[":timeperiod_spec"]);
+//            if(sTimePeriodSpec == "pm") 
+//                sTimePeriodSpec = "afternoon";
+//            else if(sTimePeriodSpec == "am") 
+//                sTimePeriodSpec = "morning";
+//			if((sTimePeriodSpec != "anytime") && (sTimePeriodSpec != "now"))
+//				sResult += "timeperiod_spec\t" + sTimePeriodSpec + "\n";
+//        }
+//    }
+//    if(gcGalaxyCall.s2sOutputs[":time_duration"] != "") 
+//        sResult += "time_duration\t" + gcGalaxyCall.s2sOutputs[":time_duration"] + "\n";
+//   	// finish the time part
+//	sResult += "}\n";
+//
+//	// now do the date part
+//	sResult += "date\t{\n";
+//    if(gcGalaxyCall.s2sOutputs[":valid_date"] == "true") {
+//        if(gcGalaxyCall.s2sOutputs[":month"] != "") 
+//            sResult += "month\t" + gcGalaxyCall.s2sOutputs[":month"] + "\n";
+//        if(gcGalaxyCall.s2sOutputs[":day"] != "") 
+//            sResult += "day\t" + gcGalaxyCall.s2sOutputs[":day"] + "\n";
+//        if(gcGalaxyCall.s2sOutputs[":year"] != "") 
+//            sResult += "year\t" + gcGalaxyCall.s2sOutputs[":year"] + "\n";
+//        sResult += "valid_date\ttrue\n";
+//        if(gcGalaxyCall.s2sOutputs[":past_date"] != "") 
+//            sResult += "past_date\t" + gcGalaxyCall.s2sOutputs[":past_date"] + "\n";
+//        if(gcGalaxyCall.s2sOutputs[":weekday"] != "") 
+//            sResult += "weekday\t" + gcGalaxyCall.s2sOutputs[":weekday"] + "\n";
+//    }
+//    if(gcGalaxyCall.s2sOutputs[":ambiguous"] != "") 
+//        sResult += "ambiguous\t" + gcGalaxyCall.s2sOutputs[":ambiguous"] + "\n";
+//    else if(gcGalaxyCall.s2sOutputs[":valid_date"] == "true")
+//        sResult += "ambiguous\tfalse\n";
+//    if(gcGalaxyCall.s2sOutputs[":date_choice"] != "") 
+//        sResult += "date_choice\t" + gcGalaxyCall.s2sOutputs[":date_choice"] + "\n";
+//	// finish the date part
+//	sResult += "}\n";
+//	
+//	// close it all
+//	sResult += "}\n";
+//
+//
+//    return sResult;
+//}
 
 
 
@@ -185,15 +348,40 @@
 //    and if the start and end times are the same, then it considers it an
 //    end_time. This is basically just a hack to deal with inconsistencies in 
 //    DateTime4
-string DateTime4_EndTimeBindingFilter(string sSlotName, string sSlotValue) {
+string EndTimeBindingFilter(string sSlotName, string sSlotValue) {
 
+	bool bGotTime = false;
+
+    string sResult = "{\n";
+
+	// Get the parse of the last utterance
+	CPhoenixInput *parse = (CPhoenixInput*)pInteractionEventManager->GetLastInput();
+
+	string sParseString = "";
+	if (parse->Matches("[4_BusAfterThatRequest]")) {
+		sResult += "period_spec\tnow\n";
+		sResult += "time\t{\n";
+		sResult += "type\tdeparture\n";
+		sResult += "now\ttrue\n";
+		sResult += "}\n}";
+		return sResult;
+	}
+	else {
+//		THIS IS SOMEWHAT OF AN UGLY HACK:
+//      we recreate a Galaxy frame containing the parse from the input,
+//      so that it matches what DateTime expects...
+		sParseString = "{c parse :slots " + 
+			parse->GetStringProperty("[h4_gal_slotsframe]") + "}";
+	}
+
     // call the DateTime.ParseDateTime function and feed it the whole 
     // parse tree 
 	TGIGalaxyCall gcGalaxyCall;
 	gcGalaxyCall.sModuleFunction = "datetime.ParseDateTime";
     gcGalaxyCall.bBlockingCall = true;     
-	gcGalaxyCall.s2sInputs.insert(STRING2STRING::value_type(":Date_Time_Parse", 
-        ((CPhoenixInput *)(pInputManager->GetLastInput()))->PhoenixParseToString()));
+	gcGalaxyCall.s2sInputs.insert(STRING2STRING::value_type(":Date_Time_Parse",
+		sParseString));
+
     // set the outputs
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":month", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":day", ""));
@@ -201,7 +389,6 @@
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_date", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":start_time", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":end_time", ""));
-    gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":time_duration", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":timeperiod_spec", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_time", ""));
     gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":past_date", ""));
@@ -224,9 +411,6 @@
 	MSG Message;
 	GetMessage(&Message, NULL, WM_ACTIONFINISHED, WM_ACTIONFINISHED);
 
-    // construct the results string
-    string sResult = "{\n";
-
 	// only the time part
 	sResult += "time\t{\n";
     if(gcGalaxyCall.s2sOutputs[":valid_time"] == "true") {
@@ -283,4 +467,4 @@
 	GetMessage(&Message, NULL, WM_ACTIONFINISHED, WM_ACTIONFINISHED);
 
     return gcGalaxyCall.s2sOutputs[":number_int"];
-}
\ No newline at end of file
+}

Modified: trunk/TeamTalk/Agents/TeamTalkDM/BindingFilters.h
===================================================================
--- trunk/TeamTalk/Agents/TeamTalkDM/BindingFilters.h	2007-11-02 11:47:06 UTC (rev 864)
+++ trunk/TeamTalk/Agents/TeamTalkDM/BindingFilters.h	2007-11-07 05:38:33 UTC (rev 865)
@@ -73,7 +73,7 @@
 
 // D: Filter for transforming an ascii string representation of a date into 
 //    an actual date structure: uses the DateTime4 Hub Galaxt module
-string DateTime4_DateTimeBindingFilter(string sSlotName, string sSlotValue);
+string DateTimeBindingFilter(string sSlotName, string sSlotValue);
 
 // D: Filter for transforming an ascii string representation of a date into 
 //    an actual date structure: uses the DateTime4 Hub Galaxt module. This
@@ -81,7 +81,7 @@
 //    and if the start and end times are the same, then it considers it an
 //    end_time. This is basically just a hack to deal with inconsistencies in 
 //    DateTime4
-string DateTime4_EndTimeBindingFilter(string sSlotName, string sSlotValue);
+string EndTimeBindingFilter(string sSlotName, string sSlotValue);
 
 // D: Filter for transforming an ascii string representation of a number (i.e.
 //    five hundred thirty four) to the ascii numerical representation (i.e. 

Modified: trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj
===================================================================
--- trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj	2007-11-02 11:47:06 UTC (rev 864)
+++ trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj	2007-11-07 05:38:33 UTC (rev 865)
@@ -43,7 +43,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".;..\..\Libraries\RavenClaw\DialogTask;..\..\Libraries\RavenClaw;..\..\Libraries\Galaxy\include"
+				AdditionalIncludeDirectories=".;&quot;$(OLYMPUS_ROOT)\Libraries\RavenClaw\DialogTask&quot;;&quot;$(OLYMPUS_ROOT)\Libraries\RavenClaw&quot;;&quot;$(OLYMPUS_ROOT)\Libraries\Galaxy\include&quot;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32;GALAXY"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="0"
@@ -69,7 +69,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="user32.lib ws2_32.lib ..\..\Libraries\Galaxy\lib\x86-nt\libGalaxy_debug.lib"
+				AdditionalDependencies="user32.lib ws2_32.lib $(OLYMPUS_ROOT)\Libraries\Galaxy\lib\x86-nt\libGalaxy_debug.lib $(OLYMPUS_ROOT)\Libraries\Ravenclaw\Lib\DebugGalaxy\Ravenclaw.lib"
 				OutputFile="$(OutDir)/TeamTalkDM.exe"
 				LinkIncremental="2"
 				SuppressStartupBanner="true"
@@ -135,7 +135,7 @@
 				Optimization="2"
 				InlineFunctionExpansion="1"
 				OmitFramePointers="true"
-				AdditionalIncludeDirectories=".;..\..\Libraries\RavenClaw\DialogTask;..\..\Libraries\RavenClaw;..\..\Libraries\Galaxy\include"
+				AdditionalIncludeDirectories=".;&quot;$(OLYMPUS_ROOT)\Libraries\RavenClaw\DialogTask&quot;;&quot;$(OLYMPUS_ROOT)\Libraries\RavenClaw&quot;;&quot;$(OLYMPUS_ROOT)\Libraries\Galaxy\include&quot;"
 				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GALAXY"
 				StringPooling="true"
 				RuntimeLibrary="2"
@@ -157,7 +157,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="user32.lib ws2_32.lib ..\..\Libraries\Galaxy\lib\x86-nt\libGalaxy.lib"
+				AdditionalDependencies="user32.lib ws2_32.lib $(OLYMPUS_ROOT)\Libraries\Galaxy\lib\x86-nt\libGalaxy.lib $(OLYMPUS_ROOT)\Libraries\Ravenclaw\Lib\ReleaseGalaxy\Ravenclaw.lib"
 				OutputFile="$(OutDir)/TeamTalkDM.exe"
 				LinkIncremental="1"
 				GenerateDebugInformation="true"

Modified: trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDialogTask.cpp
===================================================================
--- trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDialogTask.cpp	2007-11-02 11:47:06 UTC (rev 864)
+++ trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDialogTask.cpp	2007-11-07 05:38:33 UTC (rev 865)
@@ -40,21 +40,6 @@
 //                          for the TeamTalk system
 // 
 // ----------------------------------------------------------------------------
-// 
-// BEFORE MAKING CHANGES TO THIS CODE, please read the appropriate 
-// documentation, available in the Documentation folder. 
-//
-// ANY SIGNIFICANT CHANGES made should be reflected back in the documentation
-// file(s)
-//
-// ANY CHANGES made (even small bug fixes, should be reflected in the history
-// below, in reverse chronological order
-// 
-// HISTORY --------------------------------------------------------------------
-//
-//   [2002-10-16] (dbohus): started working on this - created a skeleton DM
-//
-//-----------------------------------------------------------------------------
 
 #include "DialogTask.h"
 #include "BindingFilters.h"
@@ -64,12 +49,9 @@
 // DM GALAXY SERVER CONFIGURATION
 //
 //-----------------------------------------------------------------------------
-//#ifdef GALAXY
-//    DMSERVER_CONFIGURATION(NULL, 0)
-//#endif
 extern "C" {
-   char* lpszDMServerName;
-   int iDMServerPort;
+  char* lpszDMServerName;
+  int iDMServerPort;
 }
 
 //-----------------------------------------------------------------------------
@@ -78,1608 +60,1381 @@
 //
 //-----------------------------------------------------------------------------
 CORE_CONFIGURATION(
+  USE_ALL_GROUNDING_ACTIONS("")
 
-	USE_ALL_GROUNDING_ACTIONS("")
-				   
-	// declare the NLG as the single output device
-	USE_OUTPUT_DEVICES(
-		DEFAULT_OUTPUT_DEVICE("nlg", "nlg.launch_query", 1)
-		OUTPUT_DEVICE("select_bot", "PenDecoder.select_bot", 1)
-	)
+  // declare the NLG as the single output device
+  USE_OUTPUT_DEVICES(
+    DEFAULT_OUTPUT_DEVICE("nlg", "nlg.launch_query", 1)
+    OUTPUT_DEVICE("select_bot", "PenDecoder.select_bot", 1)
+  )
 
-    DEFINE_CONFIDENCE_SLOTNAME([h3_confidence])
+  DEFINE_CONFIDENCE_SLOTNAME([h3_confidence])
 
-	// long timeout
-	DEFAULT_TIMEOUT_PERIOD(100000)
+  // long timeout
+  DEFAULT_TIMEOUT_PERIOD(100000)
 
-	// declare the library agents to be used in the tree
-    // the terminate agent
-    USE_LIBRARY_AGENTS(
-	    LIBRARY_AGENT(CTerminate, Terminate, RegisterTerminateAgent, "")
+  // declare the library agents to be used in the tree
+  // the terminate agent
+  USE_LIBRARY_AGENTS(
+    LIBRARY_AGENT(CTerminate, Terminate, RegisterTerminateAgent, "")
 
-        // various help agents
-        LIBRARY_AGENT(CHelp, Help, RegisterHelpAgent, "")
-        LIBRARY_AGENT(CHelpGetTips, HelpGetTips, RegisterHelpGetTipsAgent, "")
-        LIBRARY_AGENT(CHelpEstablishContext, HelpEstablishContext, 
-            RegisterHelpEstablishContextAgent, "")
-        LIBRARY_AGENT(CHelpWhatCanISay, HelpWhatCanISay, 
-            RegisterHelpWhatCanISayAgent, "")
-		LIBRARY_AGENT(CHelpSystemCapabilities, HelpSystemCapabilities,
-			RegisterHelpSystemCapabilitiesAgent, "")
+    // various help agents
+    LIBRARY_AGENT(CHelp, Help, RegisterHelpAgent, "")
+    LIBRARY_AGENT(CHelpGetTips, HelpGetTips, RegisterHelpGetTipsAgent, "")
+    LIBRARY_AGENT(CHelpEstablishContext, HelpEstablishContext, 
+                  RegisterHelpEstablishContextAgent, "")
+    LIBRARY_AGENT(CHelpWhatCanISay, HelpWhatCanISay, 
+                  RegisterHelpWhatCanISayAgent, "")
+    LIBRARY_AGENT(CHelpSystemCapabilities, HelpSystemCapabilities,
+                  RegisterHelpSystemCapabilitiesAgent, "")
 
-        // repeat handling agent
-        LIBRARY_AGENT(CRepeat, Repeat, RegisterRepeatAgent, "")
+    // repeat handling agent
+    LIBRARY_AGENT(CRepeat, Repeat, RegisterRepeatAgent, "")
 
-        // suspend handling agency
-        LIBRARY_AGENT(CSuspend, Suspend, RegisterSuspendAgency, "")
+    // suspend handling agency
+    LIBRARY_AGENT(CSuspend, Suspend, RegisterSuspendAgency, "")
 
-        // timeout handling agency
-        LIBRARY_AGENT(CTimeoutTerminate, TimeoutTerminate, 
-            RegisterTimeoutTerminateAgency, "")
+    // timeout handling agency
+    LIBRARY_AGENT(CTimeoutTerminate, TimeoutTerminate, 
+                  RegisterTimeoutTerminateAgency, "")
 
-        // start-over handling agency
-        LIBRARY_AGENT(CStartOver, StartOver, RegisterStartOverAgency, "")
+    // start-over handling agency
+    LIBRARY_AGENT(CStartOver, StartOver, RegisterStartOverAgency, "")
 
-        // quit handling agency
-        LIBRARY_AGENT(CQuit, Quit, RegisterQuitAgency, "")
-    )
+    // quit handling agency
+    LIBRARY_AGENT(CQuit, Quit, RegisterQuitAgency, "")
+  )
 
-    // declare the binding filters
-    USE_BINDING_FILTERS(
-        // the date-time binding filter
-        BINDING_FILTER("datetime", DateTime4_DateTimeBindingFilter)
-        // the end-time binding filter
-        BINDING_FILTER("endtime", DateTime4_EndTimeBindingFilter)
-        // the number binding filter (used for room sizes)
-        BINDING_FILTER("number", DateTime4_NumberBindingFilter)
-    )
+  // declare the binding filters
+  USE_BINDING_FILTERS(
+    // the date-time binding filter
+    BINDING_FILTER("datetime", DateTimeBindingFilter)
+    // the end-time binding filter
+    BINDING_FILTER("endtime", EndTimeBindingFilter)
+    // the number binding filter (used for room sizes)
+    BINDING_FILTER("number", DateTime4_NumberBindingFilter)
+  )
 )
 
 //-----------------------------------------------------------------------------
 //
-// STRUCTURED CONCEPT TYPES SPECIFICATION
+// AGENT SPECIFICATIONS
 //
 //-----------------------------------------------------------------------------
 
 //-----------------------------------------------------------------------------
-// D: Definition of the CDateTime structured concept class; this class follows
-//    the return specification of the DateTime4 Hub Galaxy agent
-//-----------------------------------------------------------------------------
-
-// Date concept
-/*
-DEFINE_FRAME_CONCEPT_TYPE( CDateConcept, 
-    INT_ITEM( month )
-    INT_ITEM( day )
-    INT_ITEM( year )
-    BOOL_ITEM( valid_date )
-    BOOL_ITEM( past_date )
-    INT_ITEM( weekday )
-    BOOL_ITEM( need_date )
-    BOOL_ITEM( date_exists )
-    BOOL_ITEM( ambiguous )
-    STRING_ITEM( date_choice )
-)
-
-// Time concept
-DEFINE_FRAME_CONCEPT_TYPE( CTimeConcept, 
-    INT_ITEM( start_time )
-    INT_ITEM( end_time )
-    INT_ITEM( time_duration )
-    STRING_ITEM( timeperiod_spec )
-    BOOL_ITEM( valid_time )
-    INT_ITEM( day_skip )
-    BOOL_ITEM( past_time )
-)
-
-// DateTime concept
-DEFINE_FRAME_CONCEPT_TYPE( CDateTimeConcept,
-	CUSTOM_ITEM(date, CDateConcept)
-	CUSTOM_ITEM(time, CTimeConcept)
-)
-
-// Room query concept
-DEFINE_FRAME_CONCEPT_TYPE( CRoomQuery,
-    CUSTOM_ITEM( date_time, CDateTimeConcept )
-    STRING_ITEM( room_location )
-    INT_ITEM( room_number )
-    INT_ITEM( room_size )
-    STRING_ITEM( room_size_spec )
-    BOOL_ITEM( room_projector )
-    BOOL_ITEM( room_network )
-    BOOL_ITEM( room_whiteboard )
-    BOOL_ITEM( room_computer )
-)
-
-// Room query refinement concept
-DEFINE_FRAME_CONCEPT_TYPE( CRoomQueryRefinement,
-    STRING_ITEM( location )
-    INT_ITEM( size )
-    STRING_ITEM( size_spec )
-    STRING_ITEM( equip )
-)
-
-// Room result concept
-DEFINE_FRAME_CONCEPT_TYPE( CRoomResult, 
-    CUSTOM_ITEM( date_time, CDateTimeConcept )
-    STRING_ITEM( room_location )
-    INT_ITEM( room_number )
-    INT_ITEM( room_size )
-    STRING_ITEM( room_size_spec )
-    BOOL_ITEM( room_projector )
-    BOOL_ITEM( room_network )
-    BOOL_ITEM( room_whiteboard )
-    BOOL_ITEM( room_computer )
-)
-*/
-
-// Array of results from the backend
-//DEFINE_ARRAY_CONCEPT_TYPE(CRoomResult, none, CQueryResults)
-
-//-----------------------------------------------------------------------------
-//
-// AGENT SPECIFICATIONS
-//
-//-----------------------------------------------------------------------------
- 
-//-----------------------------------------------------------------------------
 // /TeamTalk
 //-----------------------------------------------------------------------------
 DEFINE_AGENCY(CTeamTalk,
-	IS_MAIN_TOPIC()
-    DEFINE_CONCEPTS(
-        STRING_USER_CONCEPT(current_addressee, "")
-		STRING_SYSTEM_CONCEPT(robot_name)
-		STRING_SYSTEM_CONCEPT(everyone)
-	)
-	DEFINE_SUBAGENTS(
-    //SUBAGENT(InformAddressChange, CInformAddresseeChange, "")
-		//SUBAGENT(InformReport, CInformReport, "")
-		SUBAGENT(GetCurrentAddressee, CGetCurrentAddressee, "")
-		SUBAGENT(PerformTask, CTask, "")
-	)
-	ON_INITIALIZATION(
-		C("robot_name") = lpszDMServerName;
-		C("everyone") = "EVERYONE";
-		C("current_addressee") = "EVERYONE";
-	)
+              IS_MAIN_TOPIC()
+              DEFINE_CONCEPTS(
+                STRING_USER_CONCEPT(current_addressee, "")
+                STRING_SYSTEM_CONCEPT(robot_name)
+                STRING_SYSTEM_CONCEPT(everyone)
+              )
+              DEFINE_SUBAGENTS(
+                SUBAGENT(GetCurrentAddressee, CGetCurrentAddressee, "")
+                SUBAGENT(PerformTask, CTask, "")
+              )
+              ON_INITIALIZATION(
+                C("robot_name") = lpszDMServerName;
+                C("everyone") = "EVERYONE";
+                C("current_addressee") = "EVERYONE";
+              )
 )	
 
 //-----------------------------------------------------------------------------
-// /TeamTalk/Welcome
-//-----------------------------------------------------------------------------
-//DEFINE_INFORM_AGENT( CWelcome,
-//    PROMPT(":non-interruptable inform welcome"))
-
-//-----------------------------------------------------------------------------
 // /TeamTalk/GetCurrentAddressee
 //-----------------------------------------------------------------------------
-DEFINE_AGENCY( CGetCurrentAddressee, 
-	// This agency consists of an expect agent which binds the value of the slot 
-	// [RobotName] to the concept current_addressee (so that we know who is being
-	// addressed currently) and an execute agent that reopens the current_addressee
-	// concept so that future occurrences of the [RobotName] slot can be bound too.
-			  
-	// We need to trigger this agency if the concept current_addressee just got 
-	// updated (as indicated by 0 TURNS_SINCE_LAST_UPDATED of concept 
-	// current_addressee being. However ReOpen() sets TURNS_SINCE_LAST_UPDATED to 0.
-	// To prevent that from triggering the agency, we also need to know that 
-	// current_addressee was UPDATED.
+DEFINE_AGENCY(CGetCurrentAddressee, 
+              // This agency consists of an expect agent which binds the value of the slot 
+              // [RobotName] to the concept current_addressee (so that we know who is being
+              // addressed currently) and an execute agent that reopens the current_addressee
+              // concept so that future occurrences of the [RobotName] slot can be bound too.
 
-  TRIGGERED_BY(UPDATED_IN_LAST_TURN(current_addressee))
-	PRECONDITION(false)
-	DEFINE_SUBAGENTS(
-		SUBAGENT(ExpectAddressee, CExpectAddressee, "")
-		SUBAGENT(InformAddresseeChange, CInformAddresseeChange, "")
-		SUBAGENT(ExecuteReopenAddressee, CExecuteReopenAddressee, "")
-	)
-	ON_COMPLETION(RESET)
+              // We need to trigger this agency if the concept current_addressee just got 
+              // updated (as indicated by 0 TURNS_SINCE_LAST_UPDATED of concept 
+              // current_addressee being. However ReOpen() sets TURNS_SINCE_LAST_UPDATED to 0.
+              // To prevent that from triggering the agency, we also need to know that 
+              // current_addressee was UPDATED.
+
+              TRIGGERED_BY(UPDATED_IN_LAST_TURN(current_addressee))
+              PRECONDITION(false)
+              DEFINE_SUBAGENTS(
+                SUBAGENT(ExpectAddressee, CExpectAddressee, "")
+                SUBAGENT(InformAddresseeChange, CInformAddresseeChange, "")
+                SUBAGENT(ExecuteReopenAddressee, CExecuteReopenAddressee, "")
+              )
+              ON_COMPLETION(RESET)
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/GetCurrentAddressee/ExpectAddressee
 //-----------------------------------------------------------------------------
-DEFINE_EXPECT_AGENT( CExpectAddressee, 
-	EXPECT_CONCEPT(current_addressee)
-    GRAMMAR_MAPPING("@(/TeamTalk)[RobotName]")
+DEFINE_EXPECT_AGENT(CExpectAddressee, 
+                    EXPECT_CONCEPT(current_addressee)
+                    GRAMMAR_MAPPING("@(/TeamTalk)[RobotName]")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/GetCurrentAddressee/ExpectAddressee
 //-----------------------------------------------------------------------------
 DEFINE_INFORM_AGENT(CInformAddresseeChange, 
-	PROMPT(":select_bot inform select_bot <current_addressee")
+                    PROMPT(":select_bot inform select_bot <current_addressee")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/GetCurrentAddressee/ExecuteReopenAddressee
 //-----------------------------------------------------------------------------
-DEFINE_EXECUTE_AGENT( CExecuteReopenAddressee, 
-	EXECUTE(C("current_addressee").ReOpen())
+DEFINE_EXECUTE_AGENT(CExecuteReopenAddressee, 
+                     EXECUTE(C("current_addressee").ReOpen())
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task
 //-----------------------------------------------------------------------------
-DEFINE_AGENCY( CTask,
-	IS_MAIN_TOPIC()
-    DEFINE_CONCEPTS(
-		BOOL_USER_CONCEPT(report_command_issued, "")
-		BOOL_USER_CONCEPT(report_location_command_issued, "")
-		STRING_SYSTEM_CONCEPT(location_report)
-    STRING_SYSTEM_CONCEPT(move_report)
-    STRING_SYSTEM_CONCEPT(error_report)
-		BOOL_USER_CONCEPT(move_cardinal_command_issued, "")
-		BOOL_USER_CONCEPT(move_relative_command_issued, "")
-		BOOL_USER_CONCEPT(move_to_goal_command_issued, "")
-		BOOL_USER_CONCEPT(search_command_issued, "")
-    BOOL_USER_CONCEPT(explore_command_issued, "")
-		BOOL_USER_CONCEPT(halt_command_issued, "")
-		BOOL_USER_CONCEPT(follow_command_issued, "")
-		BOOL_USER_CONCEPT(pause_command_issued, "")
-		BOOL_USER_CONCEPT(continue_command_issued, "")
-		BOOL_USER_CONCEPT(turn_command_issued, "")
-    BOOL_USER_CONCEPT(set_pose_command_issued, "")
-    BOOL_USER_CONCEPT(cancel_task_command_issued, "")
-		BOOL_USER_CONCEPT(cancel, "")
-	)
-	DEFINE_SUBAGENTS(
-		SUBAGENT(RequestWaitForCommands, CRequestWaitForCommands, "")
-		SUBAGENT(Report, CReport, "")
-	  SUBAGENT(QueryLocation, CQueryLocation, "")
-		SUBAGENT(ReportLocation, CReportLocation, "")
-		SUBAGENT(MoveCardinal, CMoveCardinal, "")
-		SUBAGENT(MoveToGoal, CMoveToGoal, "")
-		SUBAGENT(Search, CSearch, "")
-    SUBAGENT(Explore, CExplore, "")
-		SUBAGENT(CommandMoveRelative, CCommandMoveRelative, "")
-    SUBAGENT(ReportMove, CReportMove, "")
-    SUBAGENT(ReportError, CReportError, "")
-		SUBAGENT(Halt, CHalt, "")
-		SUBAGENT(Follow, CFollow, "")
-		SUBAGENT(Pause, CPause, "")
-		SUBAGENT(Continue, CContinue, "")
-		SUBAGENT(Turn, CTurn, "")
-    SUBAGENT(SetPose, CSetPose, "")
-    SUBAGENT(CancelTask, CCancelTask, "")
-    //SUBAGENT(RetrieveTreasure, CRetrieveTreasure, "")
-		SUBAGENT(ExpectCancel, CExpectCancel, "")
-		SUBAGENT(AllDoneDummy, CAllDoneDummy, "")
-	)
-	SUCCEEDS_WHEN(COMPLETED(AllDoneDummy))
-	ON_COMPLETION(RESET)
+DEFINE_AGENCY(CTask,
+              IS_MAIN_TOPIC()
+              DEFINE_CONCEPTS(
+                BOOL_USER_CONCEPT(report_command_issued, "")
+                BOOL_USER_CONCEPT(report_location_command_issued, "")
+                STRING_SYSTEM_CONCEPT(location_report)
+                STRING_SYSTEM_CONCEPT(move_report)
+                STRING_SYSTEM_CONCEPT(error_report)
+                BOOL_USER_CONCEPT(move_cardinal_command_issued, "")
+                BOOL_USER_CONCEPT(move_relative_command_issued, "")
+                BOOL_USER_CONCEPT(move_to_goal_command_issued, "")
+                BOOL_USER_CONCEPT(search_command_issued, "")
+                BOOL_USER_CONCEPT(explore_command_issued, "")
+                BOOL_USER_CONCEPT(halt_command_issued, "")
+                BOOL_USER_CONCEPT(follow_command_issued, "")
+                BOOL_USER_CONCEPT(pause_command_issued, "")
+                BOOL_USER_CONCEPT(continue_command_issued, "")
+                BOOL_USER_CONCEPT(turn_command_issued, "")
+                BOOL_USER_CONCEPT(set_pose_command_issued, "")
+                BOOL_USER_CONCEPT(cancel_task_command_issued, "")
+                BOOL_USER_CONCEPT(cancel, "")
+              )
+              DEFINE_SUBAGENTS(
+                SUBAGENT(RequestWaitForCommands, CRequestWaitForCommands, "")
+                SUBAGENT(Report, CReport, "")
+                SUBAGENT(QueryLocation, CQueryLocation, "")
+                SUBAGENT(ReportLocation, CReportLocation, "")
+                SUBAGENT(MoveCardinal, CMoveCardinal, "")
+                SUBAGENT(MoveToGoal, CMoveToGoal, "")
+                SUBAGENT(Search, CSearch, "")
+                SUBAGENT(Explore, CExplore, "")
+                SUBAGENT(CommandMoveRelative, CCommandMoveRelative, "")
+                SUBAGENT(ReportMove, CReportMove, "")
+                SUBAGENT(ReportError, CReportError, "")
+                SUBAGENT(Halt, CHalt, "")
+                SUBAGENT(Follow, CFollow, "")
+                SUBAGENT(Pause, CPause, "")
+                SUBAGENT(Continue, CContinue, "")
+                SUBAGENT(Turn, CTurn, "")
+                SUBAGENT(SetPose, CSetPose, "")
+                SUBAGENT(CancelTask, CCancelTask, "")
+                //SUBAGENT(RetrieveTreasure, CRetrieveTreasure, "")
+                SUBAGENT(ExpectCancel, CExpectCancel, "")
+                SUBAGENT(AllDoneDummy, CAllDoneDummy, "")
+              )
+              SUCCEEDS_WHEN(COMPLETED(AllDoneDummy))
+              ON_COMPLETION(RESET)
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/RequestWaitForCommands
 //-----------------------------------------------------------------------------
-DEFINE_REQUEST_AGENT( CRequestWaitForCommands, 
-	PROMPT("request nothing")
-	TIMEOUT_PERIOD(1000000)
+DEFINE_REQUEST_AGENT(CRequestWaitForCommands, 
+                     PROMPT("request nothing")
+                     TIMEOUT_PERIOD(1000000)
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/Report
 //-----------------------------------------------------------------------------
 DEFINE_AGENCY(CReport,
- 	PRECONDITION(IS_TRUE(report_command_issued) &&
-	  	(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-		*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	DEFINE_SUBAGENTS(
-		SUBAGENT(ExpectReportCommand, CExpectReportCommand, "")
-		SUBAGENT(InformReport, CInformReport, "")
-	)
+              PRECONDITION(IS_TRUE(report_command_issued) &&
+                           (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+                            *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+              DEFINE_SUBAGENTS(
+                SUBAGENT(ExpectReportCommand, CExpectReportCommand, "")
+                SUBAGENT(InformReport, CInformReport, "")
+              )
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/Report/ExpectReportCommand
 //-----------------------------------------------------------------------------
 DEFINE_EXPECT_AGENT(CExpectReportCommand,
-	EXPECT_CONCEPT(report_command_issued)
-	GRAMMAR_MAPPING("[HumanReportCommand]>true")
+                    EXPECT_CONCEPT(report_command_issued)
+                    GRAMMAR_MAPPING("[HumanReportCommand]>true")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/Report/InformReport
 //-----------------------------------------------------------------------------
 DEFINE_INFORM_AGENT(CInformReport, 
-	PROMPT("inform my_report <robot_name")
+                    PROMPT("inform my_report <robot_name")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/QueryLocation
 //-----------------------------------------------------------------------------
 DEFINE_AGENCY(CQueryLocation,
-	DEFINE_CONCEPTS(
-        STRING_SYSTEM_CONCEPT(location)
-	)
-	PRECONDITION(IS_TRUE(report_location_command_issued) &&
-	  	(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-		*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	DEFINE_SUBAGENTS(
-		SUBAGENT(ExpectQueryLocationCommand, CExpectQueryLocationCommand, "")
-		SUBAGENT(ExecuteGetLocation, CExecuteGetLocation, "")
-	)
+              DEFINE_CONCEPTS(
+                STRING_SYSTEM_CONCEPT(location)
+              )
+              PRECONDITION(IS_TRUE(report_location_command_issued) &&
+                           (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+                            *C("current_addressee").CreateMergedHistoryConcept() == C("everyone"))
+              )
+              DEFINE_SUBAGENTS(
+                SUBAGENT(ExpectQueryLocationCommand, CExpectQueryLocationCommand, "")
+                SUBAGENT(ExecuteGetLocation, CExecuteGetLocation, "")
+              )
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/QueryLocation/ExpectQueryLocationCommand
 //-----------------------------------------------------------------------------
 DEFINE_EXPECT_AGENT(CExpectQueryLocationCommand,
-	EXPECT_CONCEPT(report_location_command_issued)
-	//EXPECT_WHEN(
- 	//	(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	GRAMMAR_MAPPING("[HumanLocationQuery]>true")
+                    EXPECT_CONCEPT(report_location_command_issued)
+                    GRAMMAR_MAPPING("[HumanLocationQuery]>true")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/QueryLocation/ExecuteGetLocation
 //-----------------------------------------------------------------------------
 DEFINE_EXECUTE_AGENT(CExecuteGetLocation,
-	CALL("gal_be.launch_query query=location_query <robot_name")
+                     CALL("gal_be.launch_query query=location_query <robot_name")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/ReportLocation
 //-----------------------------------------------------------------------------
 DEFINE_AGENCY(CReportLocation,
-	PRECONDITION(UPDATED(location_report) &&
-	  	(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-		*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	DEFINE_SUBAGENTS(
-		SUBAGENT(ExpectReportLocationCommand, CExpectReportLocationCommand, "")
-		SUBAGENT(InformLocation, CInformLocation, "")
-	)
+              PRECONDITION(UPDATED(location_report) &&
+                           (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+                            *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+              DEFINE_SUBAGENTS(
+                SUBAGENT(ExpectReportLocationCommand, CExpectReportLocationCommand, "")
+                SUBAGENT(InformLocation, CInformLocation, "")
+              )
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/ReportLocation/ExpectReportLocationCommand
 //-----------------------------------------------------------------------------
 DEFINE_EXPECT_AGENT(CExpectReportLocationCommand,
-	EXPECT_CONCEPT(location_report)
-	EXPECT_WHEN(
- 		(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-		*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	GRAMMAR_MAPPING("[RobotMessage.Location]")
+                    EXPECT_CONCEPT(location_report)
+                    EXPECT_WHEN(
+                      (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+                       *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+                    GRAMMAR_MAPPING("[RobotMessage.Location]")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/ReportLocation/InformLocation
 //-----------------------------------------------------------------------------
 DEFINE_INFORM_AGENT(CInformLocation,
-	PROMPT("inform report_location <robot_name location<location_report")
+                    PROMPT("inform report_location <robot_name location<location_report")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/MoveCardinal
 //-----------------------------------------------------------------------------
 DEFINE_AGENCY(CMoveCardinal,
-	DEFINE_CONCEPTS(
-		STRING_USER_CONCEPT(distance, "expl")
-    STRING_USER_CONCEPT(direction, "expl")
-		STRING_SYSTEM_CONCEPT(report)
-	)
-	PRECONDITION(IS_TRUE(move_cardinal_command_issued) 
-     && (UPDATED(distance) || UPDATED(direction)) &&
-	  	(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-		*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	DEFINE_SUBAGENTS(
-		SUBAGENT(ExpectMoveCardinalCommand, CExpectMoveCardinalCommand, "")
-		SUBAGENT(RequestDistance, CRequestDistance, "")
-		SUBAGENT(RequestCardinalDirection, CRequestCardinalDirection, "")
-		SUBAGENT(ExecuteMove, CExecuteMove, "")
-		SUBAGENT(InformReaction2Move, CInformReaction2Move, "")
-	)
-	SUCCEEDS_WHEN(COMPLETED(InformReaction2Move) || UPDATED_IN_LAST_TURN(cancel))
+              DEFINE_CONCEPTS(
+                STRING_USER_CONCEPT(distance, "expl")
+                STRING_USER_CONCEPT(direction, "expl")
+                STRING_SYSTEM_CONCEPT(report)
+              )
+              PRECONDITION(IS_TRUE(move_cardinal_command_issued) && 
+                           (UPDATED(distance) || UPDATED(direction)) &&
+                           (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+                            *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+              DEFINE_SUBAGENTS(
+                SUBAGENT(ExpectMoveCardinalCommand, CExpectMoveCardinalCommand, "")
+                SUBAGENT(RequestDistance, CRequestDistance, "")
+                SUBAGENT(RequestCardinalDirection, CRequestCardinalDirection, "")
+                SUBAGENT(ExecuteMove, CExecuteMove, "")
+                SUBAGENT(InformReaction2Move, CInformReaction2Move, "")
+              )
+              SUCCEEDS_WHEN(COMPLETED(InformReaction2Move) || UPDATED_IN_LAST_TURN(cancel))
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/CommandMoveRelative
 //-----------------------------------------------------------------------------
 DEFINE_AGENCY(CCommandMoveRelative,
-	DEFINE_CONCEPTS(
-    STRING_USER_CONCEPT(direction, "expl")
-		STRING_USER_CONCEPT(distance, "expl")
-		STRING_USER_CONCEPT(units, "")
-    STRING_SYSTEM_CONCEPT(report)
-	)
-	PRECONDITION(IS_TRUE(move_relative_command_issued) 
-    && (UPDATED(distance) || UPDATED(direction)) &&
-	  (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-		*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	DEFINE_SUBAGENTS(
-		SUBAGENT(ExpectMoveRelativeCommand, CExpectMoveRelativeCommand, "")
-		SUBAGENT(RequestMoveDirection, CRequestMoveDirection, "")
-		SUBAGENT(RequestRelativeDistance, CRequestRelativeDistance, "")
-		SUBAGENT(ExecuteRelativeMove, CExecuteRelativeMove, "")
-	)
-	SUCCEEDS_WHEN(COMPLETED(ExecuteRelativeMove) || UPDATED_IN_LAST_TURN(cancel))
+              DEFINE_CONCEPTS(
+                STRING_USER_CONCEPT(direction, "expl")
+                STRING_USER_CONCEPT(distance, "expl")
+                STRING_USER_CONCEPT(units, "")
+                STRING_SYSTEM_CONCEPT(report)
+              )
+              PRECONDITION(IS_TRUE(move_relative_command_issued) && 
+                           (UPDATED(distance) || UPDATED(direction)) &&
+                           (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+                            *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+              DEFINE_SUBAGENTS(
+                SUBAGENT(ExpectMoveRelativeCommand, CExpectMoveRelativeCommand, "")
+                SUBAGENT(RequestMoveDirection, CRequestMoveDirection, "")
+                SUBAGENT(RequestRelativeDistance, CRequestRelativeDistance, "")
+                SUBAGENT(ExecuteRelativeMove, CExecuteRelativeMove, "")
+              )
+              SUCCEEDS_WHEN(COMPLETED(ExecuteRelativeMove) || UPDATED_IN_LAST_TURN(cancel))
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/MoveCardinal/ExpectMoveCardinalCommand
 //-----------------------------------------------------------------------------
 DEFINE_EXPECT_AGENT(CExpectMoveCardinalCommand,
-	EXPECT_CONCEPT(move_cardinal_command_issued)
-	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	GRAMMAR_MAPPING("[MoveVectorCardinal]>true")
+                    EXPECT_CONCEPT(move_cardinal_command_issued)
+                    GRAMMAR_MAPPING("[MoveVectorCardinal]>true")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/MoveRelative/ExpectMoveRelativeCommand
 //-----------------------------------------------------------------------------
 DEFINE_EXPECT_AGENT(CExpectMoveRelativeCommand,
-	EXPECT_CONCEPT(move_relative_command_issued)
-	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	GRAMMAR_MAPPING("[MoveVectorRelative]>true")
+                    EXPECT_CONCEPT(move_relative_command_issued)
+                    GRAMMAR_MAPPING("[MoveVectorRelative]>true")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/Move/RequestCardinalDirection
 //-----------------------------------------------------------------------------
 DEFINE_REQUEST_AGENT(CRequestCardinalDirection,
-	REQUEST_CONCEPT(direction)
-	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	PROMPT("request direction <distance")
-	GRAMMAR_MAPPING("[MoveVectorCardinal.CardinalDirection],![CardinalDirection]")
+                     REQUEST_CONCEPT(direction)
+                     PROMPT("request direction <distance")
+                     GRAMMAR_MAPPING("[MoveVectorCardinal.CardinalDirection],![CardinalDirection]")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/Move/RequestMoveDirection
 //-----------------------------------------------------------------------------
 DEFINE_REQUEST_AGENT(CRequestMoveDirection,
-	REQUEST_CONCEPT(direction)
-	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	PROMPT("request direction <distance")
-	GRAMMAR_MAPPING("[MoveVectorRelative.MoveDirection],![MoveDirection]")
+                     REQUEST_CONCEPT(direction)
+                     PROMPT("request direction <distance")
+                     GRAMMAR_MAPPING("[MoveVectorRelative.MoveDirection],![MoveDirection]")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/Move/RequestDistance	
 //-----------------------------------------------------------------------------
 DEFINE_REQUEST_AGENT(CRequestDistance,
-	REQUEST_CONCEPT(distance)
-	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	PROMPT("request distance <direction")
-	GRAMMAR_MAPPING("![AbsoluteDistance.Number-20],[MoveVectorCardinal.AbsoluteDistance.Number-20]")
+                     REQUEST_CONCEPT(distance)
+                     PROMPT("request distance <direction")
+                     GRAMMAR_MAPPING("![AbsoluteDistance.Number-20],[MoveVectorCardinal.AbsoluteDistance.Number-20]")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/Move/RequestRelativeDistance	
 //-----------------------------------------------------------------------------
 DEFINE_REQUEST_AGENT(CRequestRelativeDistance,
-	REQUEST_CONCEPT(distance)
-	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	PROMPT("request distance <direction")
-	GRAMMAR_MAPPING("![AbsoluteDistance.Number-20],[MoveVectorRelative.AbsoluteDistance.Number-20]")
+                     REQUEST_CONCEPT(distance)
+                     PROMPT("request distance <direction")
+                     GRAMMAR_MAPPING("![AbsoluteDistance.Number-20],[MoveVectorRelative.AbsoluteDistance.Number-20]")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/Move/ExecuteMove
 //-----------------------------------------------------------------------------
 DEFINE_EXECUTE_AGENT(CExecuteMove,
-	PRECONDITION(AVAILABLE(direction) && AVAILABLE(distance))
-    CALL("gal_be.launch_query query=move_cardinal_command <robot_name <distance <direction >report")
+                     PRECONDITION(AVAILABLE(direction) && AVAILABLE(distance))
+                     CALL("gal_be.launch_query query=move_cardinal_command <robot_name <distance <direction >report")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/Move/ExecuteRelativeMove
 //-----------------------------------------------------------------------------
 DEFINE_EXECUTE_AGENT(CExecuteRelativeMove,
-	PRECONDITION(AVAILABLE(direction) && AVAILABLE(distance))
-    CALL("gal_be.launch_query query=move_relative_command <robot_name <distance <direction >report")
+                     PRECONDITION(AVAILABLE(direction) && AVAILABLE(distance))
+                     CALL("gal_be.launch_query query=move_relative_command <robot_name <distance <direction >report")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/ReportMove
 //-----------------------------------------------------------------------------
 DEFINE_AGENCY(CReportMove,
-	PRECONDITION(UPDATED(move_report) &&
-	  (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-		 *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	DEFINE_SUBAGENTS(
-		SUBAGENT(ExpectReportMove, CExpectReportMove, "")
-		SUBAGENT(InformMove, CInformMove, "")
-	)
+              PRECONDITION(UPDATED(move_report) &&
+                           (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+                            *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+              DEFINE_SUBAGENTS(
+                SUBAGENT(ExpectReportMove, CExpectReportMove, "")
+                SUBAGENT(InformMove, CInformMove, "")
+              )
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/ReportMove/ExpectReportMove
 //-----------------------------------------------------------------------------
 DEFINE_EXPECT_AGENT(CExpectReportMove,
-	EXPECT_CONCEPT(move_report)
-	EXPECT_WHEN(
- 		(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
-		 *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
-	GRAMMAR_MAPPING("[RobotMessage.Move]")
+                    EXPECT_CONCEPT(move_report)
+                    EXPECT_WHEN(
+                      (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+                       *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+                    GRAMMAR_MAPPING("[RobotMessage.Move]")
 )
 
 //-----------------------------------------------------------------------------
 // /TeamTalk/Task/ReportMove/InformMove
 //-----------------------------------------------------------------------------
 DEFINE_INFORM_AGENT(CInformMove,
-	PROMPT("inform report_move_status <robot_name <move_report")
+                    PROMPT("inform report_move_status <robot_name <move_report")
 )
 

@@ Diff output truncated at 60000 characters. @@


More information about the TeamTalk-developers mailing list