Previous Up Next

8.3  Example Constraint Handlers

All example files are in the subdirectory lib/chr of the installation-directory of ECLiPSe (which can be found using get_flag(installation_directory,Dir). The files (.chr, .pl, examples) relevant to a particular constraint system can be found by looking at all files that match the pattern given in the following listing with each example handler. The examples include a colour graphic demo about optimal sender placement for wire-less devices in buildings and company sites, small constraint handlers for and larger constraint handlers for CHRs have also been used as a committed choice programming language on their own (*prime*).

The example handlers can be loaded using chr(lib(File)). For instance the finite domain handler can be made available as follows (the current directory must have write permission so that the pl file can be created):
[eclipse 1]: lib(chr), chr(lib(domain)).
...
domain.pl  compiled traceable 241028 bytes in 1.22 seconds

yes.
[eclipse 2]: X::1..10, X ne 5.

X = X

Constraints:
(4) X_g1165 :: [1, 2, 3, 4, 6, 7, 8, 9, 10]

yes.

Previous Up Next