Goal Heuristics Definitions


Heuristics are used when actions are run without parameters, implying the machine should take the right action to get closer or satisfy? a goal. When within timeout? time of tree searching a particular goal is not satisfied, these heuristics are used to choose the best choice of action between all possible valid actions.

When more than one heuristic is defined for a goal, the choice of possible world scoring highest average among all heuristics will be picked. syntax:

                 heuristic <class name> <goal name> <heuristic weight>? <heuristic type> <expression>.

Currently there are 3 types of heuristics:

 1. minimize? <expression> : to pick the possible world with the minimum value of expression.
 2. maximize? <expression> : to pick the possible world with the maximum value of expression.
 3. establish? <predicate> : to pick the possible world for which the predicate is true.

In the following example, we attribute one heuristic for the find-goal goal of robot class to be minimizing its Manhattan distance? to the goal.

   > heuristic robot find-goal minimize its goal-distance.
   > qualify robot goal-distance 
                   (its position col number - its goal-square col number) abs + 
                   (its position row number - its goal-square row number) abs.

Another example:

  > heuristic calculator fibonacci-sequence establish its answer is-fibonacci-sequence.

The optional Heuristic Weight? (default is 1) is used when multiple heuristics are defined and we intend to give more influence on some of them. For example, if we give a weight of 2 to some heuristic and 1 to another, the former one would count twice as the latter one when consulting heuristics. For instance, here is three heuristics defined in our sample chess.sol? program, where we are saying capturing pieces is more important than centralizing them:

heuristic Player win 2 maximize its pieces worth sum.
heuristic Player win 2 minimize its opponent pieces worth sum.
heuristic Player win 1 maximize its centralized-pieces size.
 
Page last modified on September 18, 2008, at 09:27 PM

simplaPoweredBy

 

Warning: fopen(wiki.d/.flock) [function.fopen]: failed to open stream: Permission denied in /home/hesam/public_html/pmwiki/pmwiki.php on line 417

PmWiki can't process your request

Cannot acquire lockfile

We are sorry for any inconvenience.