Created
March 15, 2010 07:33
-
-
Save cflewis/332607 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% A script to show using lparse with optimize statements. Pipe into clasp for nicer output. | |
#hide cost(_,_). | |
#hide star(_,_). | |
#hide main_street(_). | |
% For some reason, lparse chokes on hotel(1..5). Enumerating them all works. | |
1 { hotel(1), hotel(2), hotel(3), hotel(4), hotel(5) } 1. | |
star(1,5). star(2,4). star(3,3). star(4,3). star(5,2). | |
cost(1,170). cost(2,140). cost(3,90). cost(4,75). cost(5,60). | |
main_street(4). | |
noisy :- hotel(X), main_street(X). | |
maximize [ hotel(X) : star(X,Y) = Y ]. | |
minimize [ hotel(X) : cost(X,Y) : star(X,Z) = Y/Z ]. | |
minimize { noisy }. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment