Dynamic RavenClaw Agents

From Olympus
(Redirected from Dynamic task tree)
Jump to: navigation, search

Dynamic task tree generation requires the uses of dynamically mounted RavenClaw agents. Ravenclaw may have its Agents loaded dynamically and then used.

Mounting an Agent

You can call the pDTTManagerAgent's MountAgent, as in

DEFINE_EXECUTE_AGENT(CLoadSymptom,
    EXECUTE(pDTTManager->MountAgent(&A("../Diagnose"), 
                                    "CAskSymptom", 
                                    "AskSymptom", 
                                    "",
                                    mmAsLastChild);
    )
)

The MountAgent method returns a pointer to the mounted agent (CDialogAgent*) and takes the following parameters:

type description default value
CDialogAgent* the parent where the agent will be mounted
string the type of the agent to be mounted
string the name for the agent to be mounted
string the agents "configuration". this is a hash of parameters.
TMountingMethod how the agent is to be attached to said parent
string the agent's id ""

The mounting method type TMountingMethod is the enum:

  • mmAsLastChild
  • mmAsFirstChild
  • mmAsLeftSibling
  • mmAsRightSibling

Unmounting an Agent

To unmount an agent, call the manager's UnMountAgent method.

The UnMountAgent method takes the following paramter.

type description default value
CDialogAgent* the agent to be unmounted

Mounting an Array of Agents

You can also call the pDTTManagerAgent's MountAgentsFromArrayConcept, as in

DEFINE_EXECUTE_AGENT(CLoadSymptoms,
    CALL("gal_be.launch_query query=get_symptoms_list >symptom_names")
    ON_COMPLETION(pDTTManager->MountAgentsFromArrayConcept(&A("../Diagnose"), 
                                                           "symptom_names", 
                                                           "CAskSymptom", 
                                                           "AskSymptom#", 
                                                           "symptom_name");
    )
)

The MountAgentsFromArrayConcept method takes the following parameters:

type description default value
CDialogAgent* the parent where the agents will be mounted
string the name of the array concept
string the type of the agents to be mounted
string the name for the agents to be mounted. this should normally include a # somewhere which will get replaced by the index
string the name of the concept for each agent ""
string the dynamic id to use for each agent. this can be any string containing #, and # will be replaced by the index #
Personal tools