Extending Chimera

 

Chimera has been designed to be easily extensible. New actuators that might do anything can be easily integrated into the existing architecture.

 

To add your actuator, there are several steps to follow.

 

First, each actuator inherits from a purely virtual abstract_actuator superclass (it’s really more like an interface). All actuators should implement a function called activate that causes the actuator to performs its action. It is also suggested that undo and redo be supported, although these functions may be left as stubs. Thus, after being constructed, actuators generally know how to perform their action, as well as how to undo and redo themselves.

 

The constructor for an actuator should generally take a string that will consist of space-delineated fields of the form [FieldName].FIELDVALUE.

The actuator constructor should then use the presence and/or absence of particular fields and their values to set flags and data members so that it knows what to do when activate() is called.

 

This allows the dialogue manager to simply forward the output of the parser on to the appropriate actuator and ask it to perform its action.

 

In addition to writing a new actuator, code must be added to the dialogue manager to recognize requests for the new action. In the middle of dManager.cpp, there is a long block of code that functions as a switch statement. Depending on the value of the variable action, a new actuator of the appropriate type is created, and the current pointer is set to point to this new actuator. Another case must be added here of the form

 

if( action.substr(0, length) == “Action”)

{

    Current->new ActuatorName(fields);

}

 

where length is the length of the word describing the new action and Action is that action (e.g. “move”, “resize”, etc.)

 

Finally, a new grammar file must be written and compiled to the parser to allow users to talk to the new actuator. The Phoenix Parser User Manual contains information about writing grammar for Phoenix.

 

Additionally, a framework is being developed which will allow new applications to be designed in such a way that they interact with Chimera. Click Here for more information


Back to the Main Page