Download Herbal Tutorial v3.1c - Applied Cognitive Science Lab

Transcript
A Gentle Introduction to Herbal
53
10.2 Creating types
This new model will have to hold the previous move, and the choice for the next move, in working
memory. We can store them in a single fact of type direction, which will have two fields:
1. The field from, of type string, which will store the direction from where the vacuum cleaner
is just coming.
2. The field to, of type string, which will store the next chosen move, that is, the direction to
where the vacuum cleaner attends to go.
Notice that only one fact of direction type needs to be instantiated in the model at any time.
Because this memory of direction has to be available in both the Wander and the Pursue problem
spaces, then its scope has to be the Top problem space. Because the next chosen move will have to
be compared to the previous one, we have to give it also the Top scope, otherwise we could not
compare them in a single condition.
We will also need another fact to indicate that a move direction has been chosen and that we are
ready to enter the Move sub problem space. This fact has to have either the scope of the Wander or
the Pursue problem space.
We can call the type of this new fact: moving. It needs no field.
Using what you have learned in Section 0, please create the direction type with its two fields from
and to; and the moving type, with no field.
When this is done, your Types tab should look like Figure .