Browse Source

last modification

master
김선중 1 year ago
parent
commit
153c36e4f6
1 changed files with 24 additions and 38 deletions
  1. +24
    -38
      Analysis/0508_green_right-turn_arrow/0508_green_right-turn_arrow.ipynb

+ 24
- 38
Analysis/0508_green_right-turn_arrow/0508_green_right-turn_arrow.ipynb View File

@ -95,7 +95,8 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Traffic light c30 is not known\n"
"Traffic light c30 is known\n",
"('c30', 'i0', 'i1', 'i2', 'i3', 'i5', 'i6', 'i7', 'i8', 'i9', 'u00', 'u20', 'u30', 'u31', 'u32', 'u60')\n"
] ]
} }
], ],
@ -117,7 +118,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -126,25 +127,10 @@
"text": [ "text": [
"1. 데이터를 로드합니다.\n", "1. 데이터를 로드합니다.\n",
"1-1. 네트워크가 로드되었습니다.\n", "1-1. 네트워크가 로드되었습니다.\n",
"1-2. 테이블들이 로드되었습니다.\n"
]
},
{
"ename": "TraCIException",
"evalue": "Traffic light 'c30' is not known",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mTraCIException\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn[3], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;28mself\u001b[39m \u001b[38;5;241m=\u001b[39m DailyPreprocessor()\n\u001b[1;32m----> 2\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload_data\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[1;32mc:\\Github\\snits_siggen\\Analysis\\0508_green_right-turn_arrow\\../../Scripts\\preprocess_daily.py:32\u001b[0m, in \u001b[0;36mDailyPreprocessor.load_data\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 30\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mload_networks()\n\u001b[0;32m 31\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mload_tables()\n\u001b[1;32m---> 32\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheck_networks\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 33\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcheck_tables()\n\u001b[0;32m 34\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mrestore_objects()\n",
"File \u001b[1;32mc:\\Github\\snits_siggen\\Analysis\\0508_green_right-turn_arrow\\../../Scripts\\preprocess_daily.py:88\u001b[0m, in \u001b[0;36mDailyPreprocessor.check_networks\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 86\u001b[0m node_id \u001b[38;5;241m=\u001b[39m node\u001b[38;5;241m.\u001b[39mgetID()\n\u001b[0;32m 87\u001b[0m from_xml \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlen\u001b[39m([c \u001b[38;5;28;01mfor\u001b[39;00m c \u001b[38;5;129;01min\u001b[39;00m node\u001b[38;5;241m.\u001b[39mgetConnections() \u001b[38;5;28;01mif\u001b[39;00m c\u001b[38;5;241m.\u001b[39mgetTLLinkIndex() \u001b[38;5;241m>\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m])\n\u001b[1;32m---> 88\u001b[0m from_traci \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlen\u001b[39m(\u001b[43mtraci\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtrafficlight\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mgetRedYellowGreenState\u001b[49m\u001b[43m(\u001b[49m\u001b[43mnode_id\u001b[49m\u001b[43m)\u001b[49m)\n\u001b[0;32m 89\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m from_xml \u001b[38;5;241m!=\u001b[39m from_traci:\n\u001b[0;32m 90\u001b[0m sub \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mid\u001b[39m\u001b[38;5;124m'\u001b[39m: node_id, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mnode\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mnote\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m유효하지 않은 연결이있음. netedit에서 clean states 필요.\u001b[39m\u001b[38;5;124m'\u001b[39m}\n",
"File \u001b[1;32mC:\\Program Files (x86)\\Eclipse\\Sumo\\tools\\traci\\_trafficlight.py:176\u001b[0m, in \u001b[0;36mTrafficLightDomain.getRedYellowGreenState\u001b[1;34m(self, tlsID)\u001b[0m\n\u001b[0;32m 169\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mgetRedYellowGreenState\u001b[39m(\u001b[38;5;28mself\u001b[39m, tlsID):\n\u001b[0;32m 170\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"getRedYellowGreenState(string) -> string\u001b[39;00m\n\u001b[0;32m 171\u001b[0m \n\u001b[0;32m 172\u001b[0m \u001b[38;5;124;03m Returns the named tl's state as a tuple of light definitions from\u001b[39;00m\n\u001b[0;32m 173\u001b[0m \u001b[38;5;124;03m rugGyYoO, for red, yed-yellow, green, yellow, off, where lower case letters mean that the stream\u001b[39;00m\n\u001b[0;32m 174\u001b[0m \u001b[38;5;124;03m has to decelerate.\u001b[39;00m\n\u001b[0;32m 175\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[1;32m--> 176\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_getUniversal\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtc\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mTL_RED_YELLOW_GREEN_STATE\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtlsID\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[1;32mC:\\Program Files (x86)\\Eclipse\\Sumo\\tools\\traci\\domain.py:147\u001b[0m, in \u001b[0;36mDomain._getUniversal\u001b[1;34m(self, varID, objectID, format, *values)\u001b[0m\n\u001b[0;32m 145\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_deprecatedFor:\n\u001b[0;32m 146\u001b[0m warnings\u001b[38;5;241m.\u001b[39mwarn(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe domain \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m is deprecated, use \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m instead.\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m%\u001b[39m (\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_name, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_deprecatedFor))\n\u001b[1;32m--> 147\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m _parse(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_retValFunc, varID, \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_getCmd\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvarID\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mobjectID\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mformat\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mvalues\u001b[49m\u001b[43m)\u001b[49m)\n",
"File \u001b[1;32mC:\\Program Files (x86)\\Eclipse\\Sumo\\tools\\traci\\domain.py:152\u001b[0m, in \u001b[0;36mDomain._getCmd\u001b[1;34m(self, varID, objID, format, *values)\u001b[0m\n\u001b[0;32m 150\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_connection \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 151\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m FatalTraCIError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNot connected.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m--> 152\u001b[0m r \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_connection\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_sendCmd\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_cmdGetID\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mvarID\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mobjID\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mformat\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mvalues\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 153\u001b[0m r\u001b[38;5;241m.\u001b[39mreadLength()\n\u001b[0;32m 154\u001b[0m response, retVarID \u001b[38;5;241m=\u001b[39m r\u001b[38;5;241m.\u001b[39mread(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m!BB\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n",
"File \u001b[1;32mC:\\Program Files (x86)\\Eclipse\\Sumo\\tools\\traci\\connection.py:231\u001b[0m, in \u001b[0;36mConnection._sendCmd\u001b[1;34m(self, cmdID, varID, objID, format, *values)\u001b[0m\n\u001b[0;32m 229\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_string \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m struct\u001b[38;5;241m.\u001b[39mpack(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m!i\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28mlen\u001b[39m(objID)) \u001b[38;5;241m+\u001b[39m objID\n\u001b[0;32m 230\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_string \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m packed\n\u001b[1;32m--> 231\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_sendExact\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
"File \u001b[1;32mC:\\Program Files (x86)\\Eclipse\\Sumo\\tools\\traci\\connection.py:144\u001b[0m, in \u001b[0;36mConnection._sendExact\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 142\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_string \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mbytes\u001b[39m()\n\u001b[0;32m 143\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_queue \u001b[38;5;241m=\u001b[39m []\n\u001b[1;32m--> 144\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m TraCIException(err, prefix[\u001b[38;5;241m1\u001b[39m], _RESULTS[prefix[\u001b[38;5;241m2\u001b[39m]])\n\u001b[0;32m 145\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m prefix[\u001b[38;5;241m1\u001b[39m] \u001b[38;5;241m!=\u001b[39m command:\n\u001b[0;32m 146\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m FatalTraCIError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mReceived answer \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m for command \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m.\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m%\u001b[39m (prefix[\u001b[38;5;241m1\u001b[39m], command))\n",
"\u001b[1;31mTraCIException\u001b[0m: Traffic light 'c30' is not known"
"1-2. 테이블들이 로드되었습니다.\n",
"1-3. 네트워크의 모든 clean state requirement들을 체크했습니다.\n",
"1-4. 테이블들의 무결성 검사를 완료했습니다.\n",
"1-5. 주요 객체 (리스트, 딕셔너리)들을 저장했습니다.\n"
] ]
} }
], ],
@ -155,7 +141,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -163,30 +149,30 @@
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"u31 traffic_light\n", "u31 traffic_light\n",
"i3 traffic_light\n",
"i3 traffic_light_right_on_red\n",
"u00 traffic_light\n", "u00 traffic_light\n",
"i0 traffic_light\n",
"i0 traffic_light_right_on_red\n",
"u60 traffic_light\n", "u60 traffic_light\n",
"d12 dead_end\n", "d12 dead_end\n",
"n13 priority\n", "n13 priority\n",
"i8 traffic_light\n",
"i9 traffic_light\n",
"i8 traffic_light_right_on_red\n",
"i9 traffic_light_right_on_red\n",
"n14 priority\n", "n14 priority\n",
"n11 priority\n", "n11 priority\n",
"i7 traffic_light\n",
"i7 traffic_light_right_on_red\n",
"u32 traffic_light\n", "u32 traffic_light\n",
"n06 priority\n", "n06 priority\n",
"n09 priority\n", "n09 priority\n",
"i6 traffic_light\n",
"i5 traffic_light\n",
"i6 traffic_light_right_on_red\n",
"i5 traffic_light_right_on_red\n",
"n08 priority\n", "n08 priority\n",
"c30 traffic_light\n", "c30 traffic_light\n",
"n00 priority\n", "n00 priority\n",
"i1 traffic_light\n",
"i1 traffic_light_right_on_red\n",
"n10 priority\n", "n10 priority\n",
"n04 priority\n", "n04 priority\n",
"n03 priority\n", "n03 priority\n",
"i2 traffic_light\n",
"i2 traffic_light_right_on_red\n",
"n01 priority\n", "n01 priority\n",
"n02 priority\n", "n02 priority\n",
"d07 dead_end\n", "d07 dead_end\n",
@ -223,7 +209,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -238,7 +224,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3,
"execution_count": 7,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1368,7 +1354,7 @@
"59 090 NaN NaN u31 u_turn straight " "59 090 NaN NaN u31 u_turn straight "
] ]
}, },
"execution_count": 3,
"execution_count": 7,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -1379,7 +1365,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4,
"execution_count": 8,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1570,7 +1556,7 @@
"[128 rows x 8 columns]" "[128 rows x 8 columns]"
] ]
}, },
"execution_count": 4,
"execution_count": 8,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }
@ -1581,7 +1567,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13,
"execution_count": 9,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -2476,7 +2462,7 @@
"59 NaN GGGGrGGG straight " "59 NaN GGGGrGGG straight "
] ]
}, },
"execution_count": 13,
"execution_count": 9,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
} }

Loading…
Cancel
Save