//============================================================================= // // Copyright (c) 2000-2007, 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. // //============================================================================= // TryOne: v0 // by Katherine Lang (lang@cs.rochester.edu), 2010 // Based on OLYMPUS TUTORIAL 1; by Antoine Raux (antoine@cs.cmu.edu), 2007 //----------------------------------------------------------------------------- // // TRYONEv0.CPP - This module contains the description of the dialog // task, (i.e. all the user defined agencies, etc, etc) // for the first version of the NLDS for MIFIRA // //----------------------------------------------------------------------------- #include "DialogTask.h" #define __IN_DIALOGTASK__ //----------------------------------------------------------------------------- // // DM GALAXY SERVER CONFIGURATION // //----------------------------------------------------------------------------- #ifdef GALAXY DMSERVER_CONFIGURATION("DialogManager", 17000) #endif //----------------------------------------------------------------------------- // // CONSTANT DEFINITIONS // //----------------------------------------------------------------------------- /*// query types ID number (goes into the "QueryType" concept) #define NQ_NEW_REQUEST 1 #define NQ_NEXT_BUS 2 #define NQ_PREVIOUS_BUS 3 */ // return codes from the backend #define RC_OKAY 0 #define RC_INTERNAL_ERROR 1 //#define RC_NO_BUS_AFTER_THAT 2 //#define RC_NO_BUS_BEFORE_THAT 3 //----------------------------------------------------------------------------- // // DIALOG CORE CONFIGURATION // //----------------------------------------------------------------------------- CORE_CONFIGURATION( // declare the NLG and the GUI as output devices USE_OUTPUT_DEVICES( DEFAULT_OUTPUT_DEVICE("nlg", "nlg.launch_query", 1) ) ) //----------------------------------------------------------------------------- // // CONCEPT TYPES DEFINITION // //----------------------------------------------------------------------------- // Result frame giving bus schedules /*DEFINE_FRAME_CONCEPT_TYPE( CResultConcept, ITEMS( INT_ITEM(failed) STRING_ITEM(total_numppl) ) )*/ //----------------------------------------------------------------------------- // // AGENT SPECIFICATIONS // //----------------------------------------------------------------------------- // /MyBus DEFINE_AGENCY( CDialogTask, IS_MAIN_TOPIC() DEFINE_CONCEPTS( STRING_USER_CONCEPT(num_total_ppl, "default") ) DEFINE_SUBAGENTS( SUBAGENT(GiveIntroduction, CGiveIntroduction, "") SUBAGENT(GetTotalPpl, CGetTotalPpl, "") SUBAGENT(ExecuteSomething, CExecuteSomething, "") SUBAGENT(Goodbye, CGoodbye, "") ) ) // /MyBus/GiveIntroduction DEFINE_INFORM_AGENT( CGiveIntroduction, PROMPT( ":non-interruptible inform welcome") ) // /MyBus/GetTotalPpl DEFINE_REQUEST_AGENT( CGetTotalPpl, PROMPT("request total_num_ppl") REQUEST_CONCEPT(total_num_ppl) GRAMMAR_MAPPING("![NumTotalPeople]") ) // maybe try to execute something? /*DEFINE_EXECUTE_AGENT( CExecuteSomething, EXECUTE() )*/ // /MyBus/GreetGoodbye DEFINE_INFORM_AGENT( CGoodbye, PROMPT(":non-listening inform goodbye") ) //----------------------------------------------------------------------------- // // AGENT DECLARATIONS // //----------------------------------------------------------------------------- DECLARE_AGENTS( DECLARE_AGENT(CDialogTask) DECLARE_AGENT(CGiveIntroduction) DECLARE_AGENT(CGetTotalPpl) DECLARE_AGENT(CExecuteSomething) DECLARE_AGENT(CGoodbye) ) //----------------------------------------------------------------------------- // DIALOG TASK ROOT DECLARATION //----------------------------------------------------------------------------- DECLARE_DIALOG_TASK_ROOT(DialogTask, CDialogTask, "")