-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.lisp
926 lines (811 loc) · 17.1 KB
/
model.lisp
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
(clear-all)
(define-model lost-agent
(sgp :egs 0.2) ; Dieses Modell verwendet Utility. Der utility noise kann ausgeschaltet werden, indem dieser Parameter auf 0 gesetzt wird.
(sgp :esc t) ; Dieses Modell verwendet subsymbolische Verarbeitung
(sgp :v t :show-focus t :trace-detail high)
(chunk-type goal state intention)
(chunk-type control intention button)
(chunk-type tile-type color type)
(chunk-type tile color type screen-x screen-y)
(chunk-type sight viewrange)
(set-visloc-default screen-y lowest kind oval)
(set-parameter-value :visual-num-finsts 25)
(add-dm
(move-left) (move-right)
(move-up) (move-down)
(w) (a) (s) (d)
(i-dont-know-who-i-am)
(tile-distance) (color-meaning)
(i-dont-know-where-to-go)
(something-should-change)
(i-want-to-do-something)
(up-control isa control intention move-up button w)
(down-control isa control intention move-down button s)
(left-control isa control intention move-left button a)
(right-control isa control intention move-right button d)
(goal-tile isa tile-type color green type goal)
(reward-tile isa tile-type color type type reward)
(trap-tile isa tile-type color unknown type trap)
(block-tile isa tile-type color unknown type block)
(fog-of-war isa )
(first-goal isa goal state i-dont-know-the-board intention left-border)
)
(goal-focus first-goal)
(p identify-left-border
=goal>
state i-dont-know-the-board
intention left-border
=visual-location>
- kind line
==>
+visual-location>
kind line
screen-x lowest
)
(p save-left-border
=goal>
state i-dont-know-the-board
intention left-border
=visual-location>
kind line
screen-x =x
==>
=goal>
state i-dont-know-the-board
intention right-border
border-left-x =x
)
(p identify-right-border
=goal>
state i-dont-know-the-board
intention right-border
=visual-location>
- kind line
==>
+visual-location>
kind line
screen-x highest)
(p save-right-border
=goal>
state i-dont-know-the-board
intention right-border
=visual-location>
kind line
screen-x =x
==>
=goal>
state i-dont-know-the-board
border-right-x =x
intention upper-border
)
(p identify-upper-border
=goal>
state i-dont-know-the-board
intention upper-border
=visual-location>
- kind line
==>
+visual-location>
kind line
screen-y lowest)
(p save-upper-border
=goal>
state i-dont-know-the-board
intention upper-border
=visual-location>
kind line
screen-y =y
==>
=goal>
state i-dont-know-the-board
border-upper-y =y
intention lower-border
)
(p identify-lower-border
=goal>
state i-dont-know-the-board
intention lower-border
=visual-location>
- kind line
==>
+visual-location>
kind line
screen-y highest
)
(p save-lower-border
=goal>
state i-dont-know-the-board
intention lower-border
=visual-location>
kind line
screen-y =y
==>
=goal>
state i-dont-know-the-goal
border-lower-y =y
)
(p retrieve-goal-color
=goal>
state i-dont-know-the-goal
?retrieval>
buffer empty
state free
==>
+retrieval>
type goal
)
(p i-retrieved-the-goal-color
=goal>
state i-dont-know-the-goal
=retrieval>
type goal
color =goalcolor
==>
=goal>
state i-dont-know-who-i-am
goalcolor =goalcolor
)
(p locate-first
=goal>
state i-dont-know-who-i-am
=visual-location>
isa visual-location
kind oval
screen-x =x
screen-y =y
color =color
?visual>
state free
?imaginal>
state free
==>
=goal>
state watch-for-others
+visual>
cmd move-attention
screen-pos =visual-location
+imaginal>
isa tile
color =color
screen-x =x
screen-y =y
)
(p request-second
=goal>
state watch-for-others
=visual-location>
screen-y =y
=imaginal>
==>
+visual-location>
:attended nil
kind oval
screen-y =y
=imaginal>
=goal>
state check-for-others
)
(p check-for-others-tiles
=goal>
state check-for-others
=visual>
- state busy
=visual-location>
screen-y =y
?visual-location>
- state error
?visual>
state free
==>
=goal>
state check-for-others
intention attend
+visual>
cmd move-attention
screen-pos =visual-location
+visual-location>
:attended nil
screen-y =y
kind oval
-imaginal>
)
(P no-other-bodies
=goal>
state check-for-others
?visual-location>
;buffer failure
state error
=imaginal>
color =color
?imaginal>
state free
==>
=goal>
state i-am-this
bodycolor =color
intention scan
+imaginal>
isa tile
color =color
type body
)
(P no-more-bodies
=goal>
state check-for-others
?visual-location>
;buffer failure
state error
?imaginal>
buffer empty
==>
=goal>
state who-am-i
)
(p do-i-move
=goal>
state who-am-i
- intention do-i-move
?manual>
state free
=visual>
?retrieval>
state free
==>
=visual>
cmd start-tracking
+manual>
cmd press-key
key s
=goal>
state did-i-move
intention request
)
(p did-i-move-request
=goal>
state did-i-move
intention request
?visual-location>
- buffer failure
=visual-location>
?retrieval>
state free
?manual>
state free
==>
+retrieval>
kind oval
:recently-retrieved nil
=goal>
intention check
)
(p did-i-move
=goal>
state did-i-move
intention check
=retrieval>
color =color2
screen-x =x
screen-y =y
kind oval
?retrieval>
state free
==>
=retrieval>
+visual-location>
color =color2
screen-x =x
screen-y =y
kind oval
=goal>
intention request
)
(p i-moved-this
=goal>
state did-i-move
intention request
=retrieval>
color =color
screen-x =x
screen-y =y
kind oval
?visual-location>
buffer failure
state error
==>
=goal>
state i-am-this
intention scan
bodycolor =color
+imaginal>
isa tile-type
color =color
type body
-visual-location>
+visual-location>
color =color
kind oval
)
(p initial-scan-request
=goal>
state i-am-this
intention scan
bodycolor =body
?visual>
state free
==>
+visual-location>
:attended nil
;:attended new
- color =body
kind oval
=goal>
intention attend
)
(p initial-scan-attend
=goal>
state i-am-this
intention attend
bodycolor =body
=visual-location>
- color =body
kind oval
?visual>
state free
==>
+visual>
cmd move-attention
screen-pos =visual-location
=goal>
intention scan
)
(p initial-scan-stop
=goal>
state i-am-this
intention attend
bodycolor =body
?visual-location>
state error
; buffer failure
==>
=goal>
state i-am-this
intention locate
+visual-location>
color =body
kind oval
)
(p track-body-request
=goal>
state i-am-this
intention locate
=imaginal>
type body
color =color
=visual-location>
color =body
==>
+visual>
cmd move-attention
screen-pos =visual-location
=goal>
intention track
)
(p track-body-track
=goal>
state i-am-this
intention track
=visual>
?manual>
state free
?visual>
state free
?retrieval>
state free
==>
+visual>
cmd start-tracking
+manual>
cmd press-key
key s
=goal>
state find-goal
intention search
)
(p search-goal
=goal>
state find-goal
intention search
goalcolor =col
?visual>
buffer full
?manual>
state free
==>
+visual-location>
kind oval
color =col
=goal>
intention check
)
(p not-found-goal
=goal>
state find-goal
intention check
bodycolor =body
?visual-location>
;buffer failure
state error
?visual>
;state busy
buffer full
==>
=goal>
state search-goal
intention move
-imaginal>
)
(p what-are-those-tiles
=goal>
state search-goal
intention interact
bodycolor =bodycol
goalcolor =goalcol
==>
+visual-location>
kind oval
- color =bodycol
- color =goalcol
)
(p move visual-location-into-bounded-imaginal
=goal>
state search-goal
intention interact
bodycolor =bodycol
goalcolor =goalcol
=visual-location>
kind oval
- color =bodycol
- color =goalcol
color =tilecolor
screen-x =x
screen-y =y
==>
+imaginal>
leftbound =x
rightbound =x
upbound =y
downbound =y
)
(p i-want-to-move-to-this-position-range
=goal>
state search-goal
intention interact
bodycolor =bodycol
goalcolor =goalcol
=imaginal>
leftbound =leftbound
rightbound =rightbound
upbound =upbound
downbound =downbound
==>
+visual-location>
kind oval
color =bodycolor
)
;(p block-tile-check
; =goal>
; state
; intention
; I DIDN'T MOVE
; =visual-location>
; same as before
;)
;(p reward-tile-check
; +visual-location>
; kind text
; color red
; color red kind text value '+'
;)
;(p penalty-tile-check
; color red kind text value '-'
;)
(p leftcheck
=goal>
state search-goal
intention move
border-left-x =leftborderx
=visual-location>
screen-x =x
> screen-x =leftborderx
screen-y =y
!eval! (> =x (+ =leftborderx 12))
?imaginal>
buffer empty
state free
==>
!bind! =leftmove (- =x 25)
+imaginal>
leftbound =leftmove
rightbound =leftmove
upbound =y
downbound =y
)
(p i-want-to-move-to-this-position-range-checkleft
=goal>
state search-goal
intention move
bodycolor =bodycol
goalcolor =goalcol
=imaginal>
leftbound =leftbound
rightbound =rightbound
upbound =upbound
downbound =downbound
=visual-location>
kind oval
color =bodycolor
> screen-x =leftbound
==>
+manual>
cmd press-key
key a
=goal>
state find-goal
intention search
)
(p rightcheck
=goal>
state search-goal
intention move
border-right-x =rightborderx
=visual-location>
screen-x =x
< screen-x =rightborderx
screen-y =y
!eval! (< =x (- =rightborderx 13))
?imaginal>
buffer empty
state free
==>
!bind! =rightmove (+ =x 25)
+imaginal>
leftbound =rightmove
rightbound =rightmove
upbound =y
downbound =y
=visual-location>
)
(p i-want-to-move-to-this-position-range-checkright
=goal>
state search-goal
intention move
bodycolor =bodycol
goalcolor =goalcol
=imaginal>
leftbound =leftbound
rightbound =rightbound
upbound =upbound
downbound =downbound
=visual-location>
kind oval
color =bodycolor
< screen-x =rightbound
==>
+manual>
cmd press-key
key d
=goal>
state find-goal
intention search
)
(p downcheck
=goal>
state search-goal
intention move
border-lower-y =downbordery
=visual-location>
screen-x =x
< screen-y =downbordery
screen-y =y
!eval! (< =y (- =downbordery 12))
?imaginal>
buffer empty
state free
==>
!bind! =downmove (- =y 25)
+imaginal>
leftbound =x
rightbound =x
upbound =downmove
downbound =downmove
)
(p i-want-to-move-to-this-position-range-checkdown
=goal>
state search-goal
intention move
bodycolor =bodycol
goalcolor =goalcol
=imaginal>
leftbound =leftbound
rightbound =rightbound
upbound =upbound
downbound =downbound
=visual-location>
kind oval
color =bodycolor
> screen-y =downbound
==>
+manual>
cmd press-key
key s
=goal>
state find-goal
intention search
)
(p upcheck
=goal>
state search-goal
intention move
border-upper-y =upbordery
=visual-location>
screen-x =x
> screen-y =upbordery
screen-y =y
!eval! (> =y (+ =upbordery 12))
?imaginal>
buffer empty
state free
==>
=visual-location>
!bind! =upmove (+ =y 25)
+imaginal>
leftbound =x
rightbound =x
upbound =upmove
downbound =upmove
)
(p i-want-to-move-to-this-position-range-checkup
=goal>
state search-goal
intention move
bodycolor =bodycol
goalcolor =goalcol
=imaginal>
leftbound =leftbound
rightbound =rightbound
upbound =upbound
downbound =downbound
=visual-location>
kind oval
color =bodycolor
< screen-y =upbound
==>
+manual>
cmd press-key
key w
=goal>
state find-goal
intention search
)
(p found-goal
=goal>
state find-goal
intention check
goalcolor =goalcol
bodycolor =bodycol
=visual-location>
kind oval
color =goalcol
screen-x =x
screen-y =y
==>
=goal>
state move-to-goal
intention find-direction
+visual-location>
color =bodycol
kind oval
+imaginal>
leftbound =x
rightbound =x
upbound =y
downbound =y
)
(p target-check
=goal>
state move-to-goal
intention find-direction
=imaginal>
leftbound =x
rightbound =x
upbound =y
downbound =y
?retrieval>
state free
==>
=goal>
state move-to-goal
intention move
=imaginal>
)
(p target-tile-check-down
=goal>
state move-to-goal
intention move
=visual-location>
screen-x =x
screen-y =y
=imaginal>
> upbound =y
> downbound =y
?manual>
state free
==>
+manual>
cmd press-key
key s
=goal>
intention find-direction
=imaginal>
)
(p target-tile-check-up
=goal>
state move-to-goal
intention move
=visual-location>
screen-x =x
screen-y =y
=imaginal>
< upbound =y
< downbound =y
?manual>
state free
==>
+manual>
cmd press-key
key w
=goal>
intention find-direction
=imaginal>
)
(p target-tile-check-left
=goal>
state move-to-goal
intention move
=visual-location>
screen-x =x
screen-y =y
=imaginal>
< leftbound =x
< rightbound =x
?manual>
state free
==>
+manual>
cmd press-key
key a
=goal>
intention find-direction
=imaginal>
)
(p target-tile-check-right
=goal>
state move-to-goal
intention move
=visual-location>
screen-x =x
screen-y =y
=imaginal>
> leftbound =x
> rightbound =x
?manual>
state free
==>
+manual>
cmd press-key
key d
=goal>
intention find-direction
=imaginal>
)
)