Commit 4a6ca8d
committed
Several independently-verifiable defects in the Hybrid Wumpus Agent stack:
- PlanRoute (search.py) mutated the search state in place (corrupting A*'s
tree), wrote the y coordinate as a list (set_location(x, [y])), and its
goal_test/h assumed a single (x, y) goal while callers pass a list of
cells. Rewrite result() to return a fresh state, and make goal_test/h
accept a collection of goal cells or position objects (matching
orientation too, for shooting positions).
- WumpusPosition (logic.py) defined __eq__ but no __hash__, so it was
unhashable and could not be used in A*'s explored set or plan_shot's set.
Add __hash__.
- WumpusKB.ask_if_true used pl_resolution (full resolution closure), which
does not terminate on the wumpus clause set. Use SAT entailment
(KB & ~query unsatisfiable); verified to match tt_entails and to answer
in well under a second.
- The 'rules about last action' axiom used a biconditional, wrongly forcing
MoveForward whenever the agent is not turning; it must be an implication
(the agent may instead grab/shoot/climb) (#1249).
Add a PlanRoute route-planning test. The remaining HybridWumpusAgent
work (execute() unvisited/orientation logic and WumpusEnvironment
integration) is tracked in #961.
1 parent ad7fd82 commit 4a6ca8d
3 files changed
Lines changed: 69 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1441 | 1441 | | |
1442 | 1442 | | |
1443 | 1443 | | |
1444 | | - | |
1445 | | - | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
1446 | 1447 | | |
1447 | 1448 | | |
1448 | 1449 | | |
| |||
1451 | 1452 | | |
1452 | 1453 | | |
1453 | 1454 | | |
1454 | | - | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
1455 | 1459 | | |
1456 | 1460 | | |
1457 | 1461 | | |
| |||
1482 | 1486 | | |
1483 | 1487 | | |
1484 | 1488 | | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
1485 | 1492 | | |
1486 | 1493 | | |
1487 | 1494 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
| 782 | + | |
| 783 | + | |
783 | 784 | | |
784 | | - | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
785 | 788 | | |
786 | 789 | | |
787 | 790 | | |
788 | | - | |
| 791 | + | |
789 | 792 | | |
790 | | - | |
| 793 | + | |
791 | 794 | | |
792 | | - | |
| 795 | + | |
793 | 796 | | |
794 | | - | |
| 797 | + | |
795 | 798 | | |
796 | 799 | | |
797 | 800 | | |
798 | 801 | | |
799 | 802 | | |
800 | 803 | | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
| 804 | + | |
811 | 805 | | |
812 | 806 | | |
813 | 807 | | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
| 808 | + | |
824 | 809 | | |
825 | | - | |
826 | | - | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
827 | 813 | | |
828 | | - | |
| 814 | + | |
829 | 815 | | |
830 | 816 | | |
831 | | - | |
832 | | - | |
833 | | - | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
834 | 828 | | |
835 | 829 | | |
836 | | - | |
837 | | - | |
838 | | - | |
| 830 | + | |
839 | 831 | | |
840 | | - | |
841 | | - | |
842 | | - | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
843 | 837 | | |
844 | 838 | | |
845 | 839 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
443 | 444 | | |
444 | 445 | | |
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 | + | |
446 | 473 | | |
447 | 474 | | |
0 commit comments