For this work, you will need to know your group.
Copy the file stagger.lisp to guide.lisp. Modify the code to create a function "guide" that prompts the user for the next move. Valid commands are (L,R,F,C,O,B,?), where "?" prints the current stuff being carried by the agent, If you code this correctly, then:
To show me that this all works, run a session with you typing commands into the game in an emacs SLIME buffer, then save that buffer to disk (C-x,C-s). Modify "main.lisp" so it cats the saved buffer.
If you answer this question properly then your search engine should be very general and the only place we see domain details is in (op). Write one inference file (contains DFS, BFS) and two "op" files containing an incomplete set of operators and another containing the write operators. Write a "main.lisp" file that loads your code, cats your code, then shows a trace of the program running with the incomplete, then the correct, operators.
If you do all this correctly, the behavior of the knowledge base should change as a result of using different operators.
The task is the same as last week, but use BFS, Best-first, and DFID for monkeys and bananas. If you do this right, the changes to your code should be minimal.
Add an evil environment. At probability P,
Conduct six manual walk around the board (using the code from 2a). Each walk will be conducted increasing evil from 0 to 0.025 to 0.05 to 0.1 to 0.2 to 0.4.
Implement a set of feature extractors from the board (e.g cant-get-to-gold, key-is-nearby, etc).
Implement a score function for a board that use the feature extractors. Amongst other things, the score should (a) decrease if you can't get to the gold, and (b) increase if you are near the gold; or you have the gold and you are near the start; or if on the way to the gold, you are close by a key (or dynamite). Etc (the stuff in the last para is by no means exhaustive- they are many many more things you need to add).
Add state to your search functions. That state should carry around a board and if you do something to it, you copy it and pass a modified board to a sub-routine. This will be the way you code up your search- each new branch is a new what-if with a new copy of the board.
seconds | consed | calls | sec/call | name ------------------------------------------------------------ 0.447 | 0 | 990,001 | 0.0000005 | ! 0.105 | 6,819,840 | 170,000 | 0.000001 | EM2EFFORT 0.073 | 6,795,264 | 170,000 | 0.0000004 | EM2RIN 0.027 | 6,778,880 | 170,000 | 0.0000002 | EM2CIN 0.020 | 1,585,152 | 50,000 | 0.0000004 | SF2CIN 0.016 | 1,630,208 | 50,000 | 0.0000003 | SF2DIN 0.012 | 6,742,016 | 170,000 | 0.0000001 | EM2DIN 0.006 | 946,176 | 30,000 | 0.0000002 | DR2ROUT 0.001 | 0 | 14 | 0.000067 | MAKE-R15 0.001 | 8,192 | 1 | 0.000539 | COCOMO-DEFAULTS 0.000 | 0 | 5 | 0.000000 | MAKE-SFS 0.000 | 0 | 1 | 0.000000 | LINE-Y 0.000 | 0 | 27 | 0.000000 | ? 0.000 | 0 | 1 | 0.000000 | INIT-DB 0.000 | 0 | 5 | 0.000000 | MAKE-R16 0.000 | 0 | 7 | 0.000000 | MAKE-RIN+ 0.000 | 1,695,744 | 50,000 | 0.000000 | SF2EFFORT 0.000 | 0 | 1 | 0.000000 | MAKE-R26 0.000 | 0 | 9 | 0.000000 | MAKE-EM- 0.000 | 0 | 6 | 0.000000 | MAKE-DIN+ 0.000 | 0 | 1 | 0.000000 | ?ONE-B 0.000 | 0 | 1 | 0.000000 | MAKE-ONE-A 0.000 | 0 | 27 | 0.000000 | GUESS 0.000 | 0 | 25 | 0.000000 | ?ELT 0.000 | 0 | 5 | 0.000000 | MAKE-DSF 0.000 | 974,848 | 30,000 | 0.000000 | DR2DOUT 0.000 | 0 | 34 | 0.000000 | MAKE-EM 0.000 | 0 | 25 | 0.000000 | ?BAG 0.000 | 0 | 6 | 0.000000 | MAKE-DR 0.000 | 0 | 10 | 0.000000 | MAKE-RIN- 0.000 | 0 | 5 | 0.000000 | MAKE-RSF 0.000 | 0 | 3 | 0.000000 | ?DR 0.000 | 0 | 1 | 0.000000 | POINT-TO-LINE 0.000 | 0 | 3 | 0.000000 | MAKE-RDR 0.000 | 0 | 1 | 0.000000 | DEMO456 0.000 | 0 | 1 | 0.000000 | MAKE-LINE 0.000 | 0 | 3 | 0.000000 | MAKE-R25 0.000 | 0 | 3 | 0.000000 | MAKE-DDR 0.000 | 0 | 5 | 0.000000 | MAKE-CSF 0.000 | 0 | 10 | 0.000000 | MAKE-SF 0.000 | 0 | 6 | 0.000000 | MAKE-CIN+ 0.000 | 0 | 11 | 0.000000 | MAKE-CIN- 0.000 | 0 | 28 | 0.000000 | GETA 0.000 | 1,482,752 | 50,000 | 0.000000 | SF2RIN 0.000 | 0 | 5 | 0.000000 | ?SF 0.000 | 8,192 | 17 | 0.000000 | ?EM 0.000 | 0 | 8 | 0.000000 | MAKE-EM+ 0.000 | 0 | 2 | 0.000000 | MAKE-NUM 0.000 | 0 | 1 | 0.000000 | ?ONE-A 0.000 | 958,464 | 30,000 | 0.000000 | DR2COUT 0.000 | 0 | 3 | 0.000000 | MAKE-CODR 0.000 | 0 | 1 | 0.000000 | MAKE-ONE-B 0.000 | 24,076,288 | 1 | 0.000000 | DEMO456A 0.000 | 0 | 25 | 0.000000 | COCO 0.000 | 0 | 2 | 0.000000 | MAKE-R36 0.000 | 0 | 11 | 0.000000 | MAKE-DIN- 0.000 | 0 | 1 | 0.000000 | MAKE-DB 0.000 | 155,648 | 10,124 | 0.000000 | MY-RANDOM ------------------------------------------------------------ 0.707 | 60,657,664 | 1,970,493 | | Total
To complete this homework, generate three documents:
Note: to get most of the marks on this homework, you only have to try to speed up the code (offer some intelligent comment in what2do.txt). Obviously, sometimes, no optimizations are possible. However, to get full marks on this homework, you need at least a 30% speed in after.txt.
This week, you have two tasks: create some baselines and think about improvements.
When thinking about improvements, reflect on more than just mere systems-level optimizations. Think about the search space and how to reduce its complexity- that will be your work for next week.
As to creating baselines, you have to to collect some stats. And next week's task will be to show an improvement on those stats.
To collect those stats:
Report these in a text table where the columns line up neatly and the columns are labelled:
RUNTIMES: board, evil, 0, 15, 50, 75, 100 ----- ----- -- --- --- --- ---- ...
What to hand in:
Practicalities:
nice -n 20or the sysadmin people will cut you off.
Week one: please complete the Cs472 exercise, number 1a.
Week two:
Week three: read http://web.engr.oregonstate.edu/~wong/workshops/icml2006/slides/menzies.pdf and http://portal.acm.org/ft_gateway.cfm?id=1194910&type=pdf&coll=GUIDE&dl=GUIDE&CFID=73493180&CFTOKEN=43852520.
Targets: anomaly detection, verification, classification, mode identification