File: NOTES

package info (click to toggle)
yap 5.1.1-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 16,124 kB
  • ctags: 14,650
  • sloc: ansic: 122,796; perl: 22,545; sh: 3,768; java: 1,277; makefile: 1,191; xml: 739; tcl: 624; lisp: 142; awk: 9
file content (46 lines) | stat: -rw-r--r-- 1,614 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.27.1

Copyright (c) 1998-2006 Paulo Moura.  All Rights Reserved.
=================================================================


To load this example and for sample queries, please see the SCRIPT file.

You will also need to load the following files in the library directory: 
dates_loader, types_loader, events_loader, metapredicates_loader, and 
hierarchies_loader. Alternatively, you can just load the library all_loader 
file.

Some of the code in this folder is adopted, with permission, from the book 
"Prolog Programming for Artificial Intelligence" by Ivan Bratko.

For a description of the search problems, please see a classical AI book 
(such as the one above) or visit the url <http://www.plastelina.net/games>.

This example defines two hierarchies of objects, one for representing 
state-spaces and another for representing search methods:

	state_space
		farmer
		water_jug
		salt(Quantity, Measure1, Measure2)
		heuristic_state_space
			bridge
			eight_puzzle
			miss_cann

	search_strategy
		blind_search(Bound)
			breadth_first(Bound)
			depth_first(Bound)
		heuristic_search(Threshold)
			best_first(Threshold)
			hill_climbing(Threshold)

Taken together, these two hierarchies implement a framework for solving 
state-space search problems in Logtalk. There is also a monitor object, 
"performance", which tries to measure the time taken to find a solution, 
the branching factor while searching for a solution, and the number of 
transitions made to find a solution.