Chapter 7 TANDEM Examples
7.5 Example 2 : Car Maintenance
7.5.1 The Domain
The area of car maintenance is one that readily lends itself to the use of procedural teaching methods. Many tasks in this environment consist of groups of sequential actions. Also, there are several areas of functionality in this domain that can be easily separated and considered as independent domains, for example, a car's electrical system, its braking system and its engine system.
Car maintenance was initially considered for a graphical test domain in TANDEM's early development. Therefore, a relatively small but significantly complex example was examined. This was the changing of a
flat tyre on a car. Simulation of this environment required not only the simulation of the major elements, eg. the car and tyres, but also the workings of other complex devices, eg. a car jack.
7.5.2 The Domain Definition
D _.. O
A<tioa Trusitioa CoMitioa
car not on jack
jack under car
jack up jack awliable
Figure 7.11 : Car maintenance domain definition example.
Part of the domain description for the car domain can be scene in Figure
Changing the car tyre consists of the six major steps, namely, jacking up the car, removing the wheel nuts, removing the flat tyre, placing the spare tyre, replacing the wheel nuts and the removal of the car jack. These steps can be defined in a task hierarchy over the basic behaviour of the individual components in this environment (Figure 7. 12).
remove car jack = TASK COMPLETE
replace wheel nuts
place spare tyre
remove flat tyre get spare tyre
jack up car get wheel brace
get car j ack
Figure 7.12 : Basic task hierarchy for the car domain. 7.5.3 The Interface
There are six main objects in this domain, namely, the car, the flat tyre, the spare tyre, a car jack, a wheel brace and some wheel nuts (Figure 7. 13). Most of these objects can be manipulated independently in the domain. It is the job of the task hierarchy to guide the user to the completion of the task at hand.
Use --..
�
ToolWheel Nuts Car Flat Tyre
Car Jack Spare Tyre Wheel Brace
Figure 7.13 : Car maintenance interface.
There are two interface tools that can be used in this domain, the selection
tool and the use tool. The selection tool is used for selecting and moving objects around this environment, eg. the car jack, the tyres and the wheel brace. The use tool is utilised to apply some action to a selected object. Using the use tool while the car jack is selected will result in the car jack being displayed in the up position. If the jack was currently under the car, then the car will be placed on the jack (Figure 7. 14).
A similar positioning and action pairing are defined for the wheel brace, eg. if the wheel brace is used while over the wheel nuts, then the wheel nuts would either be removed, if they are in place, or replaced, if they are absent.
The car maintenance domain has been implemented with a graphical interface to show the interface flexibility that is provided when domains are defined in TANDEM and that use the GDI tutoring engine. As described in the Chapter 6, the DCE generates interface code for custom domain interfaces. This code represents the calls that the GDI can process for the chosen domain and must be linked to any custom interface that the user may require.
An example for using the use command m the car maintenance domain
can be seen in Figure 7.15.
Code Description Interface Code
Use the jack when it is (a l ) interface_event ( uae , ( Win , [ j ack_pi c ] ) , Return )
down. (a2) get_pi c ( Wi n , j ack_pic , j ack ( Y , X , down ) ) ,
(a3) c a l l gdi ( d u a e j ac k , Return ) .
Use the jack when it is (b l ) interface_event ( uae , ( Win , [ j ack_pic ] ) , Return )
up . (b2) get_pic ( Win , j ack_p i c , j ack ( Y , X , up ) ) ,
(b3) c a l l gdi ( u u a e j ac k , Return ) .
After use command, (c l ) process_gdi_return (uae , [ j ack_p i c ] ,
redraw any items that [ va l id_opiRes t ] , [ W i n ] )
need it. (c2) draw_i terns ( Win , Rest ) .
Figure 7.15 : Interface to GDI code.
At a mouse down event in the graphical interface with the use tool on the car jack, an interface event (al) is generated by the use tool. (a2) specifies that the car jack is currently down and if this is true then the GDI is sent the command d_use_jack (a3). A similar process happens when the car jack is in the up position (bl-b3).
Where appropriate, each interface event is matched to a GDI command. These GDI commands are processed by the GDI tutoring engine and are then returned to the interface. The process_gdi_return predicate is used
to update the domain interface with the new situation that was generated by the GDI. At (cl ) in Figure 7.15, any new conditions can be returned by the GDI and the domain interface can be updated (c2).
7.5.4 A Sample Session
A portion of a session in the car maintenance domain can be seen in Figures 7.16a and 7.16b. This session has been started with task advice being provided but not enforced.
User Commands System Responses
## start session : TASK : ADVICE ••r "'olnlooooco
-
0
�
move wheel brace move car
use car jack cor
WRR/'tllf't/6 CE)
Tlat • not • 900d acUon at thil tme
X
�
0
place jack under car
use jack .. , ...
�
0
place wheel brace over nut
use wheel brace
�
0
move flat tyre, move tyre
replace nut, move wheel brace cer ��telnten•nc:•
�
�
�
CDuse jack, move jack c•r met•tenence
�
..
�
C2>
Figure 7.16b : Car maintenance domain example session.
The car maintenance domain has a totally graphical interface and the user commands columns in Figures 7.16a and 7. 1 6b are only included for reader reference.