[TeamTalk 219]: [755] trunk/TeamTalk/Agents/TeamTalkDM/zap2DialogTask.cpp: reverted mistaken deletion

tk@edam.speech.cs.cmu.edu tk at edam.speech.cs.cmu.edu
Fri Sep 21 00:16:42 EDT 2007


An HTML attachment was scrubbed...
URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20070921/667a9684/attachment-0001.html
-------------- next part --------------
Copied: trunk/TeamTalk/Agents/TeamTalkDM/zap2DialogTask.cpp (from rev 750, trunk/TeamTalk/Agents/TeamTalkDM/zap2DialogTask.cpp)
===================================================================
--- trunk/TeamTalk/Agents/TeamTalkDM/zap2DialogTask.cpp	                        (rev 0)
+++ trunk/TeamTalk/Agents/TeamTalkDM/zap2DialogTask.cpp	2007-09-21 04:16:42 UTC (rev 755)
@@ -0,0 +1,3022 @@
+//=============================================================================
+//
+//   Copyright (c) 2000-2004, Carnegie Mellon University.  
+//   All rights reserved.
+//
+//   Redistribution and use in source and binary forms, with or without
+//   modification, are permitted provided that the following conditions
+//   are met:
+//
+//   1. Redistributions of source code must retain the above copyright
+//      notice, this list of conditions and the following disclaimer. 
+//
+//   2. Redistributions in binary form must reproduce the above copyright
+//      notice, this list of conditions and the following disclaimer in
+//      the documentation and/or other materials provided with the
+//      distribution.
+//
+//   This work was supported in part by funding from the Defense Advanced 
+//   Research Projects Agency and the National Science Foundation of the 
+//   United States of America, and the CMU Sphinx Speech Consortium.
+//
+//   THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND 
+//   ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
+//   THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+//   PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY
+//   NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+//   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
+//   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+//   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
+//   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+//   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+//   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+//=============================================================================
+
+//-----------------------------------------------------------------------------
+// 
+// ZAP2DIALOGTASK.CPP - This module contains the description of the dialog 
+//                          task, (i.e. all the user defined agencies, etc)
+//                          for the zap2 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"
+
+//-----------------------------------------------------------------------------
+//
+// DM GALAXY SERVER CONFIGURATION
+//
+//-----------------------------------------------------------------------------
+//#ifdef GALAXY
+//    DMSERVER_CONFIGURATION(NULL, 0)
+//#endif
+extern "C" {
+   char* lpszDMServerName;
+   int iDMServerPort;
+}
+
+//-----------------------------------------------------------------------------
+//
+// DIALOG CORE CONFIGURATION
+//
+//-----------------------------------------------------------------------------
+CORE_CONFIGURATION(
+
+	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)
+	)
+
+    DEFINE_CONFIDENCE_SLOTNAME([h3_confidence])
+
+	// 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, "")
+
+        // 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, "")
+
+        // suspend handling agency
+        LIBRARY_AGENT(CSuspend, Suspend, RegisterSuspendAgency, "")
+
+        // timeout handling agency
+        LIBRARY_AGENT(CTimeoutTerminate, TimeoutTerminate, 
+            RegisterTimeoutTerminateAgency, "")
+
+        // start-over handling agency
+        LIBRARY_AGENT(CStartOver, StartOver, RegisterStartOverAgency, "")
+
+        // 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)
+    )
+)
+
+//-----------------------------------------------------------------------------
+//
+// STRUCTURED CONCEPT TYPES SPECIFICATION
+//
+//-----------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------
+// 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
+//
+//-----------------------------------------------------------------------------
+ 
+//-----------------------------------------------------------------------------
+// /zap2
+//-----------------------------------------------------------------------------
+DEFINE_AGENCY(Czap2,
+	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";
+	)
+)	
+
+//-----------------------------------------------------------------------------
+// /zap2/Welcome
+//-----------------------------------------------------------------------------
+//DEFINE_INFORM_AGENT( CWelcome,
+//    PROMPT(":non-interruptable inform welcome"))
+
+//-----------------------------------------------------------------------------
+// /zap2/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.
+
+  TRIGGERED_BY(UPDATED_IN_LAST_TURN(current_addressee))
+	PRECONDITION(false)
+	DEFINE_SUBAGENTS(
+		SUBAGENT(ExpectAddressee, CExpectAddressee, "")
+		SUBAGENT(InformAddresseeChange, CInformAddresseeChange, "")
+		SUBAGENT(ExecuteReopenAddressee, CExecuteReopenAddressee, "")
+	)
+	ON_COMPLETION(RESET)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/GetCurrentAddressee/ExpectAddressee
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT( CExpectAddressee, 
+	EXPECT_CONCEPT(current_addressee)
+    GRAMMAR_MAPPING("@(/zap2)[RobotName]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/GetCurrentAddressee/ExpectAddressee
+//-----------------------------------------------------------------------------
+DEFINE_INFORM_AGENT(CInformAddresseeChange, 
+	PROMPT(":select_bot inform select_bot <current_addressee")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/GetCurrentAddressee/ExecuteReopenAddressee
+//-----------------------------------------------------------------------------
+DEFINE_EXECUTE_AGENT( CExecuteReopenAddressee, 
+	EXECUTE(C("current_addressee").ReOpen())
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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)
+		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(Halt, CHalt, "")
+		SUBAGENT(Follow, CFollow, "")
+		SUBAGENT(Pause, CPause, "")
+		SUBAGENT(Continue, CContinue, "")
+		SUBAGENT(Turn, CTurn, "")
+    SUBAGENT(SetPose, CSetPose, "")
+    SUBAGENT(CancelTask, CCancelTask, "")
+		SUBAGENT(ExpectCancel, CExpectCancel, "")
+		SUBAGENT(AllDoneDummy, CAllDoneDummy, "")
+	)
+	SUCCEEDS_WHEN(COMPLETED(AllDoneDummy))
+	ON_COMPLETION(RESET)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/RequestWaitForCommands
+//-----------------------------------------------------------------------------
+DEFINE_REQUEST_AGENT( CRequestWaitForCommands, 
+	// PROMPT("request idle <robot_name")
+	TIMEOUT_PERIOD(1000000)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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, "")
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Report/ExpectReportCommand
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectReportCommand,
+	EXPECT_CONCEPT(report_command_issued)
+	GRAMMAR_MAPPING("[HumanReportCommand]>true")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Report/InformReport
+//-----------------------------------------------------------------------------
+DEFINE_INFORM_AGENT(CInformReport, 
+	PROMPT("inform my_report <robot_name")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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, "")
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/QueryLocation/ExecuteGetLocation
+//-----------------------------------------------------------------------------
+DEFINE_EXECUTE_AGENT(CExecuteGetLocation,
+	CALL("gal_be.launch_query query=location_query <robot_name")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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, "")
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/ReportLocation/InformLocation
+//-----------------------------------------------------------------------------
+DEFINE_INFORM_AGENT(CInformLocation,
+	PROMPT("inform report_location <robot_name location<location_report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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))
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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))
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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, "")
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/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]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/ReportMove/InformMove
+//-----------------------------------------------------------------------------
+DEFINE_INFORM_AGENT(CInformMove,
+	PROMPT("inform report_move_status <robot_name <move_report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Move/InformReaction2Move
+//-----------------------------------------------------------------------------
+DEFINE_INFORM_AGENT(CInformReaction2Move,
+	PROMPT("inform report_move_relative <robot_name <direction <distance <report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/MoveToGoal
+//-----------------------------------------------------------------------------
+DEFINE_AGENCY(CMoveToGoal,
+	DEFINE_CONCEPTS(
+        INT_USER_CONCEPT(relDist, "")
+		STRING_USER_CONCEPT(dir, "")
+		STRING_USER_CONCEPT(ordinal, "expl")
+		STRING_SYSTEM_CONCEPT(report)
+	)
+	PRECONDITION(IS_TRUE(move_to_goal_command_issued) && 
+		(UPDATED(dir) || UPDATED(ordinal) || UPDATED(relDist)) &&
+	  	(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+		   *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	DEFINE_SUBAGENTS(
+		SUBAGENT(ExpectMoveToGoalCommand, CExpectMoveToGoalCommand, "")
+		SUBAGENT(ExpectRelDist, CExpectRelDist, "")
+		SUBAGENT(ExpectDir, CExpectDir, "")
+		SUBAGENT(ExpectOrdinal, CExpectOrdinal, "")
+		SUBAGENT(ExecuteMoveToGoal, CExecuteMoveToGoal, "")
+		SUBAGENT(InformMoveToGoalReport, CInformMoveToGoalReport, "")
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/MoveToGoal/ExpectMoveToGoalCommand
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectMoveToGoalCommand,
+	EXPECT_CONCEPT(move_to_goal_command_issued)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[MoveToGoal]>true")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/MoveToGoal/ExpectRelDist
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectRelDist,
+	EXPECT_CONCEPT(relDist)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING(
+		"[MoveToGoal.RelativeDistance.ZapAll]>1,"\
+		"[MoveToGoal.RelativeDistance.ZapHalf]>2,"\
+		"[MoveToGoal.RelativeDistance.ZapThird]>3,"\
+		"[MoveToGoal.RelativeDistance.ZapOneQuarter]>4,"\
+		"[MoveToGoal.RelativeDistance.ZapTwoThird]>5,"\
+		"[MoveToGoal.RelativeDistance.ZapThreeQuarter]>6"
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/MoveToGoal/ExpectDir
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectDir,
+	EXPECT_CONCEPT(dir)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[MoveToGoal.Side]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/MoveToGoal/ExpectOrdinal
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectOrdinal,
+	EXPECT_CONCEPT(ordinal)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[MoveToGoal.Goal],[MoveToGoal.Home]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/MoveToGoal/ExecuteMoveToGoal
+//-----------------------------------------------------------------------------
+DEFINE_EXECUTE_AGENT(CExecuteMoveToGoal,
+    PRECONDITION(AVAILABLE(ordinal))
+    CALL("gal_be.launch_query query=move_to_goal_command <robot_name <relDist <dir <ordinal >report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/MoveToGoal/InformMoveToGoalReport
+//-----------------------------------------------------------------------------
+DEFINE_INFORM_AGENT(CInformMoveToGoalReport,
+	PROMPT("inform report_move_to_goal <robot_name <ordinal <report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search
+//-----------------------------------------------------------------------------
+DEFINE_AGENCY(CSearch,
+	DEFINE_CONCEPTS(
+    FLOAT_USER_CONCEPT(x1, "")
+    FLOAT_USER_CONCEPT(x2, "")
+		FLOAT_USER_CONCEPT(x3, "")
+		FLOAT_USER_CONCEPT(x4, "")
+		FLOAT_USER_CONCEPT(x5, "")
+		FLOAT_USER_CONCEPT(x6, "")
+		FLOAT_USER_CONCEPT(x7, "")
+		FLOAT_USER_CONCEPT(x8, "")
+		FLOAT_USER_CONCEPT(x9, "")
+		FLOAT_USER_CONCEPT(x10, "")
+    FLOAT_USER_CONCEPT(y1, "")
+    FLOAT_USER_CONCEPT(y2, "")
+		FLOAT_USER_CONCEPT(y3, "")
+		FLOAT_USER_CONCEPT(y4, "")
+		FLOAT_USER_CONCEPT(y5, "")
+		FLOAT_USER_CONCEPT(y6, "")
+		FLOAT_USER_CONCEPT(y7, "")
+		FLOAT_USER_CONCEPT(y8, "")
+		FLOAT_USER_CONCEPT(y9, "")
+		FLOAT_USER_CONCEPT(y10, "")
+		STRING_SYSTEM_CONCEPT(report)
+	)
+	PRECONDITION(IS_TRUE(search_command_issued) && 
+		(UPDATED(x1) && UPDATED(y1)) &&
+	  	(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+		   *C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	DEFINE_SUBAGENTS(
+		SUBAGENT(ExpectSearchCommand, CExpectSearchCommand, "")
+		SUBAGENT(ExpectX1, CExpectX1, "")
+		SUBAGENT(ExpectX2, CExpectX2, "")
+		SUBAGENT(ExpectX3, CExpectX3, "")
+		SUBAGENT(ExpectX4, CExpectX4, "")
+		SUBAGENT(ExpectX5, CExpectX5, "")
+		SUBAGENT(ExpectX6, CExpectX6, "")
+		SUBAGENT(ExpectX7, CExpectX7, "")
+		SUBAGENT(ExpectX8, CExpectX8, "")
+		SUBAGENT(ExpectX9, CExpectX9, "")
+		SUBAGENT(ExpectX10, CExpectX10, "")
+		SUBAGENT(ExpectY1, CExpectY1, "")
+		SUBAGENT(ExpectY2, CExpectY2, "")
+		SUBAGENT(ExpectY3, CExpectY3, "")
+		SUBAGENT(ExpectY4, CExpectY4, "")
+		SUBAGENT(ExpectY5, CExpectY5, "")
+		SUBAGENT(ExpectY6, CExpectY6, "")
+		SUBAGENT(ExpectY7, CExpectY7, "")
+		SUBAGENT(ExpectY8, CExpectY8, "")
+		SUBAGENT(ExpectY9, CExpectY9, "")
+		SUBAGENT(ExpectY10, CExpectY10, "")
+		SUBAGENT(ExecuteSearch, CExecuteSearch, "")
+		SUBAGENT(InformSearchReport, CInformSearchReport, "")
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectSearchCommand
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectSearchCommand,
+	EXPECT_CONCEPT(search_command_issued)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand]>true")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectX1
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectX1,
+	EXPECT_CONCEPT(x1)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.x1]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectX2
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectX2,
+	EXPECT_CONCEPT(x2)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.x2]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectX3
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectX3,
+	EXPECT_CONCEPT(x3)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.x3]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectX4
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectX4,
+	EXPECT_CONCEPT(x4)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.x4]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectX5
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectX5,
+	EXPECT_CONCEPT(x5)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.x5]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectX6
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectX6,
+	EXPECT_CONCEPT(x6)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.x6]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectX7
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectX7,
+	EXPECT_CONCEPT(x7)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.x7]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectX8
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectX8,
+	EXPECT_CONCEPT(x8)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.x8]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectX9
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectX9,
+	EXPECT_CONCEPT(x9)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.x9]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectX10
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectX10,
+	EXPECT_CONCEPT(x10)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.x10]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectY1
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectY1,
+	EXPECT_CONCEPT(y1)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.y1]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectY2
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectY2,
+	EXPECT_CONCEPT(y2)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.y2]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectY3
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectY3,
+	EXPECT_CONCEPT(y3)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.y3]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectY4
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectY4,
+	EXPECT_CONCEPT(y4)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.y4]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectY5
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectY5,
+	EXPECT_CONCEPT(y5)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.y5]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectY6
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectY6,
+	EXPECT_CONCEPT(y6)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.y6]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectY7
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectY7,
+	EXPECT_CONCEPT(y7)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.y7]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectY8
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectY8,
+	EXPECT_CONCEPT(y8)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.y8]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectY9
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectY9,
+	EXPECT_CONCEPT(y9)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.y9]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExpectY10
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectY10,
+	EXPECT_CONCEPT(y10)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanSearchCommand.y10]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/ExecuteSearch
+//-----------------------------------------------------------------------------
+DEFINE_EXECUTE_AGENT(CExecuteSearch,
+    CALL("gal_be.launch_query query=search_command <robot_name <x1 <x2 <x3 <x4 <x5 <x6 <x7 <x8 <x9 <x10 <y1 <y2 <y3 <y4 <y5 <y6 <y7 <y8 <y9 <y10 >report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Search/InformSearchReport
+//-----------------------------------------------------------------------------
+DEFINE_INFORM_AGENT(CInformSearchReport,
+	PROMPT("inform report_search <robot_name <x1 <x2 <x3 <x4 <x5 <x6 <x7 <x8 <x9 <x10 <y1 <y2 <y3 <y4 <y5 <y6 <y7 <y8 <y9 <y10 <report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore
+//-----------------------------------------------------------------------------
+DEFINE_AGENCY(CExplore,
+	DEFINE_CONCEPTS(
+        FLOAT_USER_CONCEPT(x1, "")
+        FLOAT_USER_CONCEPT(x2, "")
+		FLOAT_USER_CONCEPT(x3, "")
+		FLOAT_USER_CONCEPT(x4, "")
+		FLOAT_USER_CONCEPT(x5, "")
+		FLOAT_USER_CONCEPT(x6, "")
+		FLOAT_USER_CONCEPT(x7, "")
+		FLOAT_USER_CONCEPT(x8, "")
+		FLOAT_USER_CONCEPT(x9, "")
+		FLOAT_USER_CONCEPT(x10, "")
+        FLOAT_USER_CONCEPT(y1, "")
+        FLOAT_USER_CONCEPT(y2, "")
+		FLOAT_USER_CONCEPT(y3, "")
+		FLOAT_USER_CONCEPT(y4, "")
+		FLOAT_USER_CONCEPT(y5, "")
+		FLOAT_USER_CONCEPT(y6, "")
+		FLOAT_USER_CONCEPT(y7, "")
+		FLOAT_USER_CONCEPT(y8, "")
+		FLOAT_USER_CONCEPT(y9, "")
+		FLOAT_USER_CONCEPT(y10, "")
+		STRING_SYSTEM_CONCEPT(report)
+	)
+	PRECONDITION(IS_TRUE(explore_command_issued) && 
+		(UPDATED(x1) && UPDATED(y1)) &&
+	  	(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+		*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	DEFINE_SUBAGENTS(
+		SUBAGENT(ExpectExploreCommand, CExpectExploreCommand, "")
+		SUBAGENT(ExpectExploreX1, CExpectExploreX1, "")
+		SUBAGENT(ExpectExploreX2, CExpectExploreX2, "")
+		SUBAGENT(ExpectExploreX3, CExpectExploreX3, "")
+		SUBAGENT(ExpectExploreX4, CExpectExploreX4, "")
+		SUBAGENT(ExpectExploreX5, CExpectExploreX5, "")
+		SUBAGENT(ExpectExploreX6, CExpectExploreX6, "")
+		SUBAGENT(ExpectExploreX7, CExpectExploreX7, "")
+		SUBAGENT(ExpectExploreX8, CExpectExploreX8, "")
+		SUBAGENT(ExpectExploreX9, CExpectExploreX9, "")
+		SUBAGENT(ExpectExploreX10, CExpectX10, "")
+		SUBAGENT(ExpectExploreY1, CExpectExploreY1, "")
+		SUBAGENT(ExpectExploreY2, CExpectExploreY2, "")
+		SUBAGENT(ExpectExploreY3, CExpectExploreY3, "")
+		SUBAGENT(ExpectExploreY4, CExpectExploreY4, "")
+		SUBAGENT(ExpectExploreY5, CExpectExploreY5, "")
+		SUBAGENT(ExpectExploreY6, CExpectExploreY6, "")
+		SUBAGENT(ExpectExploreY7, CExpectExploreY7, "")
+		SUBAGENT(ExpectExploreY8, CExpectExploreY8, "")
+		SUBAGENT(ExpectExploreY9, CExpectExploreY9, "")
+		SUBAGENT(ExpectExploreY10, CExpectExploreY10, "")
+		SUBAGENT(ExecuteExplore, CExecuteExplore, "")
+		SUBAGENT(InformExploreReport, CInformExploreReport, "")
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreCommand
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreCommand,
+	EXPECT_CONCEPT(explore_command_issued)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand]>true")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreX1
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreX1,
+	EXPECT_CONCEPT(x1)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.x1]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreX2
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreX2,
+	EXPECT_CONCEPT(x2)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.x2]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreX3
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreX3,
+	EXPECT_CONCEPT(x3)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.x3]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreX4
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreX4,
+	EXPECT_CONCEPT(x4)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.x4]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreX5
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreX5,
+	EXPECT_CONCEPT(x5)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.x5]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreX6
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreX6,
+	EXPECT_CONCEPT(x6)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.x6]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreX7
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreX7,
+	EXPECT_CONCEPT(x7)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.x7]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreX8
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreX8,
+	EXPECT_CONCEPT(x8)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.x8]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreX9
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreX9,
+	EXPECT_CONCEPT(x9)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.x9]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreX10
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreX10,
+	EXPECT_CONCEPT(x10)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.x10]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreY1
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreY1,
+	EXPECT_CONCEPT(y1)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.y1]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreY2
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreY2,
+	EXPECT_CONCEPT(y2)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.y2]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreY3
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreY3,
+	EXPECT_CONCEPT(y3)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.y3]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreY4
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreY4,
+	EXPECT_CONCEPT(y4)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.y4]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreY5
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreY5,
+	EXPECT_CONCEPT(y5)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.y5]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreY6
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreY6,
+	EXPECT_CONCEPT(y6)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.y6]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreY7
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreY7,
+	EXPECT_CONCEPT(y7)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.y7]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreY8
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreY8,
+	EXPECT_CONCEPT(y8)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.y8]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreY9
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreY9,
+	EXPECT_CONCEPT(y9)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.y9]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExpectExploreY10
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectExploreY10,
+	EXPECT_CONCEPT(y10)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanExploreCommand.y10]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/ExecuteExplore
+//-----------------------------------------------------------------------------
+DEFINE_EXECUTE_AGENT(CExecuteExplore,
+    CALL("gal_be.launch_query query=explore_command <robot_name <x1 <x2 <x3 <x4 <x5 <x6 <x7 <x8 <x9 <x10 <y1 <y2 <y3 <y4 <y5 <y6 <y7 <y8 <y9 <y10 >report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Explore/InformExploreReport
+//-----------------------------------------------------------------------------
+DEFINE_INFORM_AGENT(CInformExploreReport,
+	PROMPT("inform report_explore <robot_name <x1 <x2 <x3 <x4 <x5 <x6 <x7 <x8 <x9 <x10 <y1 <y2 <y3 <y4 <y5 <y6 <y7 <y8 <y9 <y10 <report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Halt
+//-----------------------------------------------------------------------------
+DEFINE_AGENCY(CHalt,
+	DEFINE_CONCEPTS(
+		STRING_SYSTEM_CONCEPT(report)
+	)
+	PRECONDITION(IS_TRUE(halt_command_issued) &&
+	  	(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+		*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	DEFINE_SUBAGENTS(
+		SUBAGENT(ExpectHaltCommand, CExpectHaltCommand, "")
+		SUBAGENT(ExecuteHalt, CExecuteHalt, "")
+		SUBAGENT(InformHalt, CInformHalt, "")
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Halt/ExpectHaltCommand
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectHaltCommand,
+	EXPECT_CONCEPT(halt_command_issued)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanHaltCommand]>true")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Halt/ExecuteHalt
+//-----------------------------------------------------------------------------
+DEFINE_EXECUTE_AGENT(CExecuteHalt,
+    CALL("gal_be.launch_query query=halt_command <robot_name >report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Halt/InformHalt
+//-----------------------------------------------------------------------------
+DEFINE_INFORM_AGENT(CInformHalt,
+	PROMPT("inform report_halt <robot_name <report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Follow
+//-----------------------------------------------------------------------------
+DEFINE_AGENCY(CFollow,
+	DEFINE_CONCEPTS(
+		STRING_SYSTEM_CONCEPT(report)
+		STRING_USER_CONCEPT(followee, "")
+	)
+	PRECONDITION(IS_TRUE(follow_command_issued) &&
+	  	(*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+		*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	DEFINE_SUBAGENTS(
+		SUBAGENT(ExpectFollowCommand, CExpectFollowCommand, "")
+		SUBAGENT(ExpectFollowee, CExpectFollowee, "")
+		SUBAGENT(ExecuteFollow, CExecuteFollow, "")
+		SUBAGENT(InformFollow, CInformFollow, "")
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Follow/ExpectFollowCommand
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectFollowCommand,
+	EXPECT_CONCEPT(follow_command_issued)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanFollowCommand]>true")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Follow/ExpectFollowee
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectFollowee,
+	EXPECT_CONCEPT(followee)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[OBJ-Robot.RobotName]")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Follow/ExecuteFollow
+//-----------------------------------------------------------------------------
+DEFINE_EXECUTE_AGENT(CExecuteFollow,
+    CALL("gal_be.launch_query query=follow_command <robot_name <followee >report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Follow/InformFollow
+//-----------------------------------------------------------------------------
+DEFINE_INFORM_AGENT(CInformFollow,
+	PROMPT("inform report_follow <robot_name <followee <report")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Pause
+//-----------------------------------------------------------------------------
+DEFINE_AGENCY(CPause,
+	DEFINE_CONCEPTS(
+		STRING_SYSTEM_CONCEPT(report)
+	)
+	//PRECONDITION(IS_TRUE(pause_command_issued))
+  PRECONDITION(IS_TRUE(pause_command_issued) 
+    && (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+		*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	DEFINE_SUBAGENTS(
+		SUBAGENT(ExpectPauseCommand, CExpectPauseCommand, "")
+		SUBAGENT(ExecutePause, CExecutePause, "")
+		SUBAGENT(InformPause, CInformPause, "")
+	)
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Follow/ExpectPauseCommand
+//-----------------------------------------------------------------------------
+DEFINE_EXPECT_AGENT(CExpectPauseCommand,
+	EXPECT_CONCEPT(pause_command_issued)
+	//EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") ||
+	//	*C("current_addressee").CreateMergedHistoryConcept() == C("everyone")))
+	GRAMMAR_MAPPING("[HumanPauseCommand]>true")
+)
+
+//-----------------------------------------------------------------------------
+// /zap2/Task/Follow/ExecutePause
+//-----------------------------------------------------------------------------
+DEFINE_EXECUTE_AGENT(CExecutePause,
+    CALL("gal_be.launch_query query=pause_command <robot_name >report")
+)
+

@@ Diff output truncated at 60000 characters. @@


More information about the TeamTalk-developers mailing list