Compare commits
6 Commits
aa9c025369
...
c0fed7c932
Author | SHA1 | Date | |
---|---|---|---|
c0fed7c932 | |||
f92c3d07f1 | |||
70cab97cfc | |||
28d17d5c35 | |||
b32c86c302 | |||
fe104fe738 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,5 +1,2 @@
|
||||
__pycache__
|
||||
*/__pycache__
|
||||
*sublime*
|
||||
env/
|
||||
venv/
|
||||
__pycache__
|
||||
|
BIN
KI_PE20_SIM_1.pdf
Normal file
BIN
KI_PE20_SIM_1.pdf
Normal file
Binary file not shown.
@ -498,3 +498,4 @@
|
||||
23;24;20;-76;45;truck;truck;3537;ascending;country_road (separated);day;dry;car;120;continue
|
||||
25;35;23;-67;49;sportscar;truck;4248;flat;country_road (separated);day;rain;car;100;continue
|
||||
22,5;24,5;28,5;-175;36;car;car;1512;flat;country_road (separated);day;dry;truck;100;continue
|
||||
22,5;27,5;34,5;-68;40;truck;motorcycle;3285;flat;country_road (separated);day;rain;truck;120;continue
|
|
@ -1,4 +1,4 @@
|
||||
type_street_slope, flat, ascending, decending
|
||||
flat, 1.0, 0.5, 0.6
|
||||
ascending, 0.5, 1.0, 0.3
|
||||
decending, 0.6, 0.3, 1.0
|
||||
flat, 1.0, 0.3, 0.7
|
||||
ascending, 0.3, 1.0, 0.1
|
||||
decending, 0.7, 0.1, 1.0
|
|
@ -1,3 +1,3 @@
|
||||
type_street, country_road (separated), autobahn
|
||||
country_road (separated), 1.0, 0.5
|
||||
autobahn, 0.5, 1.0
|
||||
country_road (separated), 1.0, 0.3
|
||||
autobahn, 0.3, 1.0
|
|
@ -1,5 +1,5 @@
|
||||
type_time, night, dusk, day, dawn
|
||||
night, 1.0, 0.5, 0.6, 0.8
|
||||
night, 1.0, 0.5, 0.2, 0.8
|
||||
dusk, 0.5, 1.0, 0.3, 0.5
|
||||
day, 0.6, 0.3, 1.0, 0.6
|
||||
day, 0.2, 0.3, 1.0, 0.6
|
||||
dawn, 0.8, 0.5, 0.6, 1.0
|
|
@ -1,5 +1,5 @@
|
||||
type_vehicle, car, motorcycle, sportscar, truck
|
||||
car, 1.0, 0.5, 0.6, 0.8
|
||||
motorcycle, 0.5, 1.0, 0.3, 0.5
|
||||
sportscar, 0.6, 0.3, 1.0, 0.6
|
||||
truck, 0.8, 0.5, 0.6, 1.0
|
||||
car, 1.0, 0.3, 0.6, 0.3
|
||||
motorcycle, 0.3, 1.0, 0.9, 0.1
|
||||
sportscar, 0.6, 0.9, 1.0, 0.2
|
||||
truck, 0.3, 0.1, 0.2, 1.0
|
|
@ -1,5 +1,5 @@
|
||||
type_weather, dry, rain, fog, snow_ice
|
||||
dry, 1.0, 0.5, 0.6, 0.8
|
||||
rain, 0.5, 1.0, 0.3, 0.5
|
||||
fog, 0.6, 0.3, 1.0, 0.6
|
||||
snow_ice, 0.8, 0.5, 0.6, 1.0
|
||||
dry, 1.0, 0.4, 0.2, 0.1
|
||||
rain, 0.4, 1.0, 0.8, 0.6
|
||||
fog, 0.2, 0.8, 1.0, 0.4
|
||||
snow_ice, 0.1, 0.6, 0.4, 1.0
|
|
105
explore.ipynb
105
explore.ipynb
@ -2,7 +2,7 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -13,7 +13,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -34,29 +34,9 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"CaseBase(cases=499, fields=[('v', 'v_left', 'v_front', 'd_left', 'd_front', 'type_left', 'type_front', 'radius_curve(m)', 'slope_street', 'street_type', 'time', 'weather', 'type_vehicle', 'speed_limit(km/h)'), 'action'])\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"[Case(problem={'v_left': 36.5, 'v_front': 23.0, 'd_left': -56.0, 'd_front': 45.0, 'type_left': 'sportscar', 'type_front': 'truck', 'radius_curve(m)': 2237.0, 'slope_street': 'flat', 'street_type': 'country_road (separated)', 'time': 'night', 'weather': 'dry', 'type_vehicle': 'car', 'speed_limit(km/h)': 100.0}, solution={'action': 'continue'}),\n",
|
||||
" Case(problem={'v_left': 32.0, 'v_front': 28.0, 'd_left': -114.0, 'd_front': 44.0, 'type_left': 'motorcycle', 'type_front': 'car', 'radius_curve(m)': 3891.0, 'slope_street': 'ascending', 'street_type': 'autobahn', 'time': 'night', 'weather': 'dry', 'type_vehicle': 'truck', 'speed_limit(km/h)': 250.0}, solution={'action': 'continue'}),\n",
|
||||
" Case(problem={'v_left': 43.0, 'v_front': 31.5, 'd_left': -98.0, 'd_front': 60.0, 'type_left': 'truck', 'type_front': 'car', 'radius_curve(m)': 1720.0, 'slope_street': 'flat', 'street_type': 'autobahn', 'time': 'dusk', 'weather': 'rain', 'type_vehicle': 'car', 'speed_limit(km/h)': 130.0}, solution={'action': 'continue'})]"
|
||||
]
|
||||
},
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"case_base = CaseBase.from_csv(\n",
|
||||
" \"data/SIM_001.csv\",\n",
|
||||
@ -72,7 +52,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@ -97,6 +77,11 @@
|
||||
")\n",
|
||||
"\n",
|
||||
"case_base.add_symbolic_sim(\n",
|
||||
" field = \"street_type\",\n",
|
||||
" similarity_matrix = create_similarity_matrix(\"data/street_type_sim.csv\", \"type_street\")\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"case_base.add_symbolic_sim(\n",
|
||||
" field = \"time\",\n",
|
||||
" similarity_matrix = create_similarity_matrix(\"data/time_type_sim.csv\", \"type_time\")\n",
|
||||
")\n",
|
||||
@ -109,53 +94,25 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Your Query:\n",
|
||||
" - v = 28\n",
|
||||
" - v_left = 37\n",
|
||||
" - v_front = 22.5\n",
|
||||
" - d_left = -20\n",
|
||||
" - d_front = 51\n",
|
||||
" - radius_curve = 2000\n",
|
||||
" - speed_limit = 200\n",
|
||||
" - type_vehicle = motorcycle\n",
|
||||
" - type_left = motorcycle\n",
|
||||
" - type_front = motorcycle\n",
|
||||
"\n",
|
||||
"I recommend you this car:\n",
|
||||
"Accelerated_lane_change\n",
|
||||
"\n",
|
||||
"Explanation:\n",
|
||||
" - v_left = 37.0 (similarity: 1.00)\n",
|
||||
" - v_front = 22.5 (similarity: 1.00)\n",
|
||||
" - d_left = -17.0 (similarity: 0.25)\n",
|
||||
" - d_front = 51.0 (similarity: 1.00)\n",
|
||||
" - radius_curve(m) = 3020.0 (similarity: 0.00)\n",
|
||||
" - speed_limit(km/h) = 120.0 (similarity: 0.01)\n",
|
||||
" - type_vehicle = car (similarity: 0.50)\n",
|
||||
" - type_left = truck (similarity: 0.50)\n",
|
||||
" - type_front = truck (similarity: 0.50)\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"query = Query.from_problems(\n",
|
||||
" v = 28,\n",
|
||||
" v_left = 37,\n",
|
||||
" v_front = 22.5,\n",
|
||||
" d_left = -20,\n",
|
||||
" d_front = 51,\n",
|
||||
" radius_curve = 2000,\n",
|
||||
" speed_limit = 200,\n",
|
||||
" type_vehicle = \"motorcycle\",\n",
|
||||
" v = 28.5,\n",
|
||||
" v_left = 42.5,\n",
|
||||
" v_front = 5,\n",
|
||||
" d_left = -137,\n",
|
||||
" d_front = 54,\n",
|
||||
" type_left = \"motorcycle\",\n",
|
||||
" type_front = \"motorcycle\",\n",
|
||||
" type_front = \"truck\",\n",
|
||||
" radius_curve = 2391,\n",
|
||||
" slope_street = \"flat\",\n",
|
||||
" street_type = \"country_road (separated)\",\n",
|
||||
" time = \"day\",\n",
|
||||
" weather = \"dry\",\n",
|
||||
" type_vehicle = \"car\",\n",
|
||||
" speed_limit = 100,\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"# sim_funcs: manhattan_sim, euclid_sim\n",
|
||||
@ -165,11 +122,15 @@
|
||||
" v_front = euclid_sim,\n",
|
||||
" d_left = euclid_sim,\n",
|
||||
" d_front = euclid_sim,\n",
|
||||
" radius_curve = manhattan_sim,\n",
|
||||
" speed_limit = manhattan_sim,\n",
|
||||
" type_vehicle = symbolic_sim,\n",
|
||||
" type_left = symbolic_sim,\n",
|
||||
" type_front = symbolic_sim,\n",
|
||||
" radius_curve = euclid_sim,\n",
|
||||
" slope_street = symbolic_sim,\n",
|
||||
" street_type = symbolic_sim,\n",
|
||||
" time = symbolic_sim,\n",
|
||||
" weather = symbolic_sim,\n",
|
||||
" type_vehicle = symbolic_sim,\n",
|
||||
" speed_limit = euclid_sim,\n",
|
||||
")\n",
|
||||
"\n",
|
||||
"print(\"Your Query:\")\n",
|
||||
@ -206,7 +167,7 @@
|
||||
"orig_nbformat": 4,
|
||||
"vscode": {
|
||||
"interpreter": {
|
||||
"hash": "4c522f398908c053844cc48bcd755f88db468f52081f171c67c4d9e41e8d16a6"
|
||||
"hash": "c6b11de3c41b7cafaa0ac1297b550056ae3875bbf0c337fa48ab4f33656fc527"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user