Testing <tt>act</tt>


next up previous
Next: A bit of practice
Up: The game of Traveller (PP)
Previous: What facts does act need?
Back: to main list of student notes

Testing act

You are now ready to try out act. Look at the definition of act from CIRCLER. The only trader-state predicate it calls is at. This means that, so long as you have a clause for at, you can test this version of act. So input one - at(circler,18), perhaps - and then type

    act( circler, Action, Arg1, Arg2 ).
You should find that Action becomes move, Arg1 is whichever square is clockwise of the current one, and Arg2 is dummy.

All this may have seemed rather long-winded, but the gist of it can be stated quickly. To run a trader, you call run, passing it the trader's name and initial square. To find out what the trader will do next, run calls act, passing the trader's name in the first argument, and getting back the name of an action, plus some other information in the other arguments. act has two sources of information. The first is the board predicates. The second is the predicates that describe a trader's current state. All these take the trader's name as their first argument. As run proceeds, it updates these. If you want to continue a run from where it left off, perhaps after changing some of the state predicates, you can use go_on. This takes one argument, the trader's name. Finally, you can of course ask questions that involve act directly, if you want to test how it responds to various situations.


next up previous
Next: A bit of practice
Up: The game of Traveller (PP)
Previous: What facts does act need?
Back: to main list of student notes



Jocelyn Paine
Tue Jun 4 17:58:48 BST 1996