Download Herbal Tutorial - Applied Cognitive Science Lab
Transcript
A Gentle Introduction to Herbal 44 Figure 3 - Condition Clauses for the nearbyAllClean Condition. 9.6. Creating Vacuum Cleaner Actions In this section, two actions will be created in Herbal. The first action, called moveToDirt, will cause the vacuum cleaner to move to a nearby dirty square. The second action, called moveRandom, will cause the vacuum cleaner to move in a random direction. Follow these steps to create the moveToDirt action: 1. Select the Actions tab inside the Herbal GUI Editor. 2. Click on the New button located next to the list of existing actions. 3. Accept the default value given in the Library Field. 4. Enter moveToDirt for the name of the action and click Finish. 5. Select the moveToDirt action in the list of existing actions. 6. Click on the Add button located next to the list of current clauses. 7. Select “add a new fact” from the list of choices for the action and then click Finish. 8. In the next window, select action data type and click Next. 9. For this particular action we want to move in the direction of a nearby dirty square. The actual direction that the vacuum cleaner will move will depend on its current situation. As a result, we must depend on a condition to provide us with the correct direction. Specifically, we will use the output variable of the nearbyDirty condition to determine what direction to move to. Select the move field and click on the Get button. 10. Because we will rely on a matched a radar fact to tell us what direction to move in, select on radar and click Next, and then select dir and click Next. 11. This action relies on having a named instance available to it so it knows what direction to move in. The name you provide will be used later when the action is assigned to an