|
1001 | 1001 | "class adxyz_SimpleReflexStateVacuumAgent(Agent):\n",
|
1002 | 1002 | " pass"
|
1003 | 1003 | ]
|
| 1004 | + }, |
| 1005 | + { |
| 1006 | + "cell_type": "markdown", |
| 1007 | + "metadata": {}, |
| 1008 | + "source": [ |
| 1009 | + "# Chapter 3" |
| 1010 | + ] |
| 1011 | + }, |
| 1012 | + { |
| 1013 | + "cell_type": "markdown", |
| 1014 | + "metadata": {}, |
| 1015 | + "source": [ |
| 1016 | + "We are looking to design agents that can solve goal seeking problems.\n", |
| 1017 | + "Step 1: Define the goal, which is a state of the environment. For example, the desired goal might be \"Car in Bucharest\" or \"Robot in square (10,10) with all squares clean\" \n", |
| 1018 | + "Step 2: Define the problem. \n", |
| 1019 | + "- Define the states of the environment (atomic)\n", |
| 1020 | + "- Define the initial state\n", |
| 1021 | + "- Define legal actions\n", |
| 1022 | + "- Define transitions\n", |
| 1023 | + "- Define goal test\n", |
| 1024 | + "- Define path/step costs" |
| 1025 | + ] |
| 1026 | + }, |
| 1027 | + { |
| 1028 | + "cell_type": "markdown", |
| 1029 | + "metadata": {}, |
| 1030 | + "source": [ |
| 1031 | + "graph-search: A key algorithm for expanding the search space, that avoids redundent paths. The search methods in this chapter are based on graph-search algorithm.\n", |
| 1032 | + "Each step of the algorithm does this:\n", |
| 1033 | + "Unexplored state -> frontier states -> explored states.\n", |
| 1034 | + "A state can only be in one of the three above categories." |
| 1035 | + ] |
| 1036 | + }, |
| 1037 | + { |
| 1038 | + "cell_type": "markdown", |
| 1039 | + "metadata": {}, |
| 1040 | + "source": [ |
| 1041 | + "Infrastructure for search algorithms:\n", |
| 1042 | + "Graphs - nodes that include references to \n", |
| 1043 | + "parent nodes\n", |
| 1044 | + "state descriptions\n", |
| 1045 | + "action that got from parent to child node\n", |
| 1046 | + "path cost (from initial state).\n", |
| 1047 | + "\n", |
| 1048 | + "Types of cost:\n", |
| 1049 | + "Search cost (time to determine solution)\n", |
| 1050 | + "Path cost (cost of actual solution - for example distance on a roadmap)\n", |
| 1051 | + "Total cost: Sum of search + path cost (with appropriate scaling to put them in common units)." |
| 1052 | + ] |
| 1053 | + }, |
| 1054 | + { |
| 1055 | + "cell_type": "markdown", |
| 1056 | + "metadata": {}, |
| 1057 | + "source": [ |
| 1058 | + "## Types of Search Strategies" |
| 1059 | + ] |
| 1060 | + }, |
| 1061 | + { |
| 1062 | + "cell_type": "markdown", |
| 1063 | + "metadata": {}, |
| 1064 | + "source": [ |
| 1065 | + "Algorithm evaluation criteria:\n", |
| 1066 | + "- Completeness (Does the algorithm find a solution - or all solutions)\n", |
| 1067 | + "- Optimality (Does the algorithm find the best solution)\n", |
| 1068 | + "- Time complexity (how long does the algorithm take to find solution)\n", |
| 1069 | + "- Space complexity (how much memory is used)" |
| 1070 | + ] |
| 1071 | + }, |
| 1072 | + { |
| 1073 | + "cell_type": "markdown", |
| 1074 | + "metadata": {}, |
| 1075 | + "source": [ |
| 1076 | + "### Uninformed search" |
| 1077 | + ] |
| 1078 | + }, |
| 1079 | + { |
| 1080 | + "cell_type": "markdown", |
| 1081 | + "metadata": {}, |
| 1082 | + "source": [ |
| 1083 | + "This includes all search algorithms that have no idea whether one choice is \"more promising\" than another non-goal state. These algorithms generate non-goal states and test for goal states." |
| 1084 | + ] |
| 1085 | + }, |
| 1086 | + { |
| 1087 | + "cell_type": "markdown", |
| 1088 | + "metadata": {}, |
| 1089 | + "source": [ |
| 1090 | + "- Breadth-first search: Each node is expanded into the successor nodes one level at a time. Uses a FIFO queue for the frontier." |
| 1091 | + ] |
| 1092 | + }, |
| 1093 | + { |
| 1094 | + "cell_type": "markdown", |
| 1095 | + "metadata": {}, |
| 1096 | + "source": [ |
| 1097 | + "Pseudo-code for BFS search:\n", |
| 1098 | + "\n", |
| 1099 | + " unexploredNodes = {AllStates}-initialState\n", |
| 1100 | + " exploredNodes = {}\n", |
| 1101 | + " frontierNodes = initialState\n", |
| 1102 | + " \n", |
| 1103 | + " while currentNode != goalState:\n", |
| 1104 | + " currentNode = frontierNodes.pop\n", |
| 1105 | + " if currentNode == goalState:\n", |
| 1106 | + " break\n", |
| 1107 | + " else:\n", |
| 1108 | + " exploredNodes.push(currentNode)\n", |
| 1109 | + " for childNode in currentNode.children:\n", |
| 1110 | + " frontierNodes.push(childNode)\n", |
| 1111 | + " unexploredNodes.delete(childNode)" |
| 1112 | + ] |
| 1113 | + }, |
| 1114 | + { |
| 1115 | + "cell_type": "markdown", |
| 1116 | + "metadata": {}, |
| 1117 | + "source": [ |
| 1118 | + "### Informed search (heuristics)" |
| 1119 | + ] |
| 1120 | + }, |
| 1121 | + { |
| 1122 | + "cell_type": "markdown", |
| 1123 | + "metadata": {}, |
| 1124 | + "source": [] |
1004 | 1125 | }
|
1005 | 1126 | ],
|
1006 | 1127 | "metadata": {
|
|
0 commit comments