Best JavaScript code snippet using storybook-root
building_models.py
Source:building_models.py
1import math2from numpy import arange3def outline_obstacles_demo_building_1(obstacle_x, obstacle_y, dynamic_size):4 # outline of room5 for i in arange(0, 60 * dynamic_size, dynamic_size):6 obstacle_x.append(i)7 obstacle_y.append(0.0)8 for i in arange(0, 60 * dynamic_size, dynamic_size):9 obstacle_x.append(60.0 * dynamic_size)10 obstacle_y.append(i)11 for i in arange(0, 61 * dynamic_size, dynamic_size):12 obstacle_x.append(i)13 obstacle_y.append(60.0 * dynamic_size)14 for i in arange(0, 61 * dynamic_size, dynamic_size):15 obstacle_x.append(0.0)16 obstacle_y.append(i)17 # outline obstacle top left18 for i in arange(0, 6 * dynamic_size, dynamic_size):19 obstacle_x.append(i)20 obstacle_y.append(40 * dynamic_size)21 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):22 obstacle_y.append(i)23 obstacle_x.append(6 * dynamic_size)24 # outline exit/enter 125 for i in arange(6 * dynamic_size, 10 * dynamic_size, dynamic_size):26 obstacle_y.append(i)27 obstacle_x.append(4 * dynamic_size)28 for i in arange(6 * dynamic_size, 10 * dynamic_size, dynamic_size):29 obstacle_y.append(i)30 obstacle_x.append(8 * dynamic_size)31 for i in arange(4 * dynamic_size, 8 * dynamic_size, dynamic_size):32 obstacle_y.append(6 * dynamic_size)33 obstacle_x.append(i)34 # outline obst35 for i in arange(11 * dynamic_size, 17 * dynamic_size, dynamic_size):36 obstacle_x.append(i)37 obstacle_y.append(22 * dynamic_size)38 for i in arange(0 * dynamic_size, 22 * dynamic_size, dynamic_size):39 obstacle_y.append(i)40 obstacle_x.append(11 * dynamic_size)41 for i in arange(0 * dynamic_size, 22 * dynamic_size, dynamic_size):42 obstacle_y.append(i)43 obstacle_x.append(16 * dynamic_size)44 # outline obst45 for i in arange(30 * dynamic_size, 45 * dynamic_size, dynamic_size):46 obstacle_x.append(i)47 obstacle_y.append(40 * dynamic_size)48 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):49 obstacle_y.append(i)50 obstacle_x.append(30 * dynamic_size)51 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):52 obstacle_y.append(i)53 obstacle_x.append(45 * dynamic_size)54 # outline obst55 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):56 obstacle_x.append(i)57 obstacle_y.append(20 * dynamic_size)58 for i in arange(0, 20 * dynamic_size, dynamic_size):59 obstacle_y.append(i)60 obstacle_x.append(40 * dynamic_size)61 # outline exit/enter 262 for i in arange(30 * dynamic_size, 35 * dynamic_size, dynamic_size):63 obstacle_y.append(i)64 obstacle_x.append(40 * dynamic_size)65 for i in arange(40 * dynamic_size, 43 * dynamic_size, dynamic_size):66 obstacle_x.append(i)67 obstacle_y.append(30 * dynamic_size)68 for i in arange(40 * dynamic_size, 43 * dynamic_size, dynamic_size):69 obstacle_x.append(i)70 obstacle_y.append(35 * dynamic_size)71 return obstacle_x, obstacle_y72def outline_obstacles_demo_building_2(obstacle_x, obstacle_y, dynamic_size):73 # outline of room74 for i in arange(0, 60 * dynamic_size, dynamic_size):75 obstacle_x.append(i)76 obstacle_y.append(0.0)77 for i in arange(0, 60 * dynamic_size, dynamic_size):78 obstacle_y.append(i)79 obstacle_x.append(0.0)80 for i in arange(0, 31 * dynamic_size, dynamic_size):81 obstacle_x.append(60.0 * dynamic_size)82 obstacle_y.append(i)83 for i in arange(0, 41 * dynamic_size, dynamic_size):84 obstacle_x.append(i)85 obstacle_y.append(60.0 * dynamic_size)86 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):87 obstacle_x.append(i)88 obstacle_y.append(30 * dynamic_size)89 for i in arange(30 * dynamic_size, 60 * dynamic_size, dynamic_size):90 obstacle_y.append(i)91 obstacle_x.append(40 * dynamic_size)92 # outline obstacle top left93 for i in arange(0, 12 * dynamic_size, dynamic_size):94 obstacle_x.append(i)95 obstacle_y.append(50 * dynamic_size)96 for i in arange(0, 12 * dynamic_size, dynamic_size):97 obstacle_x.append(i)98 obstacle_y.append(40 * dynamic_size)99 for i in arange(40 * dynamic_size, 51 * dynamic_size, dynamic_size):100 obstacle_y.append(i)101 obstacle_x.append(12 * dynamic_size)102 # outline obstacle center left103 for i in arange(0, 7 * dynamic_size, dynamic_size):104 obstacle_x.append(i)105 obstacle_y.append(13 * dynamic_size)106 for i in arange(13 * dynamic_size, 25 * dynamic_size, dynamic_size):107 obstacle_y.append(i)108 obstacle_x.append(7 * dynamic_size)109 for i in arange(30 * dynamic_size, 41 * dynamic_size, dynamic_size):110 obstacle_y.append(i)111 obstacle_x.append(7 * dynamic_size)112 # outline bottom left113 for i in arange(0, 17 * dynamic_size, dynamic_size):114 obstacle_x.append(i)115 obstacle_y.append(13 * dynamic_size)116 for i in arange(7 * dynamic_size, 14 * dynamic_size, dynamic_size):117 obstacle_y.append(i)118 obstacle_x.append(17 * dynamic_size)119 for i in arange(0, 4 * dynamic_size, dynamic_size):120 obstacle_y.append(i)121 obstacle_x.append(17 * dynamic_size)122 # outline middle top123 for i in arange(30 * dynamic_size, 34 * dynamic_size, dynamic_size):124 obstacle_y.append(i)125 obstacle_x.append(25 * dynamic_size)126 for i in arange(30 * dynamic_size, 35 * dynamic_size, dynamic_size):127 obstacle_y.append(i)128 obstacle_x.append(28 * dynamic_size)129 for i in arange(25 * dynamic_size, 28 * dynamic_size, dynamic_size):130 obstacle_x.append(i)131 obstacle_y.append(30 * dynamic_size)132 for i in arange(25 * dynamic_size, 28 * dynamic_size, dynamic_size):133 obstacle_x.append(i)134 obstacle_y.append(34 * dynamic_size)135 # outline middle bottom136 j = 5137 for i in arange((30 - j) * dynamic_size, (34 - j) * dynamic_size, dynamic_size):138 obstacle_y.append(i)139 obstacle_x.append((25 - j) * dynamic_size)140 for i in arange((30 - j) * dynamic_size, (35 - j) * dynamic_size, dynamic_size):141 obstacle_y.append(i)142 obstacle_x.append((28 - j) * dynamic_size)143 for i in arange((25 - j) * dynamic_size, (28 - j) * dynamic_size, dynamic_size):144 obstacle_x.append(i)145 obstacle_y.append((30 - j) * dynamic_size)146 for i in arange((25 - j) * dynamic_size, (28 - j) * dynamic_size, dynamic_size):147 obstacle_x.append(i)148 obstacle_y.append((34 - j) * dynamic_size)149 # outline exit/enter 1150 for i in arange(54 * dynamic_size, 58 * dynamic_size, dynamic_size):151 obstacle_x.append(i)152 obstacle_y.append(17 * dynamic_size)153 for i in arange(54 * dynamic_size, 58 * dynamic_size, dynamic_size):154 obstacle_x.append(i)155 obstacle_y.append(13 * dynamic_size)156 for i in arange(13 * dynamic_size, 17 * dynamic_size, dynamic_size):157 obstacle_y.append(i)158 obstacle_x.append(57 * dynamic_size)159 # outline obst next to exit on top160 for i in arange(30 * dynamic_size, 40 * dynamic_size, dynamic_size):161 obstacle_x.append(i)162 obstacle_y.append(40 * dynamic_size)163 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):164 obstacle_y.append(i)165 obstacle_x.append(30 * dynamic_size)166 # outline obst above bottom right167 for i in arange(42 * dynamic_size, 56 * dynamic_size, dynamic_size):168 obstacle_x.append(i)169 obstacle_y.append(22 * dynamic_size)170 for i in arange(22 * dynamic_size, 30 * dynamic_size, dynamic_size):171 obstacle_y.append(i)172 obstacle_x.append(42 * dynamic_size)173 for i in arange(22 * dynamic_size, 30 * dynamic_size, dynamic_size):174 obstacle_y.append(i)175 obstacle_x.append(55 * dynamic_size)176 # outline obst bototm right177 for i in arange(42 * dynamic_size, 56 * dynamic_size, dynamic_size):178 obstacle_x.append(i)179 obstacle_y.append(8 * dynamic_size)180 for i in arange(0, 8 * dynamic_size, dynamic_size):181 obstacle_y.append(i)182 obstacle_x.append(42 * dynamic_size)183 for i in arange(0, 8 * dynamic_size, dynamic_size):184 obstacle_y.append(i)185 obstacle_x.append(55 * dynamic_size)186 # outline exit/enter 2 top187 for i in arange(52 * dynamic_size, 56 * dynamic_size, dynamic_size):188 obstacle_y.append(i)189 obstacle_x.append(27 * dynamic_size)190 for i in arange(52 * dynamic_size, 56 * dynamic_size, dynamic_size):191 obstacle_y.append(i)192 obstacle_x.append(24 * dynamic_size)193 for i in arange(24 * dynamic_size, 28 * dynamic_size, dynamic_size):194 obstacle_x.append(i)195 obstacle_y.append(52 * dynamic_size)196 return obstacle_x, obstacle_y197def outline_obstacles_demo_building_3(obstacle_x, obstacle_y, dynamic_size):198 # outline of room199 for i in arange(0, 20 * dynamic_size, dynamic_size):200 obstacle_x.append(i)201 obstacle_y.append(0.0)202 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):203 obstacle_x.append(i)204 obstacle_y.append(0.0)205 for i in arange(0.0, 60 * dynamic_size, dynamic_size):206 obstacle_x.append(60.0 * dynamic_size)207 obstacle_y.append(i)208 for i in arange(0.0, 61 * dynamic_size, dynamic_size):209 obstacle_x.append(i)210 obstacle_y.append(60.0 * dynamic_size)211 for i in arange(0, 61 * dynamic_size, dynamic_size):212 obstacle_x.append(0.0)213 obstacle_y.append(i)214 for i in arange(0, 30 * dynamic_size, dynamic_size):215 obstacle_x.append(20 * dynamic_size)216 obstacle_y.append(i)217 for i in arange(0, 30 * dynamic_size, dynamic_size):218 obstacle_x.append(40 * dynamic_size)219 obstacle_y.append(i)220 for i in arange(20 * dynamic_size, 41 * dynamic_size, dynamic_size):221 obstacle_x.append(i)222 obstacle_y.append(30 * dynamic_size)223 # outline obstacle middle bottom 1224 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):225 obstacle_x.append(i)226 obstacle_y.append(40 * dynamic_size)227 for i in arange(30 * dynamic_size, 40 * dynamic_size, dynamic_size):228 obstacle_y.append(i)229 obstacle_x.append(20 * dynamic_size)230 for i in arange(30 * dynamic_size, 40 * dynamic_size, dynamic_size):231 obstacle_y.append(i)232 obstacle_x.append(25 * dynamic_size)233 # outline obstacle middle bottom 2234 for i in arange(35 * dynamic_size, 41 * dynamic_size, dynamic_size):235 obstacle_x.append(i)236 obstacle_y.append(40 * dynamic_size)237 for i in arange(30 * dynamic_size, 40 * dynamic_size, dynamic_size):238 obstacle_y.append(i)239 obstacle_x.append(35 * dynamic_size)240 for i in arange(30 * dynamic_size, 40 * dynamic_size, dynamic_size):241 obstacle_y.append(i)242 obstacle_x.append(40 * dynamic_size)243 # outline obstacle middle top 1244 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):245 obstacle_x.append(i)246 obstacle_y.append(50 * dynamic_size)247 for i in arange(50 * dynamic_size, 60 * dynamic_size, dynamic_size):248 obstacle_y.append(i)249 obstacle_x.append(20 * dynamic_size)250 for i in arange(50 * dynamic_size, 60 * dynamic_size, dynamic_size):251 obstacle_y.append(i)252 obstacle_x.append(25 * dynamic_size)253 # outline obstacle middle top 2254 for i in arange(35 * dynamic_size, 41 * dynamic_size, dynamic_size):255 obstacle_x.append(i)256 obstacle_y.append(50 * dynamic_size)257 for i in arange(50 * dynamic_size, 60 * dynamic_size, dynamic_size):258 obstacle_y.append(i)259 obstacle_x.append(35 * dynamic_size)260 for i in arange(50 * dynamic_size, 60 * dynamic_size, dynamic_size):261 obstacle_y.append(i)262 obstacle_x.append(40 * dynamic_size)263 # outline obstacle top left264 for i in arange(0, 6 * dynamic_size, dynamic_size):265 obstacle_x.append(i)266 obstacle_y.append(40 * dynamic_size)267 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):268 obstacle_y.append(i)269 obstacle_x.append(6 * dynamic_size)270 # outline exit/enter 1271 for i in arange(6 * dynamic_size, 10 * dynamic_size, dynamic_size):272 obstacle_y.append(i)273 obstacle_x.append(11 * dynamic_size)274 for i in arange(6 * dynamic_size, 10 * dynamic_size, dynamic_size):275 obstacle_y.append(i)276 obstacle_x.append(16 * dynamic_size)277 for i in arange(11 * dynamic_size, 17 * dynamic_size, dynamic_size):278 obstacle_x.append(i)279 obstacle_y.append(6 * dynamic_size)280 # outline exit/enter 2281 for i in arange(6 * dynamic_size, 10 * dynamic_size, dynamic_size):282 obstacle_y.append(i)283 obstacle_x.append(49 * dynamic_size)284 for i in arange(6 * dynamic_size, 10 * dynamic_size, dynamic_size):285 obstacle_y.append(i)286 obstacle_x.append(54 * dynamic_size)287 for i in arange(49 * dynamic_size, 54 * dynamic_size, dynamic_size):288 obstacle_x.append(i)289 obstacle_y.append(6 * dynamic_size)290 # outline middle left291 for i in arange(0, 7 * dynamic_size, dynamic_size):292 obstacle_x.append(i)293 obstacle_y.append(30 * dynamic_size)294 for i in arange(0, 7 * dynamic_size, dynamic_size):295 obstacle_x.append(i)296 obstacle_y.append(10 * dynamic_size)297 for i in arange(10 * dynamic_size, 22 * dynamic_size, dynamic_size):298 obstacle_y.append(i)299 obstacle_x.append(7 * dynamic_size)300 for i in arange(26 * dynamic_size, 31 * dynamic_size, dynamic_size):301 obstacle_y.append(i)302 obstacle_x.append(7 * dynamic_size)303 # outline obst top right304 for i in arange(53 * dynamic_size, 60 * dynamic_size, dynamic_size):305 obstacle_x.append(i)306 obstacle_y.append(30 * dynamic_size)307 for i in arange(30 * dynamic_size, 41 * dynamic_size, dynamic_size):308 obstacle_y.append(i)309 obstacle_x.append(53 * dynamic_size)310 for i in arange(46 * dynamic_size, 60 * dynamic_size, dynamic_size):311 obstacle_y.append(i)312 obstacle_x.append(53 * dynamic_size)313 # outline obst top left314 for i in arange(40 * dynamic_size, 45 * dynamic_size, dynamic_size):315 obstacle_x.append(i)316 obstacle_y.append(30 * dynamic_size)317 for i in arange(40 * dynamic_size, 44 * dynamic_size, dynamic_size):318 obstacle_x.append(i)319 obstacle_y.append(10 * dynamic_size)320 for i in arange(10 * dynamic_size, 30 * dynamic_size, dynamic_size):321 obstacle_y.append(i)322 obstacle_x.append(44 * dynamic_size)323 return obstacle_x, obstacle_y324def outline_obstacles_demo_building_4(obstacle_x, obstacle_y, dynamic_size):325 # outline of room326 for i in arange(0, 20 * dynamic_size, dynamic_size):327 obstacle_x.append(i)328 obstacle_y.append(0.0)329 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):330 obstacle_x.append(i)331 obstacle_y.append(0.0)332 for i in arange(0, 60 * dynamic_size, dynamic_size):333 obstacle_x.append(60.0 * dynamic_size)334 obstacle_y.append(i)335 for i in arange(0, 21 * dynamic_size, dynamic_size):336 obstacle_x.append(i)337 obstacle_y.append(60.0 * dynamic_size)338 for i in arange(40 * dynamic_size, 61 * dynamic_size, dynamic_size):339 obstacle_x.append(i)340 obstacle_y.append(60.0 * dynamic_size)341 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):342 obstacle_x.append(20 * dynamic_size)343 obstacle_y.append(i)344 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):345 obstacle_x.append(40 * dynamic_size)346 obstacle_y.append(i)347 for i in arange(20 * dynamic_size, 41 * dynamic_size, dynamic_size):348 obstacle_x.append(i)349 obstacle_y.append(40 * dynamic_size)350 for i in arange(0, 61 * dynamic_size, dynamic_size):351 obstacle_x.append(0.0)352 obstacle_y.append(i)353 for i in arange(0 * dynamic_size, 20 * dynamic_size, dynamic_size):354 obstacle_x.append(20 * dynamic_size)355 obstacle_y.append(i)356 for i in arange(0, 20 * dynamic_size, dynamic_size):357 obstacle_x.append(40 * dynamic_size)358 obstacle_y.append(i)359 for i in arange(20 * dynamic_size, 41 * dynamic_size, dynamic_size):360 obstacle_x.append(i)361 obstacle_y.append(20 * dynamic_size)362 # outline obstacle middle bottom363 for i in arange(28 * dynamic_size, 33 * dynamic_size, dynamic_size):364 obstacle_x.append(i)365 obstacle_y.append(34 * dynamic_size)366 for i in arange(34 * dynamic_size, 41 * dynamic_size, dynamic_size):367 obstacle_y.append(i)368 obstacle_x.append(28 * dynamic_size)369 for i in arange(34 * dynamic_size, 41 * dynamic_size, dynamic_size):370 obstacle_y.append(i)371 obstacle_x.append(33 * dynamic_size)372 # outline obstacle middle top373 for i in arange(28 * dynamic_size, 33 * dynamic_size, dynamic_size):374 obstacle_x.append(i)375 obstacle_y.append(28 * dynamic_size)376 for i in arange(20 * dynamic_size, 29 * dynamic_size, dynamic_size):377 obstacle_y.append(i)378 obstacle_x.append(28 * dynamic_size)379 for i in arange(20 * dynamic_size, 29 * dynamic_size, dynamic_size):380 obstacle_y.append(i)381 obstacle_x.append(33 * dynamic_size)382 # outline obstacle top left383 for i in arange(0, 9 * dynamic_size, dynamic_size):384 obstacle_x.append(i)385 obstacle_y.append(40 * dynamic_size)386 for i in arange(14 * dynamic_size, 21 * dynamic_size, dynamic_size):387 obstacle_x.append(i)388 obstacle_y.append(40 * dynamic_size)389 # outline obstacle bottom right390 for i in arange(40 * dynamic_size, 49 * dynamic_size, dynamic_size):391 obstacle_x.append(i)392 obstacle_y.append(20 * dynamic_size)393 for i in arange(53 * dynamic_size, 61 * dynamic_size, dynamic_size):394 obstacle_x.append(i)395 obstacle_y.append(20 * dynamic_size)396 # outline exit/enter 1397 for i in arange(5 * dynamic_size, 9 * dynamic_size, dynamic_size):398 obstacle_y.append(i)399 obstacle_x.append(11 * dynamic_size)400 for i in arange(5 * dynamic_size, 9 * dynamic_size, dynamic_size):401 obstacle_y.append(i)402 obstacle_x.append(16 * dynamic_size)403 for i in arange(11 * dynamic_size, 17 * dynamic_size, dynamic_size):404 obstacle_x.append(i)405 obstacle_y.append(5 * dynamic_size)406 # outline exit/enter 2407 for i in arange(54 * dynamic_size, 58 * dynamic_size, dynamic_size):408 obstacle_y.append(i)409 obstacle_x.append(47 * dynamic_size)410 for i in arange(54 * dynamic_size, 58 * dynamic_size, dynamic_size):411 obstacle_y.append(i)412 obstacle_x.append(51 * dynamic_size)413 for i in arange(54 * dynamic_size, 58 * dynamic_size, dynamic_size):414 obstacle_y.append(i)415 obstacle_x.append(51 * dynamic_size)416 # outline middle left417 for i in arange(0, 7 * dynamic_size, dynamic_size):418 obstacle_x.append(i)419 obstacle_y.append(30 * dynamic_size)420 for i in arange(0, 7 * dynamic_size, dynamic_size):421 obstacle_x.append(i)422 obstacle_y.append(10 * dynamic_size)423 for i in arange(47 * dynamic_size, 52 * dynamic_size, dynamic_size):424 obstacle_x.append(i)425 obstacle_y.append(58 * dynamic_size)426 # outline obst top right427 for i in arange(53 * dynamic_size, 60 * dynamic_size, dynamic_size):428 obstacle_x.append(i)429 obstacle_y.append(30 * dynamic_size)430 for i in arange(30 * dynamic_size, 60 * dynamic_size, dynamic_size):431 obstacle_y.append(i)432 obstacle_x.append(53 * dynamic_size)433 # outline obst top right small434 for i in arange(40 * dynamic_size, 45 * dynamic_size, dynamic_size):435 obstacle_x.append(i)436 obstacle_y.append(57 * dynamic_size)437 for i in arange(40 * dynamic_size, 45 * dynamic_size, dynamic_size):438 obstacle_x.append(i)439 obstacle_y.append(42 * dynamic_size)440 for i in arange(42 * dynamic_size, 58 * dynamic_size, dynamic_size):441 obstacle_y.append(i)442 obstacle_x.append(44 * dynamic_size)443 return obstacle_x, obstacle_y444def outline_obstacles_demo_building_5(obstacle_x, obstacle_y, dynamic_size):445 # outline of room446 for i in arange(0, 60 * dynamic_size, dynamic_size):447 obstacle_x.append(i)448 obstacle_y.append(60.0 * dynamic_size)449 for i in arange(30 * dynamic_size, 61 * dynamic_size, dynamic_size):450 obstacle_y.append(i)451 obstacle_x.append(60.0 * dynamic_size)452 for i in arange(30 * dynamic_size, 61 * dynamic_size, dynamic_size):453 obstacle_y.append(i)454 obstacle_x.append(0.0)455 for i in arange(0, 21 * dynamic_size, dynamic_size):456 obstacle_x.append(i)457 obstacle_y.append(30.0 * dynamic_size)458 for i in arange(40 * dynamic_size, 61 * dynamic_size, dynamic_size):459 obstacle_x.append(i)460 obstacle_y.append(30.0 * dynamic_size)461 for i in arange(0, 31 * dynamic_size, dynamic_size):462 obstacle_y.append(i)463 obstacle_x.append(20.0 * dynamic_size)464 for i in arange(0, 31 * dynamic_size, dynamic_size):465 obstacle_y.append(i)466 obstacle_x.append(40.0 * dynamic_size)467 for i in arange(20 * dynamic_size, 41 * dynamic_size, dynamic_size):468 obstacle_y.append(0)469 obstacle_x.append(i)470 # outline obstacle top left471 for i in arange(0, 12 * dynamic_size, dynamic_size):472 obstacle_x.append(i)473 obstacle_y.append(50 * dynamic_size)474 for i in arange(0, 12 * dynamic_size, dynamic_size):475 obstacle_x.append(i)476 obstacle_y.append(40 * dynamic_size)477 for i in arange(40 * dynamic_size, 51 * dynamic_size, dynamic_size):478 obstacle_y.append(i)479 obstacle_x.append(12 * dynamic_size)480 # outline obstacle right481 for i in arange(45 * dynamic_size, 49 * dynamic_size, dynamic_size):482 obstacle_x.append(i)483 obstacle_y.append(40 * dynamic_size)484 for i in arange(53 * dynamic_size, 56 * dynamic_size, dynamic_size):485 obstacle_x.append(i)486 obstacle_y.append(40 * dynamic_size)487 for i in arange(30 * dynamic_size, 41 * dynamic_size, dynamic_size):488 obstacle_y.append(i)489 obstacle_x.append(45 * dynamic_size)490 for i in arange(30 * dynamic_size, 41 * dynamic_size, dynamic_size):491 obstacle_y.append(i)492 obstacle_x.append(56 * dynamic_size)493 # outline middle top494 for i in arange(30 * dynamic_size, 34 * dynamic_size, dynamic_size):495 obstacle_y.append(i)496 obstacle_x.append(25 * dynamic_size)497 for i in arange(30 * dynamic_size, 35 * dynamic_size, dynamic_size):498 obstacle_y.append(i)499 obstacle_x.append(28 * dynamic_size)500 for i in arange(25 * dynamic_size, 28 * dynamic_size, dynamic_size):501 obstacle_x.append(i)502 obstacle_y.append(30 * dynamic_size)503 for i in arange(25 * dynamic_size, 28 * dynamic_size, dynamic_size):504 obstacle_x.append(i)505 obstacle_y.append(34 * dynamic_size)506 # outline middle bottom507 for i in arange(30 * dynamic_size, 41 * dynamic_size, dynamic_size):508 obstacle_y.append(20 * dynamic_size)509 obstacle_x.append(i)510 for i in arange(30 * dynamic_size, 41 * dynamic_size, dynamic_size):511 obstacle_y.append(10 * dynamic_size)512 obstacle_x.append(i)513 for i in arange(10 * dynamic_size, 21 * dynamic_size, dynamic_size):514 obstacle_x.append(30 * dynamic_size)515 obstacle_y.append(i)516 # outline exit/enter 1517 for i in arange(3 * dynamic_size, 6 * dynamic_size, dynamic_size):518 obstacle_y.append(i)519 obstacle_x.append(23 * dynamic_size)520 for i in arange(3 * dynamic_size, 6 * dynamic_size, dynamic_size):521 obstacle_y.append(i)522 obstacle_x.append(27 * dynamic_size)523 for i in arange(23 * dynamic_size, 28 * dynamic_size, dynamic_size):524 obstacle_x.append(i)525 obstacle_y.append(2 * dynamic_size)526 # outline obst next to exit on top527 for i in arange(20 * dynamic_size, 30 * dynamic_size, dynamic_size):528 obstacle_x.append(i)529 obstacle_y.append(40 * dynamic_size)530 for i in arange(34 * dynamic_size, 41 * dynamic_size, dynamic_size):531 obstacle_x.append(i)532 obstacle_y.append(40 * dynamic_size)533 for i in arange(40 * dynamic_size, 61 * dynamic_size, dynamic_size):534 obstacle_y.append(i)535 obstacle_x.append(20 * dynamic_size)536 for i in arange(40 * dynamic_size, 61 * dynamic_size, dynamic_size):537 obstacle_y.append(i)538 obstacle_x.append(40 * dynamic_size)539 # outline exit/enter2 top540 for i in arange(55 * dynamic_size, 58 * dynamic_size, dynamic_size):541 obstacle_x.append(i)542 obstacle_y.append(53 * dynamic_size)543 for i in arange(55 * dynamic_size, 58 * dynamic_size, dynamic_size):544 obstacle_x.append(i)545 obstacle_y.append(58 * dynamic_size)546 for i in arange(53 * dynamic_size, 59 * dynamic_size, dynamic_size):547 obstacle_y.append(i)548 obstacle_x.append(58 * dynamic_size)549 # outline exit/enter 3 top left550 for i in arange(2 * dynamic_size, 5 * dynamic_size, dynamic_size):551 obstacle_x.append(i)552 obstacle_y.append(53 * dynamic_size)553 for i in arange(2 * dynamic_size, 5 * dynamic_size, dynamic_size):554 obstacle_x.append(i)555 obstacle_y.append(57 * dynamic_size)556 for i in arange(53 * dynamic_size, 58 * dynamic_size, dynamic_size):557 obstacle_y.append(i)558 obstacle_x.append(2 * dynamic_size)559 return obstacle_x, obstacle_y560def outline_obstacles_demo_building_6(obstacle_x, obstacle_y, dynamic_size):561 # outline of room562 for i in arange(0, 60 * dynamic_size, dynamic_size):563 obstacle_x.append(i)564 obstacle_y.append(0.0)565 for i in arange(0, 60 * dynamic_size, dynamic_size):566 obstacle_x.append(i)567 obstacle_y.append(30.0 * dynamic_size)568 for i in arange(0, 31 * dynamic_size, dynamic_size):569 obstacle_y.append(i)570 obstacle_x.append(60.0 * dynamic_size)571 for i in arange(0, 31 * dynamic_size, dynamic_size):572 obstacle_y.append(i)573 obstacle_x.append(0.0)574 # outline obstacle top left575 for i in arange(0, 9 * dynamic_size, dynamic_size):576 obstacle_x.append(i)577 obstacle_y.append(20 * dynamic_size)578 for i in arange(0, 12 * dynamic_size, dynamic_size):579 obstacle_x.append(i)580 obstacle_y.append(10 * dynamic_size)581 for i in arange(10 * dynamic_size, 21 * dynamic_size, dynamic_size):582 obstacle_y.append(i)583 obstacle_x.append(9 * dynamic_size)584 # outline obstacle left bottom585 for i in arange(15 * dynamic_size, 19 * dynamic_size, dynamic_size):586 obstacle_x.append(i)587 obstacle_y.append(10 * dynamic_size)588 for i in arange(21 * dynamic_size, 26 * dynamic_size, dynamic_size):589 obstacle_x.append(i)590 obstacle_y.append(10 * dynamic_size)591 for i in arange(0, 11 * dynamic_size, dynamic_size):592 obstacle_y.append(i)593 obstacle_x.append(15 * dynamic_size)594 for i in arange(0, 11 * dynamic_size, dynamic_size):595 obstacle_y.append(i)596 obstacle_x.append(26 * dynamic_size)597 # outline bottom598 for i in arange(0, 4 * dynamic_size, dynamic_size):599 obstacle_y.append(i)600 obstacle_x.append(30 * dynamic_size)601 for i in arange(0, 5 * dynamic_size, dynamic_size):602 obstacle_y.append(i)603 obstacle_x.append(34 * dynamic_size)604 for i in arange(30 * dynamic_size, 34 * dynamic_size, dynamic_size):605 obstacle_x.append(i)606 obstacle_y.append(0)607 for i in arange(30 * dynamic_size, 34 * dynamic_size, dynamic_size):608 obstacle_x.append(i)609 obstacle_y.append(4 * dynamic_size)610 # outline top left611 for i in arange(45 * dynamic_size, 61 * dynamic_size, dynamic_size):612 obstacle_y.append(26 * dynamic_size)613 obstacle_x.append(i)614 # outline completing top left615 for i in arange(16 * dynamic_size, 27 * dynamic_size, dynamic_size):616 obstacle_x.append(45 * dynamic_size)617 obstacle_y.append(i)618 for i in arange(40 * dynamic_size, 46 * dynamic_size, dynamic_size):619 obstacle_y.append(16 * dynamic_size)620 obstacle_x.append(i)621 # outline obst bottom right622 for i in arange(0, 11 * dynamic_size, dynamic_size):623 obstacle_x.append(40 * dynamic_size)624 obstacle_y.append(i)625 for i in arange(40 * dynamic_size, 45 * dynamic_size, dynamic_size):626 obstacle_x.append(i)627 obstacle_y.append(10 * dynamic_size)628 for i in arange(48 * dynamic_size, 61 * dynamic_size, dynamic_size):629 obstacle_x.append(i)630 obstacle_y.append(10 * dynamic_size)631 # outline obst next to exit on top632 for i in arange(20 * dynamic_size, 30 * dynamic_size, dynamic_size):633 obstacle_x.append(i)634 obstacle_y.append(16 * dynamic_size)635 for i in arange(34 * dynamic_size, 41 * dynamic_size, dynamic_size):636 obstacle_x.append(i)637 obstacle_y.append(16 * dynamic_size)638 for i in arange(16 * dynamic_size, 31 * dynamic_size, dynamic_size):639 obstacle_y.append(i)640 obstacle_x.append(20 * dynamic_size)641 for i in arange(16 * dynamic_size, 31 * dynamic_size, dynamic_size):642 obstacle_y.append(i)643 obstacle_x.append(40 * dynamic_size)644 # outline exit/enter 2 top645 for i in arange(54 * dynamic_size, 58 * dynamic_size, dynamic_size):646 obstacle_x.append(i)647 obstacle_y.append(21 * dynamic_size)648 for i in arange(54 * dynamic_size, 58 * dynamic_size, dynamic_size):649 obstacle_x.append(i)650 obstacle_y.append(17 * dynamic_size)651 for i in arange(17 * dynamic_size, 22 * dynamic_size, dynamic_size):652 obstacle_y.append(i)653 obstacle_x.append(58 * dynamic_size)654 # outline exit/enter 1 top left655 for i in arange(2 * dynamic_size, 6 * dynamic_size, dynamic_size):656 obstacle_x.append(i)657 obstacle_y.append(24 * dynamic_size)658 for i in arange(2 * dynamic_size, 6 * dynamic_size, dynamic_size):659 obstacle_x.append(i)660 obstacle_y.append(28 * dynamic_size)661 for i in arange(24 * dynamic_size, 28 * dynamic_size, dynamic_size):662 obstacle_y.append(i)663 obstacle_x.append(2 * dynamic_size)664 return obstacle_x, obstacle_y665def outline_obstacles_demo_building_7(obstacle_x, obstacle_y, dynamic_size):666 # outline of room667 for i in arange(0, 60 * dynamic_size, dynamic_size):668 obstacle_x.append(i)669 obstacle_y.append(0.0)670 for i in arange(0, 60 * dynamic_size, dynamic_size):671 obstacle_x.append(60.0 * dynamic_size)672 obstacle_y.append(i)673 for i in arange(0, 61 * dynamic_size, dynamic_size):674 obstacle_x.append(i)675 obstacle_y.append(60.0 * dynamic_size)676 for i in arange(0, 61 * dynamic_size, dynamic_size):677 obstacle_x.append(0.0)678 obstacle_y.append(i)679 # outline obstacle triangle left680 j = 0681 # outline obst triangle right682 for i in arange(40 * dynamic_size, 61 * dynamic_size, dynamic_size):683 obstacle_x.append((j+1) * dynamic_size)684 obstacle_y.append(i)685 j += (1 * dynamic_size)686 # outline exit/enter 1687 for i in arange(3 * dynamic_size, 6 * dynamic_size, dynamic_size):688 obstacle_y.append(i)689 obstacle_x.append(4 * dynamic_size)690 for i in arange(3 * dynamic_size, 6 * dynamic_size, dynamic_size):691 obstacle_y.append(i)692 obstacle_x.append(8 * dynamic_size)693 for i in arange(4 * dynamic_size, 9 * dynamic_size, dynamic_size):694 obstacle_x.append(i)695 obstacle_y.append(2 * dynamic_size)696 # outline obst around x=10697 for i in arange(11 * dynamic_size, 17 * dynamic_size, dynamic_size):698 obstacle_x.append(i)699 obstacle_y.append(22 * dynamic_size)700 for i in arange(0, 22 * dynamic_size, dynamic_size):701 obstacle_y.append(i)702 obstacle_x.append(11 * dynamic_size)703 for i in arange(0, 22 * dynamic_size, dynamic_size):704 obstacle_y.append(i)705 obstacle_x.append(16 * dynamic_size)706 # outline obst around x=30707 for i in arange(30 * dynamic_size, 34 * dynamic_size, dynamic_size):708 obstacle_x.append(i)709 obstacle_y.append(22 * dynamic_size)710 for i in arange(37 * dynamic_size, 41 * dynamic_size, dynamic_size):711 obstacle_x.append(i)712 obstacle_y.append(22 * dynamic_size)713 for i in arange(0, 22 * dynamic_size, dynamic_size):714 obstacle_y.append(i)715 obstacle_x.append(30 * dynamic_size)716 for i in arange(0, 22 * dynamic_size, dynamic_size):717 obstacle_y.append(i)718 obstacle_x.append(40 * dynamic_size)719 j = 61 * dynamic_size720 # outline obst triangle right721 for i in arange(50 * dynamic_size, j, dynamic_size):722 obstacle_x.append(i)723 obstacle_y.append(j - (1 * dynamic_size))724 j -= (1 * dynamic_size)725 # outline obst rectangle in the middle726 for i in arange(30 * dynamic_size, 40 * dynamic_size, dynamic_size):727 obstacle_x.append(20 * dynamic_size)728 obstacle_y.append(i)729 for i in arange(30 * dynamic_size, 40 * dynamic_size, dynamic_size):730 obstacle_x.append(25 * dynamic_size)731 obstacle_y.append(i)732 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):733 obstacle_x.append(i)734 obstacle_y.append(30 * dynamic_size)735 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):736 obstacle_x.append(i)737 obstacle_y.append(40 * dynamic_size)738 # outline obst around x = 0739 for i in arange(30 * dynamic_size, 33 * dynamic_size, dynamic_size):740 obstacle_x.append(10 * dynamic_size)741 obstacle_y.append(i)742 for i in arange(36 * dynamic_size, 40 * dynamic_size, dynamic_size):743 obstacle_x.append(10 * dynamic_size)744 obstacle_y.append(i)745 for i in arange(0, 11 * dynamic_size, dynamic_size):746 obstacle_x.append(i)747 obstacle_y.append(30 * dynamic_size)748 for i in arange(0, 11 * dynamic_size, dynamic_size):749 obstacle_x.append(i)750 obstacle_y.append(40 * dynamic_size)751 # outline obst752 for i in arange(30 * dynamic_size, 45 * dynamic_size, dynamic_size):753 obstacle_x.append(i)754 obstacle_y.append(40 * dynamic_size)755 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):756 obstacle_y.append(i)757 obstacle_x.append(30 * dynamic_size)758 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):759 obstacle_y.append(i)760 obstacle_x.append(45 * dynamic_size)761 # outline obst762 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):763 obstacle_x.append(i)764 obstacle_y.append(20 * dynamic_size)765 for i in arange(0, 20 * dynamic_size, dynamic_size):766 obstacle_y.append(i)767 obstacle_x.append(40 * dynamic_size)768 # outline exit/enter 2769 for i in arange(54 * dynamic_size, 57 * dynamic_size, dynamic_size):770 obstacle_x.append(i)771 obstacle_y.append(42 * dynamic_size)772 for i in arange(54 * dynamic_size, 57 * dynamic_size, dynamic_size):773 obstacle_x.append(i)774 obstacle_y.append(37 * dynamic_size)775 for i in arange(37 * dynamic_size, 43 * dynamic_size, dynamic_size):776 obstacle_y.append(i)777 obstacle_x.append(57 * dynamic_size)778 return obstacle_x, obstacle_y779def outline_obstacles_demo_building_8(obstacle_x, obstacle_y, dynamic_size):780 # outline of room781 for i in arange(20 * dynamic_size, 40 * dynamic_size, dynamic_size):782 obstacle_x.append(i)783 obstacle_y.append(0.0)784 for i in arange(21 * dynamic_size, 40 * dynamic_size, dynamic_size):785 obstacle_x.append(60.0 * dynamic_size)786 obstacle_y.append(i)787 for i in arange(21 * dynamic_size,40 * dynamic_size, dynamic_size):788 obstacle_x.append(i)789 obstacle_y.append(60.0 * dynamic_size)790 for i in arange(20 * dynamic_size,40 * dynamic_size, dynamic_size):791 obstacle_x.append(0.0)792 obstacle_y.append(i)793 j = 0794 for i in arange(40 * dynamic_size, 61 * dynamic_size, dynamic_size):795 obstacle_x.append(j + (1 * dynamic_size))796 obstacle_y.append(i)797 j += (1 * dynamic_size)798 j = 61 * dynamic_size799 for i in arange(40 * dynamic_size, j, dynamic_size):800 obstacle_x.append(i)801 obstacle_y.append(j - (1 * dynamic_size))802 j -= (1 * dynamic_size)803 j = 0804 for i in arange(40 * dynamic_size, 61 * dynamic_size, dynamic_size):805 obstacle_x.append(i)806 obstacle_y.append(j + (1 * dynamic_size))807 j += (1 * dynamic_size)808 j = 20 * dynamic_size809 for i in arange(0, j, dynamic_size):810 obstacle_x.append(i)811 obstacle_y.append(j - (1 * dynamic_size))812 j -= (1 * dynamic_size)813 # outline exit/enter 1814 for i in arange(2 * dynamic_size, 6 * dynamic_size, dynamic_size):815 obstacle_y.append(i)816 obstacle_x.append(20 * dynamic_size)817 for i in arange(2 * dynamic_size, 6 * dynamic_size, dynamic_size):818 obstacle_y.append(i)819 obstacle_x.append(25 * dynamic_size)820 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):821 obstacle_x.append(i)822 obstacle_y.append(2 * dynamic_size)823 # outline obst around x=10824 for i in arange(11 * dynamic_size, 17 * dynamic_size, dynamic_size):825 obstacle_x.append(i)826 obstacle_y.append(22 * dynamic_size)827 for i in arange(9 * dynamic_size, 22 * dynamic_size, dynamic_size):828 obstacle_y.append(i)829 obstacle_x.append(11 * dynamic_size)830 for i in arange(3 * dynamic_size, 22 * dynamic_size, dynamic_size):831 obstacle_y.append(i)832 obstacle_x.append(16 * dynamic_size)833 # outline obst around x=30834 for i in arange(30 * dynamic_size, 34 * dynamic_size, dynamic_size):835 obstacle_x.append(i)836 obstacle_y.append(22 * dynamic_size)837 for i in arange(37 * dynamic_size, 41 * dynamic_size, dynamic_size):838 obstacle_x.append(i)839 obstacle_y.append(22 * dynamic_size)840 for i in arange(0, 22 * dynamic_size, dynamic_size):841 obstacle_y.append(i)842 obstacle_x.append(30 * dynamic_size)843 for i in arange(0, 22 * dynamic_size, dynamic_size):844 obstacle_y.append(i)845 obstacle_x.append(40 * dynamic_size)846 # outline obst rectangle in the middle847 for i in arange(25 * dynamic_size, 40 * dynamic_size, dynamic_size):848 obstacle_x.append(20 * dynamic_size)849 obstacle_y.append(i)850 for i in arange(25 * dynamic_size, 40 * dynamic_size, dynamic_size):851 obstacle_x.append(25 * dynamic_size)852 obstacle_y.append(i)853 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):854 obstacle_x.append(i)855 obstacle_y.append(25 * dynamic_size)856 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):857 obstacle_x.append(i)858 obstacle_y.append(40 * dynamic_size)859 # outline obst around x = 0860 for i in arange(30 * dynamic_size, 33 * dynamic_size, dynamic_size):861 obstacle_x.append(10 * dynamic_size)862 obstacle_y.append(i)863 for i in arange(37 * dynamic_size, 40 * dynamic_size, dynamic_size):864 obstacle_x.append(10 * dynamic_size)865 obstacle_y.append(i)866 for i in arange(0, 11 * dynamic_size, dynamic_size):867 obstacle_x.append(i)868 obstacle_y.append(30 * dynamic_size)869 for i in arange(0, 11 * dynamic_size, dynamic_size):870 obstacle_x.append(i)871 obstacle_y.append(40 * dynamic_size)872 # outline obst873 for i in arange(30 * dynamic_size, 45 * dynamic_size, dynamic_size):874 obstacle_x.append(i)875 obstacle_y.append(40 * dynamic_size)876 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):877 obstacle_y.append(i)878 obstacle_x.append(30 * dynamic_size)879 for i in arange(40 * dynamic_size, 55 * dynamic_size, dynamic_size):880 obstacle_y.append(i)881 obstacle_x.append(45 * dynamic_size)882 # outline obst883 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):884 obstacle_x.append(i)885 obstacle_y.append(20 * dynamic_size)886 for i in arange(0, 20 * dynamic_size, dynamic_size):887 obstacle_y.append(i)888 obstacle_x.append(40 * dynamic_size)889 # outline exit/enter 2890 for i in arange(55 * dynamic_size, 59 * dynamic_size, dynamic_size):891 obstacle_x.append(i)892 obstacle_y.append(39 * dynamic_size)893 for i in arange(55 * dynamic_size, 59 * dynamic_size, dynamic_size):894 obstacle_x.append(i)895 obstacle_y.append(34 * dynamic_size)896 for i in arange(34 * dynamic_size, 39 * dynamic_size, dynamic_size):897 obstacle_y.append(i)898 obstacle_x.append(58 * dynamic_size)899 return obstacle_x, obstacle_y900def outline_obstacles_demo_building_9(obstacle_x, obstacle_y, dynamic_size):901 # outline of room902 for i in arange(30 * dynamic_size, 61 * dynamic_size, dynamic_size):903 obstacle_x.append(i)904 obstacle_y.append(0.0)905 for i in arange(0, 61 * dynamic_size, dynamic_size):906 obstacle_x.append(60.0 * dynamic_size)907 obstacle_y.append(i)908 for i in arange(30 * dynamic_size, 61 * dynamic_size, dynamic_size):909 obstacle_x.append(i)910 obstacle_y.append(60.0 * dynamic_size)911 j = 0.0912 for i in arange(30 * dynamic_size, 61 * dynamic_size, dynamic_size):913 obstacle_x.append(j+(1 * dynamic_size))914 obstacle_y.append(i)915 j = j + (1 * dynamic_size)916 j = 30 * dynamic_size917 for i in arange(0, j, dynamic_size):918 obstacle_x.append(i)919 obstacle_y.append(j- (1 * dynamic_size))920 j -= (1 * dynamic_size)921 # outline exit/enter 1922 for i in arange(9 * dynamic_size, 13 * dynamic_size, dynamic_size):923 obstacle_y.append(i)924 obstacle_x.append(22 * dynamic_size)925 for i in arange(9 * dynamic_size, 13 * dynamic_size, dynamic_size):926 obstacle_y.append(i)927 obstacle_x.append(26 * dynamic_size)928 for i in arange(22 * dynamic_size, 27 * dynamic_size, dynamic_size):929 obstacle_x.append(i)930 obstacle_y.append(8 * dynamic_size)931 # outline obst around x=10932 for i in arange(11 * dynamic_size, 17 * dynamic_size, dynamic_size):933 obstacle_x.append(i)934 obstacle_y.append(22 * dynamic_size)935 for i in arange(18 * dynamic_size, 22 * dynamic_size, dynamic_size):936 obstacle_y.append(i)937 obstacle_x.append(11 * dynamic_size)938 for i in arange(13 * dynamic_size, 22 * dynamic_size, dynamic_size):939 obstacle_y.append(i)940 obstacle_x.append(16 * dynamic_size)941 # outline obst around x=30942 for i in arange(30 * dynamic_size, 34 * dynamic_size, dynamic_size):943 obstacle_x.append(i)944 obstacle_y.append(22 * dynamic_size)945 for i in arange(37 * dynamic_size, 41 * dynamic_size, dynamic_size):946 obstacle_x.append(i)947 obstacle_y.append(22 * dynamic_size)948 for i in arange(0, 22 * dynamic_size, dynamic_size):949 obstacle_y.append(i)950 obstacle_x.append(30 * dynamic_size)951 for i in arange(0, 22 * dynamic_size, dynamic_size):952 obstacle_y.append(i)953 obstacle_x.append(40 * dynamic_size)954 # outline obst rectangle in the middle955 for i in arange(25 * dynamic_size, 40 * dynamic_size, dynamic_size):956 obstacle_x.append(20 * dynamic_size)957 obstacle_y.append(i)958 for i in arange(25 * dynamic_size, 40 * dynamic_size, dynamic_size):959 obstacle_x.append(25 * dynamic_size)960 obstacle_y.append(i)961 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):962 obstacle_x.append(i)963 obstacle_y.append(25 * dynamic_size)964 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):965 obstacle_x.append(i)966 obstacle_y.append(40 * dynamic_size)967 # outline obst968 for i in arange(30 * dynamic_size, 34 * dynamic_size, dynamic_size):969 obstacle_x.append(i)970 obstacle_y.append(40 * dynamic_size)971 for i in arange(37 * dynamic_size, 45 * dynamic_size, dynamic_size):972 obstacle_x.append(i)973 obstacle_y.append(40 * dynamic_size)974 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):975 obstacle_y.append(i)976 obstacle_x.append(30 * dynamic_size)977 for i in arange(40 * dynamic_size, 45 * dynamic_size, dynamic_size):978 obstacle_y.append(i)979 obstacle_x.append(45 * dynamic_size)980 for i in arange(49 * dynamic_size, 60 * dynamic_size, dynamic_size):981 obstacle_y.append(i)982 obstacle_x.append(45 * dynamic_size)983 # outline obst984 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):985 obstacle_x.append(i)986 obstacle_y.append(20 * dynamic_size)987 for i in arange(0, 20 * dynamic_size, dynamic_size):988 obstacle_y.append(i)989 obstacle_x.append(40 * dynamic_size)990 # outline exit/enter 2991 for i in arange(55 * dynamic_size, 59 * dynamic_size, dynamic_size):992 obstacle_x.append(i)993 obstacle_y.append(40 * dynamic_size)994 for i in arange(55 * dynamic_size, 59 * dynamic_size, dynamic_size):995 obstacle_x.append(i)996 obstacle_y.append(35 * dynamic_size)997 for i in arange(35 * dynamic_size, 41 * dynamic_size, dynamic_size):998 obstacle_y.append(i)999 obstacle_x.append(58 * dynamic_size)1000 return obstacle_x, obstacle_y1001def outline_obstacles_demo_building_10(obstacle_x, obstacle_y, dynamic_size):1002 # outline of room1003 for i in arange(0, 40 * dynamic_size, dynamic_size):1004 obstacle_x.append(i)1005 obstacle_y.append(0.0)1006 for i in arange(21 * dynamic_size, 61 * dynamic_size, dynamic_size):1007 obstacle_x.append(60.0 * dynamic_size)1008 obstacle_y.append(i)1009 for i in arange(21 * dynamic_size, 61 * dynamic_size, dynamic_size):1010 obstacle_x.append(i)1011 obstacle_y.append(60.0 * dynamic_size)1012 for i in arange(0, 41 * dynamic_size, dynamic_size):1013 obstacle_x.append(0.0)1014 obstacle_y.append(i)1015 j = 0 * dynamic_size1016 for i in arange(40 * dynamic_size, 61 * dynamic_size, dynamic_size):1017 obstacle_x.append(j+1)1018 obstacle_y.append(i)1019 j += 1 * dynamic_size1020 j = 0 * dynamic_size1021 for i in arange(40 * dynamic_size, 61 * dynamic_size, dynamic_size):1022 obstacle_x.append(i)1023 obstacle_y.append(j+1)1024 j += 1 * dynamic_size1025 # outline exit/enter 11026 for i in arange(3 * dynamic_size, 6 * dynamic_size, dynamic_size):1027 obstacle_y.append(i)1028 obstacle_x.append(20 * dynamic_size)1029 for i in arange(3 * dynamic_size, 6 * dynamic_size, dynamic_size):1030 obstacle_y.append(i)1031 obstacle_x.append(24 * dynamic_size)1032 for i in arange(20 * dynamic_size, 25 * dynamic_size, dynamic_size):1033 obstacle_x.append(i)1034 obstacle_y.append(2 * dynamic_size)1035 # outline obst around x=101036 for i in arange(0, 17 * dynamic_size, dynamic_size):1037 obstacle_x.append(i)1038 obstacle_y.append(22 * dynamic_size)1039 for i in arange(0, 17 * dynamic_size, dynamic_size):1040 obstacle_x.append(i)1041 obstacle_y.append(10 * dynamic_size)1042 for i in arange(10 * dynamic_size, 22 * dynamic_size, dynamic_size):1043 obstacle_y.append(i)1044 obstacle_x.append(16 * dynamic_size)1045 # outline obst around x=301046 for i in arange(30 * dynamic_size, 34 * dynamic_size, dynamic_size):1047 obstacle_x.append(i)1048 obstacle_y.append(22 * dynamic_size)1049 for i in arange(37 * dynamic_size, 41 * dynamic_size, dynamic_size):1050 obstacle_x.append(i)1051 obstacle_y.append(22 * dynamic_size)1052 for i in arange(0, 22 * dynamic_size, dynamic_size):1053 obstacle_y.append(i)1054 obstacle_x.append(30 * dynamic_size)1055 for i in arange(0, 22 * dynamic_size, dynamic_size):1056 obstacle_y.append(i)1057 obstacle_x.append(40 * dynamic_size)1058 # outline obst rectangle in the middle1059 for i in arange(25 * dynamic_size, 40 * dynamic_size, dynamic_size):1060 obstacle_x.append(20 * dynamic_size)1061 obstacle_y.append(i)1062 for i in arange(25 * dynamic_size, 40 * dynamic_size, dynamic_size):1063 obstacle_x.append(25 * dynamic_size)1064 obstacle_y.append(i)1065 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):1066 obstacle_x.append(i)1067 obstacle_y.append(25 * dynamic_size)1068 for i in arange(20 * dynamic_size, 26 * dynamic_size, dynamic_size):1069 obstacle_x.append(i)1070 obstacle_y.append(40 * dynamic_size)1071 # outline obst around x = 01072 for i in arange(30 * dynamic_size, 33 * dynamic_size, dynamic_size):1073 obstacle_x.append(10 * dynamic_size)1074 obstacle_y.append(i)1075 for i in arange(36 * dynamic_size, 40 * dynamic_size, dynamic_size):1076 obstacle_x.append(10 * dynamic_size)1077 obstacle_y.append(i)1078 for i in arange(0, 11 * dynamic_size, dynamic_size):1079 obstacle_x.append(i)1080 obstacle_y.append(30 * dynamic_size)1081 for i in arange(0, 11 * dynamic_size, dynamic_size):1082 obstacle_x.append(i)1083 obstacle_y.append(40 * dynamic_size)1084 # outline obst1085 for i in arange(30 * dynamic_size, 36 * dynamic_size, dynamic_size):1086 obstacle_x.append(i)1087 obstacle_y.append(40 * dynamic_size)1088 for i in arange(39 * dynamic_size, 45 * dynamic_size, dynamic_size):1089 obstacle_x.append(i)1090 obstacle_y.append(40 * dynamic_size)1091 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):1092 obstacle_y.append(i)1093 obstacle_x.append(30 * dynamic_size)1094 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):1095 obstacle_y.append(i)1096 obstacle_x.append(45 * dynamic_size)1097 # outline obst1098 for i in arange(40 * dynamic_size, 60 * dynamic_size, dynamic_size):1099 obstacle_x.append(i)1100 obstacle_y.append(20 * dynamic_size)1101 for i in arange(0, 20 * dynamic_size, dynamic_size):1102 obstacle_y.append(i)1103 obstacle_x.append(40 * dynamic_size)1104 # outline obst1105 for i in arange(55 * dynamic_size, 60 * dynamic_size, dynamic_size):1106 obstacle_x.append(i)1107 obstacle_y.append(25 * dynamic_size)1108 for i in arange(55 * dynamic_size, 60 * dynamic_size, dynamic_size):1109 obstacle_x.append(i)1110 obstacle_y.append(35 * dynamic_size)1111 for i in arange(25 * dynamic_size, 29 * dynamic_size, dynamic_size):1112 obstacle_y.append(i)1113 obstacle_x.append(55 * dynamic_size)1114 for i in arange(32 * dynamic_size, 36 * dynamic_size, dynamic_size):1115 obstacle_y.append(i)1116 obstacle_x.append(55 * dynamic_size)1117 # outline exit/enter 21118 for i in arange(55 * dynamic_size, 58 * dynamic_size, dynamic_size):1119 obstacle_y.append(i)1120 obstacle_x.append(50 * dynamic_size)1121 for i in arange(55 * dynamic_size, 58 * dynamic_size, dynamic_size):1122 obstacle_y.append(i)1123 obstacle_x.append(55 * dynamic_size)1124 for i in arange(50 * dynamic_size, 56 * dynamic_size, dynamic_size):1125 obstacle_x.append(i)1126 obstacle_y.append(58 * dynamic_size)1127 return obstacle_x, obstacle_y1128def outline_obstacles_floor_one_other(obstacle_x, obstacle_y, dynamic_size):1129 # Room outline1130 for i in arange(15):1131 obstacle_x.append(i)1132 obstacle_y.append(0.0)1133 for i in arange(21, 60):1134 obstacle_x.append(i)1135 obstacle_y.append(0.0)1136 for i in arange(45):1137 obstacle_x.append(60.0)1138 obstacle_y.append(i)1139 for i in arange(50, 60):1140 obstacle_x.append(60.0)1141 obstacle_y.append(i)1142 for i in arange(61):1143 obstacle_x.append(i)1144 obstacle_y.append(60.0)1145 for i in arange(61):1146 obstacle_x.append(0.0)1147 obstacle_y.append(i)1148 # left class1149 for i in arange(10, 30):1150 obstacle_x.append(10.0)1151 obstacle_y.append(i)1152 for i in arange(11):1153 obstacle_x.append(i)1154 obstacle_y.append(10.0)1155 for i in arange(11):1156 obstacle_x.append(i)1157 obstacle_y.append(30)1158 ##1159 # top left class1160 for i in arange(11):1161 obstacle_x.append(i)1162 obstacle_y.append(45.0)1163 for i in arange(45, 60):1164 obstacle_x.append(10.0)1165 obstacle_y.append(i)1166 # toilet near top left class1167 for i in arange(11, 16):1168 obstacle_x.append(i)1169 obstacle_y.append(50.0)1170 for i in arange(50, 60):1171 obstacle_x.append(15)1172 obstacle_y.append(i)1173 # elevator1174 for i in arange(25, 36):1175 obstacle_x.append(i)1176 obstacle_y.append(58.0)1177 for i in arange(3):1178 obstacle_x.append(25)1179 obstacle_y.append(60 - i)1180 for i in arange(3):1181 obstacle_x.append(35)1182 obstacle_y.append(60 - i)1183 # top right stairs1184 for i in arange(45, 51):1185 obstacle_x.append(i)1186 obstacle_y.append(58.0)1187 for i in arange(3):1188 obstacle_x.append(45)1189 obstacle_y.append(60 - i)1190 for i in arange(3):1191 obstacle_x.append(50)1192 obstacle_y.append(60 - i)1193 # top right class1194 for i in arange(51, 60):1195 obstacle_x.append(i)1196 obstacle_y.append(55.0)1197 for i in arange(6):1198 obstacle_x.append(51)1199 obstacle_y.append(60 - i)1200 for i in arange(6):1201 obstacle_x.append(60)1202 obstacle_y.append(60 - i)1203 # end of building in right corner1204 for i in arange(50, 60):1205 obstacle_x.append(i)1206 obstacle_y.append(10)1207 for i in arange(11):1208 obstacle_x.append(50)1209 obstacle_y.append(i)1210 # stairs + class right side of building1211 for i in arange(50, 60):1212 obstacle_x.append(i)1213 obstacle_y.append(20.0)1214 for i in arange(20, 40):1215 obstacle_x.append(50.0)1216 obstacle_y.append(i)1217 for i in arange(50, 60):1218 obstacle_x.append(i)1219 obstacle_y.append(40.0)1220 # obstacles near class1221 for i in arange(45, 50):1222 obstacle_x.append(i)1223 obstacle_y.append(20.0)1224 for i in arange(20, 30):1225 obstacle_x.append(45.0)1226 obstacle_y.append(i)1227 for i in arange(45, 50):1228 obstacle_x.append(i)1229 obstacle_y.append(30.0)1230 return obstacle_x, obstacle_y1231def outline_obstacles_floor_one(obstacle_x, obstacle_y, dynamic_size):1232 # Room outline1233 for i in arange(0, 60 * dynamic_size, dynamic_size):1234 obstacle_x.append(i)1235 obstacle_y.append(0.0)1236 for i in arange(0, 60 * dynamic_size, dynamic_size):1237 obstacle_x.append(60.0 * dynamic_size)1238 obstacle_y.append(i)1239 for i in arange(0, 35 * dynamic_size, dynamic_size):1240 obstacle_x.append(i)1241 obstacle_y.append(60.0 * dynamic_size)1242 for i in arange(45 * dynamic_size, 61 * dynamic_size, dynamic_size):1243 obstacle_x.append(i)1244 obstacle_y.append(60.0 * dynamic_size)1245 for i in arange(0, 10 * dynamic_size, dynamic_size):1246 obstacle_x.append(0)1247 obstacle_y.append(i)1248 for i in arange(18 * dynamic_size, 61 * dynamic_size, dynamic_size):1249 obstacle_x.append(0.0)1250 obstacle_y.append(i)1251 # bottom left class1252 for i in arange(0, 11 * dynamic_size, dynamic_size):1253 obstacle_x.append(i)1254 obstacle_y.append(8.0 * dynamic_size)1255 for i in arange(0, 7 * dynamic_size, dynamic_size):1256 obstacle_x.append(10.0 * dynamic_size)1257 obstacle_y.append(i)1258 # stairs bottom left1259 for i in arange(16 * dynamic_size, 21 * dynamic_size, dynamic_size):1260 obstacle_x.append(i)1261 obstacle_y.append(6 * dynamic_size)1262 for i in arange(6 * dynamic_size, 10 * dynamic_size, dynamic_size):1263 obstacle_x.append(16 * dynamic_size)1264 obstacle_y.append(i)1265 for i in arange(6 * dynamic_size, 10 * dynamic_size, dynamic_size):1266 obstacle_x.append(21 * dynamic_size)1267 obstacle_y.append(i)1268 for i in arange(25 * dynamic_size, 35 * dynamic_size, dynamic_size):1269 obstacle_x.append(i)1270 obstacle_y.append(3.0 * dynamic_size)1271 for i in arange(0, 4 * dynamic_size, dynamic_size):1272 obstacle_x.append(25 * dynamic_size)1273 obstacle_y.append(i)1274 for i in arange(0, 4 * dynamic_size, dynamic_size):1275 obstacle_x.append(34 * dynamic_size)1276 obstacle_y.append(i)1277 # bottom right class1278 for i in arange(50 * dynamic_size, 60 * dynamic_size, dynamic_size):1279 obstacle_x.append(i)1280 obstacle_y.append(10.0 * dynamic_size)1281 for i in arange(0, 7 * dynamic_size, dynamic_size):1282 obstacle_x.append(50.0 * dynamic_size)1283 obstacle_y.append(i)1284 for i in arange(0, 8 * dynamic_size, dynamic_size):1285 obstacle_x.append(47 * dynamic_size)1286 obstacle_y.append(i)1287 # mid left class1288 for i in arange(0, 10 * dynamic_size, dynamic_size):1289 obstacle_x.append(i)1290 obstacle_y.append(40.0 * dynamic_size)1291 for i in arange(0, 10 * dynamic_size, dynamic_size):1292 obstacle_x.append(i)1293 obstacle_y.append(55.0 * dynamic_size)1294 for i in arange(40 * dynamic_size, 52 * dynamic_size, dynamic_size):1295 obstacle_x.append(10 * dynamic_size)1296 obstacle_y.append(i)1297 for i in arange(0, 10 * dynamic_size, dynamic_size):1298 obstacle_x.append(i)1299 obstacle_y.append(48 * dynamic_size)1300 # # top left stairs1301 # middle stairs1302 for i in arange(25 * dynamic_size, 35 * dynamic_size, dynamic_size):1303 obstacle_x.append(10.0 * dynamic_size)1304 obstacle_y.append(i)1305 for i in arange(25 * dynamic_size, 35 * dynamic_size, dynamic_size):1306 obstacle_x.append(16.0 * dynamic_size)1307 obstacle_y.append(i)1308 for i in arange(10 * dynamic_size, 16 * dynamic_size, dynamic_size):1309 obstacle_x.append(i)1310 obstacle_y.append(25.0 * dynamic_size)1311 # right class1312 for i in arange(25 * dynamic_size, 45 * dynamic_size, dynamic_size):1313 obstacle_x.append(50 * dynamic_size)1314 obstacle_y.append(i)1315 for i in arange(0, 11 * dynamic_size, dynamic_size):1316 obstacle_x.append((60 - i) * dynamic_size)1317 obstacle_y.append(25.0 * dynamic_size)1318 for i in arange(0, 11 * dynamic_size, dynamic_size):1319 obstacle_x.append((60 - i) * dynamic_size)1320 obstacle_y.append(45.0 * dynamic_size)1321 return obstacle_x, obstacle_y1322def outline_obstacles_floor_two_and_three(obstacle_x, obstacle_y, dynamic_size):1323 # Room outline1324 for i in arange(0, 60 * dynamic_size, dynamic_size):1325 obstacle_x.append(i)1326 obstacle_y.append(0.0)1327 for i in arange(0, 60 * dynamic_size, dynamic_size):1328 obstacle_x.append(60.0 * dynamic_size)1329 obstacle_y.append(i)1330 for i in arange(0, 61 * dynamic_size, dynamic_size):1331 obstacle_x.append(i)1332 obstacle_y.append(60.0 * dynamic_size)1333 for i in arange(0, 61 * dynamic_size, dynamic_size):1334 obstacle_x.append(0.0)1335 obstacle_y.append(i)1336 # two classes bottom left1337 for i in arange(0, 10 * dynamic_size, dynamic_size):1338 obstacle_x.append(i)1339 obstacle_y.append(10.0 * dynamic_size)1340 for i in arange(0, 11 * dynamic_size, dynamic_size):1341 obstacle_x.append(10.0 * dynamic_size)1342 obstacle_y.append(i)1343 for i in arange(0, 11 * dynamic_size, dynamic_size):1344 obstacle_x.append(15.0 * dynamic_size)1345 obstacle_y.append(i)1346 for i in arange(11 * dynamic_size, 15 * dynamic_size, dynamic_size):1347 obstacle_x.append(i)1348 obstacle_y.append(10.0 * dynamic_size)1349 # stairs bottom left1350 for i in arange(16 * dynamic_size, 21 * dynamic_size, dynamic_size):1351 obstacle_x.append(i)1352 obstacle_y.append(6 * dynamic_size)1353 for i in arange(6 * dynamic_size, 10 * dynamic_size, dynamic_size):1354 obstacle_x.append(16 * dynamic_size)1355 obstacle_y.append(i)1356 for i in arange(6 * dynamic_size, 10 * dynamic_size, dynamic_size):1357 obstacle_x.append(21 * dynamic_size)1358 obstacle_y.append(i)1359 # bottom elevator1360 for i in arange(28 * dynamic_size, 34 * dynamic_size, dynamic_size):1361 obstacle_x.append(i)1362 obstacle_y.append(3 * dynamic_size)1363 for i in arange(4 * dynamic_size, dynamic_size):1364 obstacle_x.append(28 * dynamic_size)1365 obstacle_y.append(i)1366 for i in arange(0, 4 * dynamic_size, dynamic_size):1367 obstacle_x.append(34 * dynamic_size)1368 obstacle_y.append(i)1369 # toilets1370 for i in arange(42 * dynamic_size, 53 * dynamic_size, dynamic_size):1371 obstacle_x.append(i)1372 obstacle_y.append(8.0 * dynamic_size)1373 for i in arange(0, 8 * dynamic_size, dynamic_size):1374 obstacle_x.append(42 * dynamic_size)1375 obstacle_y.append(i)1376 for i in arange(0, 9 * dynamic_size, dynamic_size):1377 obstacle_x.append(53 * dynamic_size)1378 obstacle_y.append(i)1379 # faculty offices1380 for i in arange(56 * dynamic_size, 60 * dynamic_size, dynamic_size):1381 obstacle_x.append(i)1382 obstacle_y.append(8.0 * dynamic_size)1383 for i in arange(0, 8 * dynamic_size, dynamic_size):1384 obstacle_x.append(56.0 * dynamic_size)1385 obstacle_y.append(i)1386 # big class number 11387 for i in arange(45 * dynamic_size, 60 * dynamic_size, dynamic_size):1388 obstacle_x.append(i)1389 obstacle_y.append(20.0 * dynamic_size)1390 for i in arange(45 * dynamic_size, 60 * dynamic_size, dynamic_size):1391 obstacle_x.append(i)1392 obstacle_y.append(35.0 * dynamic_size)1393 for i in arange(20 * dynamic_size, 33 * dynamic_size, dynamic_size):1394 obstacle_x.append(45.0 * dynamic_size)1395 obstacle_y.append(i)1396 # big class number 21397 for i in arange(45 * dynamic_size, 60 * dynamic_size, dynamic_size):1398 obstacle_x.append(i)1399 obstacle_y.append(37.0 * dynamic_size)1400 for i in arange(45 * dynamic_size, 60 * dynamic_size, dynamic_size):1401 obstacle_x.append(i)1402 obstacle_y.append(52.0 * dynamic_size)1403 for i in arange(37 * dynamic_size, 45 * dynamic_size, dynamic_size):1404 obstacle_x.append(45.0 * dynamic_size)1405 obstacle_y.append(i)1406 # benches1407 for i in arange(25 * dynamic_size, 35 * dynamic_size, dynamic_size):1408 obstacle_x.append(i)1409 obstacle_y.append(57 * dynamic_size)1410 for i in arange(0, 4 * dynamic_size, dynamic_size):1411 obstacle_x.append(25 * dynamic_size)1412 obstacle_y.append((60 - i) * dynamic_size)1413 for i in arange(0, 4 * dynamic_size, dynamic_size):1414 obstacle_x.append(35 * dynamic_size)1415 obstacle_y.append((60 - i) * dynamic_size)1416 # balcony1417 for i in arange(55 * dynamic_size, 60 * dynamic_size, dynamic_size):1418 obstacle_x.append(5.0 * dynamic_size)1419 obstacle_y.append(i)1420 for i in arange(0, 5 * dynamic_size, dynamic_size):1421 obstacle_x.append(i)1422 obstacle_y.append(55.0 * dynamic_size)1423 for i in arange(0, 5 * dynamic_size, dynamic_size):1424 obstacle_x.append(i)1425 obstacle_y.append(60.0 * dynamic_size)1426 # middle stairs1427 for i in arange(25 * dynamic_size, 35 * dynamic_size, dynamic_size):1428 obstacle_x.append(10.0 * dynamic_size)1429 obstacle_y.append(i)1430 for i in arange(25 * dynamic_size, 35 * dynamic_size, dynamic_size):1431 obstacle_x.append(16.0 * dynamic_size)1432 obstacle_y.append(i)1433 for i in arange(10 * dynamic_size, 16 * dynamic_size, dynamic_size):1434 obstacle_x.append(i)1435 obstacle_y.append(25.0 * dynamic_size)1436 return obstacle_x, obstacle_y1437def outline_obstacles_floor_four(obstacle_x, obstacle_y, dynamic_size):1438 # outline of room1439 for i in arange(0, 60 * dynamic_size, dynamic_size):1440 obstacle_x.append(i)1441 obstacle_y.append(0.0)1442 for i in arange(0, 60 * dynamic_size, dynamic_size):1443 obstacle_x.append(60.0 * dynamic_size)1444 obstacle_y.append(i)1445 for i in arange(0, 61 * dynamic_size, dynamic_size):1446 obstacle_x.append(i)1447 obstacle_y.append(60.0 * dynamic_size)1448 for i in arange(0, 61 * dynamic_size, dynamic_size):1449 obstacle_x.append(0.0)1450 obstacle_y.append(i)1451 # stairs bottom left1452 for i in arange(16 * dynamic_size, 21 * dynamic_size, dynamic_size):1453 obstacle_x.append(i)1454 obstacle_y.append(3 * dynamic_size)1455 for i in arange(3 * dynamic_size, 9 * dynamic_size, dynamic_size):1456 obstacle_x.append(16 * dynamic_size)1457 obstacle_y.append(i)1458 for i in arange(3 * dynamic_size, 9 * dynamic_size, dynamic_size):1459 obstacle_x.append(21 * dynamic_size)1460 obstacle_y.append(i)1461 # Lecture hall1462 for i in arange(35 * dynamic_size, 60 * dynamic_size, dynamic_size):1463 obstacle_x.append(i)1464 obstacle_y.append(20.0 * dynamic_size)1465 for i in arange(35 * dynamic_size, 60 * dynamic_size, dynamic_size):1466 obstacle_x.append(i)1467 obstacle_y.append(45.0 * dynamic_size)1468 for i in arange(20 * dynamic_size, 25 * dynamic_size, dynamic_size):1469 obstacle_x.append(35 * dynamic_size)1470 obstacle_y.append(i)1471 for i in arange(29 * dynamic_size, 42 * dynamic_size, dynamic_size):1472 obstacle_x.append(35 * dynamic_size)1473 obstacle_y.append(i)1474 # small room under hall1475 for i in arange(57 * dynamic_size, 60 * dynamic_size, dynamic_size):1476 obstacle_x.append(i)1477 obstacle_y.append(15.0 * dynamic_size)1478 for i in arange(57 * dynamic_size, 60 * dynamic_size, dynamic_size):1479 obstacle_x.append(i)1480 obstacle_y.append(10.0 * dynamic_size)1481 for i in arange(10 * dynamic_size, 15 * dynamic_size, dynamic_size):1482 obstacle_x.append(57.0 * dynamic_size)1483 obstacle_y.append(i)1484 # toilets1485 for i in arange(46 * dynamic_size, 56 * dynamic_size, dynamic_size):1486 obstacle_x.append(i)1487 obstacle_y.append(7.0 * dynamic_size)1488 for i in arange(0, 8 * dynamic_size, dynamic_size):1489 obstacle_x.append(46.0 * dynamic_size)1490 obstacle_y.append(i)1491 for i in arange(0, 8 * dynamic_size, dynamic_size):1492 obstacle_x.append(56.0 * dynamic_size)1493 obstacle_y.append(i)1494 # elevator1495 for i in arange(26 * dynamic_size, 38 * dynamic_size, dynamic_size):1496 obstacle_x.append(i)1497 obstacle_y.append(3.0 * dynamic_size)1498 for i in arange(0, 4 * dynamic_size, dynamic_size):1499 obstacle_x.append(26 * dynamic_size)1500 obstacle_y.append(i)1501 for i in arange(0, 4 * dynamic_size, dynamic_size):1502 obstacle_x.append(38 * dynamic_size)1503 obstacle_y.append(i)1504 # faculty offices1505 for i in arange(0, 6 * dynamic_size, dynamic_size):1506 obstacle_x.append(i)1507 obstacle_y.append(20.0 * dynamic_size)1508 for i in arange(0, 21 * dynamic_size, dynamic_size):1509 obstacle_x.append(6.0 * dynamic_size)1510 obstacle_y.append(i)1511 # more offices1512 for i in arange(0, 6 * dynamic_size, dynamic_size):1513 obstacle_x.append(i)1514 obstacle_y.append(50.0 * dynamic_size)1515 for i in arange(0, 9 * dynamic_size, dynamic_size):1516 obstacle_x.append(i)1517 obstacle_y.append(30.0 * dynamic_size)1518 for i in arange(30 * dynamic_size, 51 * dynamic_size, dynamic_size):1519 obstacle_x.append(9.0 * dynamic_size)1520 obstacle_y.append(i)1521 # stairs near offices1522 # middle stairs1523 for i in arange(25 * dynamic_size, 35 * dynamic_size, dynamic_size):1524 obstacle_x.append(10.0 * dynamic_size)1525 obstacle_y.append(i)1526 for i in arange(25 * dynamic_size, 35 * dynamic_size, dynamic_size):1527 obstacle_x.append(16.0 * dynamic_size)1528 obstacle_y.append(i)1529 for i in arange(10 * dynamic_size, 16 * dynamic_size, dynamic_size):1530 obstacle_x.append(i)1531 obstacle_y.append(25.0 * dynamic_size)1532 # benches - top1533 for i in arange(20 * dynamic_size, 33 * dynamic_size, dynamic_size):1534 obstacle_x.append(i)1535 obstacle_y.append(57.0 * dynamic_size)1536 for i in arange(0, 4 * dynamic_size, dynamic_size):1537 obstacle_x.append(20 * dynamic_size)1538 obstacle_y.append((60 - i) * dynamic_size)1539 for i in arange(4 * dynamic_size, dynamic_size):1540 obstacle_x.append(33 * dynamic_size)1541 obstacle_y.append((60 - i) * dynamic_size)...
TestDynamicValue.py
Source:TestDynamicValue.py
1"""2Use lldb Python API to test dynamic values in C++3"""4import os, time5import re6import unittest27import lldb, lldbutil8from lldbtest import *9class DynamicValueTestCase(TestBase):10 mydir = os.path.join("lang", "cpp", "dynamic-value")11 @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")12 @python_api_test13 @dsym_test14 def test_get_dynamic_vals_with_dsym(self):15 """Test fetching C++ dynamic values from pointers & references."""16 self.buildDsym()17 self.do_get_dynamic_vals()18 @python_api_test19 @dwarf_test20 def test_get_dynamic_vals_with_dwarf(self):21 """Test fetching C++ dynamic values from pointers & references."""22 self.buildDwarf()23 self.do_get_dynamic_vals()24 def setUp(self):25 # Call super's setUp(). 26 TestBase.setUp(self)27 # Find the line number to break for main.c. 28 self.do_something_line = line_number('pass-to-base.cpp', '// Break here in doSomething.')29 self.main_first_call_line = line_number('pass-to-base.cpp',30 '// Break here and get real addresses of myB and otherB.')31 self.main_second_call_line = line_number('pass-to-base.cpp',32 '// Break here and get real address of reallyA.')33 def examine_value_object_of_this_ptr (self, this_static, this_dynamic, dynamic_location):34 # Get "this" as its static value35 36 self.assertTrue (this_static)37 this_static_loc = int (this_static.GetValue(), 16)38 39 # Get "this" as its dynamic value40 41 self.assertTrue (this_dynamic)42 this_dynamic_typename = this_dynamic.GetTypeName()43 self.assertTrue (this_dynamic_typename.find('B') != -1)44 this_dynamic_loc = int (this_dynamic.GetValue(), 16)45 46 # Make sure we got the right address for "this"47 48 self.assertTrue (this_dynamic_loc == dynamic_location)49 # And that the static address is greater than the dynamic one50 self.assertTrue (this_static_loc > this_dynamic_loc)51 52 # Now read m_b_value which is only in the dynamic value:53 use_dynamic = lldb.eDynamicCanRunTarget54 no_dynamic = lldb.eNoDynamicValues55 this_dynamic_m_b_value = this_dynamic.GetChildMemberWithName('m_b_value', use_dynamic)56 self.assertTrue (this_dynamic_m_b_value)57 58 m_b_value = int (this_dynamic_m_b_value.GetValue(), 0)59 self.assertTrue (m_b_value == 10)60 61 # Make sure it is not in the static version62 this_static_m_b_value = this_static.GetChildMemberWithName('m_b_value', no_dynamic)63 self.assertFalse (this_static_m_b_value)64 # Okay, now let's make sure that we can get the dynamic type of a child element:65 contained_auto_ptr = this_dynamic.GetChildMemberWithName ('m_client_A', use_dynamic)66 self.assertTrue (contained_auto_ptr)67 contained_b = contained_auto_ptr.GetChildMemberWithName ('_M_ptr', use_dynamic)68 self.assertTrue (contained_b)69 70 contained_b_static = contained_auto_ptr.GetChildMemberWithName ('_M_ptr', no_dynamic)71 self.assertTrue (contained_b_static)72 73 contained_b_addr = int (contained_b.GetValue(), 16)74 contained_b_static_addr = int (contained_b_static.GetValue(), 16)75 76 self.assertTrue (contained_b_addr < contained_b_static_addr)77 78 def do_get_dynamic_vals(self):79 """Get argument vals for the call stack when stopped on a breakpoint."""80 exe = os.path.join(os.getcwd(), "a.out")81 # Create a target from the debugger.82 target = self.dbg.CreateTarget (exe)83 self.assertTrue(target, VALID_TARGET)84 # Set up our breakpoints:85 do_something_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.do_something_line)86 self.assertTrue(do_something_bpt,87 VALID_BREAKPOINT)88 first_call_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.main_first_call_line)89 self.assertTrue(first_call_bpt,90 VALID_BREAKPOINT)91 second_call_bpt = target.BreakpointCreateByLocation('pass-to-base.cpp', self.main_second_call_line)92 self.assertTrue(second_call_bpt,93 VALID_BREAKPOINT)94 # Now launch the process, and do not stop at the entry point.95 process = target.LaunchSimple (None, None, os.getcwd())96 self.assertTrue(process.GetState() == lldb.eStateStopped,97 PROCESS_STOPPED)98 threads = lldbutil.get_threads_stopped_at_breakpoint (process, first_call_bpt)99 self.assertTrue (len(threads) == 1)100 thread = threads[0]101 frame = thread.GetFrameAtIndex(0)102 # Now find the dynamic addresses of myB and otherB so we can compare them103 # with the dynamic values we get in doSomething:104 use_dynamic = lldb.eDynamicCanRunTarget105 no_dynamic = lldb.eNoDynamicValues106 myB = frame.FindVariable ('myB', no_dynamic);107 self.assertTrue (myB)108 myB_loc = int (myB.GetLocation(), 16)109 otherB = frame.FindVariable('otherB', no_dynamic)110 self.assertTrue (otherB)111 otherB_loc = int (otherB.GetLocation(), 16)112 # Okay now run to doSomething:113 threads = lldbutil.continue_to_breakpoint (process, do_something_bpt)114 self.assertTrue (len(threads) == 1)115 thread = threads[0]116 frame = thread.GetFrameAtIndex(0)117 # Get "this" using FindVariable:118 this_static = frame.FindVariable ('this', no_dynamic)119 this_dynamic = frame.FindVariable ('this', use_dynamic)120 self.examine_value_object_of_this_ptr (this_static, this_dynamic, myB_loc)121 122 # Now make sure that the "GetDynamicValue" works:123 # This doesn't work currently because we can't get dynamic values from ConstResult objects.124 fetched_dynamic_value = this_static.GetDynamicValue(use_dynamic)125 self.examine_value_object_of_this_ptr (this_static, fetched_dynamic_value, myB_loc)126 # And conversely that the GetDynamicValue() interface also works:127 fetched_static_value = this_dynamic.GetStaticValue()128 self.examine_value_object_of_this_ptr (fetched_static_value, this_dynamic, myB_loc)129 # Get "this" using FindValue, make sure that works too:130 this_static = frame.FindValue ('this', lldb.eValueTypeVariableArgument, no_dynamic)131 this_dynamic = frame.FindValue ('this', lldb.eValueTypeVariableArgument, use_dynamic)132 self.examine_value_object_of_this_ptr (this_static, this_dynamic, myB_loc)133 # Get "this" using the EvaluateExpression:134 this_static = frame.EvaluateExpression ('this', False)135 this_dynamic = frame.EvaluateExpression ('this', True)136 self.examine_value_object_of_this_ptr (this_static, this_dynamic, myB_loc)137 138 # The "frame var" code uses another path to get into children, so let's139 # make sure that works as well:140 self.expect('frame var -d run-target anotherA.m_client_A._M_ptr', 'frame var finds its way into a child member',141 patterns = ['\(B \*\)'])142 # Now make sure we also get it right for a reference as well:143 anotherA_static = frame.FindVariable ('anotherA', False)144 self.assertTrue (anotherA_static)145 anotherA_static_addr = int (anotherA_static.GetValue(), 16)146 anotherA_dynamic = frame.FindVariable ('anotherA', True)147 self.assertTrue (anotherA_dynamic)148 anotherA_dynamic_addr = int (anotherA_dynamic.GetValue(), 16)149 anotherA_dynamic_typename = anotherA_dynamic.GetTypeName()150 self.assertTrue (anotherA_dynamic_typename.find('B') != -1)151 self.assertTrue(anotherA_dynamic_addr < anotherA_static_addr)152 anotherA_m_b_value_dynamic = anotherA_dynamic.GetChildMemberWithName('m_b_value', True)153 self.assertTrue (anotherA_m_b_value_dynamic)154 anotherA_m_b_val = int (anotherA_m_b_value_dynamic.GetValue(), 10)155 self.assertTrue (anotherA_m_b_val == 300)156 anotherA_m_b_value_static = anotherA_static.GetChildMemberWithName('m_b_value', True)157 self.assertFalse (anotherA_m_b_value_static)158 # Okay, now continue again, and when we hit the second breakpoint in main159 threads = lldbutil.continue_to_breakpoint (process, second_call_bpt)160 self.assertTrue (len(threads) == 1)161 thread = threads[0]162 frame = thread.GetFrameAtIndex(0)163 reallyA_value = frame.FindVariable ('reallyA', False)164 self.assertTrue(reallyA_value)165 reallyA_loc = int (reallyA_value.GetLocation(), 16)166 167 # Finally continue to doSomething again, and make sure we get the right value for anotherA,168 # which this time around is just an "A".169 threads = lldbutil.continue_to_breakpoint (process, do_something_bpt)170 self.assertTrue(len(threads) == 1)171 thread = threads[0]172 frame = thread.GetFrameAtIndex(0)173 anotherA_value = frame.FindVariable ('anotherA', True)174 self.assertTrue(anotherA_value)175 anotherA_loc = int (anotherA_value.GetValue(), 16)176 self.assertTrue (anotherA_loc == reallyA_loc)177 self.assertTrue (anotherA_value.GetTypeName().find ('B') == -1)178if __name__ == '__main__':179 import atexit180 lldb.SBDebugger.Initialize()181 atexit.register(lambda: lldb.SBDebugger.Terminate())...
merge_dynamic_partition_metadata.py
Source:merge_dynamic_partition_metadata.py
1#!/usr/bin/env python2# Copyright (c) 2019, The Linux Foundation. All rights reserved.3#4# Redistribution and use in source and binary forms, with or without5# modification, are permitted provided that the following conditions are6# met:7# * Redistributions of source code must retain the above copyright8# notice, this list of conditions and the following disclaimer.9# * Redistributions in binary form must reproduce the above10# copyright notice, this list of conditions and the following11# disclaimer in the documentation and/or other materials provided12# with the distribution.13# * Neither the name of The Linux Foundation nor the names of its14# contributors may be used to endorse or promote products derived15# from this software without specific prior written permission.16#17# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED18# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF19# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT20# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS21# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR22# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF23# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR24# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,25# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE26# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE US27"""28This script merges the contents of the dynamic_partition_metadata.txt29files from the qssi directory and the target directory, placing the merged30result in the merged dynamic partition metadata file.31Usage: merge_dynamic_partition_metadata.py [args]32 --qssi-dpm-file : File containing QSSI dynamic partition33 information generated during QSSI lunch make.34 --target-dpm-file : File containing QSSI dynamic partition35 information generated during target lunch make.36 --merged-dpm-file : This file will contain collated metadata37 information of dynamic partitions from qssi and target.38"""39from __future__ import print_function40import common41import sys42import os43import logging44logger = logging.getLogger(__name__)45OPTIONS = common.OPTIONS46OPTIONS.verbose = True47OPTIONS.qssi_dynamic_partition_metadata_file = None48OPTIONS.target_dynamic_partition_metadata_file = None49OPTIONS.merged_dynamic_partition_metadata_file = None50def merge_dynamic_partition_metadata(51 qssi_dynamic_partition_metadata_file,52 target_dynamic_partition_metadata_file,53 merged_dynamic_partition_metadata_file):54 """55 This function merges the contents of the dynamic_partition_metadata.txt56 files from the qssi directory and the target directory, placing the merged57 result in the merged dynamic partition metadata file.58 Args:59 qssi_dynamic_partition_metadata_file: File containing QSSI dynamic partition60 information generated during QSSI lunch make.61 target_dynamic_partition_metadata_file: File containing QSSI dynamic partition62 information generated during target lunch make.63 merged_dynamic_partition_metadata_file : This file will contain collated metadata64 information of dynamic partitions from qssi and target.65 """66 def read_helper(dynamic_metadata_file):67 with open(dynamic_metadata_file) as f:68 return list(f.read().splitlines())69 qssi_metadata_dict = common.LoadDictionaryFromLines(70 read_helper(qssi_dynamic_partition_metadata_file))71 merged_metadata_dict = common.LoadDictionaryFromLines(72 read_helper(target_dynamic_partition_metadata_file))73 if merged_metadata_dict['use_dynamic_partitions'] == 'true':74 merged_metadata_dict['dynamic_partition_list'] = '%s %s' % (75 qssi_metadata_dict.get('dynamic_partition_list', ''),76 merged_metadata_dict.get('dynamic_partition_list', ''))77 else:78 logger.warning("Dynamic patiitions is not enabled, Exiting!!")79 sys.exit(1)80 for partition_group in merged_metadata_dict['super_partition_groups'].split(' '):81 key = 'super_%s_partition_list' % partition_group82 merged_metadata_dict[key] = '%s %s' % (83 qssi_metadata_dict.get(key, ''),84 merged_metadata_dict.get(key, ''))85 sorted_keys = sorted(merged_metadata_dict.keys())86 if os.path.exists(merged_dynamic_partition_metadata_file):87 os.remove(merged_dynamic_partition_metadata_file)88 with open(merged_dynamic_partition_metadata_file, 'w') as merged_dpm_file:89 for key in sorted_keys:90 merged_dpm_file.write('{}={}\n'.format(key, merged_metadata_dict[key]))91 logger.info("Generated merged dynamic partition metdata file : %s",merged_dynamic_partition_metadata_file)92def main():93 common.InitLogging()94 def option_handler(o, a):95 if o == '--qssi-dpm-file':96 OPTIONS.qssi_dynamic_partition_metadata_file = a97 elif o == '--target-dpm-file':98 OPTIONS.target_dynamic_partition_metadata_file = a99 elif o == '--merged-dpm-file':100 OPTIONS.merged_dynamic_partition_metadata_file = a101 else:102 return False103 return True104 args = common.ParseOptions(105 sys.argv[1:], __doc__,106 extra_long_opts=[107 'qssi-dpm-file=',108 'target-dpm-file=',109 'merged-dpm-file=',110 ],111 extra_option_handler=option_handler)112 if (len(args) != 0 or113 OPTIONS.qssi_dynamic_partition_metadata_file is None or114 OPTIONS.target_dynamic_partition_metadata_file is None or115 OPTIONS.merged_dynamic_partition_metadata_file is None):116 common.Usage(__doc__)117 sys.exit(1)118 merge_dynamic_partition_metadata(119 OPTIONS.qssi_dynamic_partition_metadata_file,120 OPTIONS.target_dynamic_partition_metadata_file,121 OPTIONS.merged_dynamic_partition_metadata_file)122if __name__ == '__main__':...
har_dyna_learn_model.py
Source:har_dyna_learn_model.py
1import os2os.environ['TF_CPP_MIN_LOG_LEVEL']='2'3import numpy as np4import random5from numpy.random import seed6from keras.optimizers import Adam7from keras.models import Sequential8from keras.layers import Conv1D, MaxPooling1D, Dense, Flatten, Dropout9from keras.callbacks import ModelCheckpoint10from keras.utils import plot_model11import keras.backend as K12import process_data13'''14See paper: Sensors 2018, 18(4), 1055; https://doi.org/10.3390/s1804105515"Divide and Conquer-Based 1D CNN Human Activity Recognition Using Test Data Sharpening"16by Heeryon Cho & Sang Min Yoon17This code learns dynamic HAR model given in Figure 10.18(Sensors 2018, 18(4), 1055, page 13 of 24)19'''20# Load all train and test data (* dynamic and static data are mixed.)21X_train_all = process_data.load_x("train") # at this stage, the data includes both dynamic and static HAR data22y_train_all = process_data.load_y("train")23X_test_all = process_data.load_x("test")24y_test_all = process_data.load_y("test")25# --------------------------------------26# Only dynamic HAR data are selected27# --------------------------------------28# Select dynamic HAR train data29dynamic_1 = np.where(y_train_all == 1)[0]30dynamic_2 = np.where(y_train_all == 2)[0]31dynamic_3 = np.where(y_train_all == 3)[0]32dynamic = np.concatenate([dynamic_1, dynamic_2, dynamic_3])33dynamic_list = dynamic.tolist()34# Shuffle dynamic data index35r = random.random()36random.shuffle(dynamic_list, lambda: r)37dynamic = np.array(dynamic_list)38X_train = X_train_all[dynamic]39y_train = y_train_all[dynamic]40# Convert (1, 2, 3) labels to (0, 1, 2)41y_train = y_train - 142print "\n+++ DATA STATISTICS +++\n"43print "train_dynamic shape: ", X_train.shape44# Select dynamic HAR test data45dynamic_1 = np.where(y_test_all == 1)[0]46dynamic_2 = np.where(y_test_all == 2)[0]47dynamic_3 = np.where(y_test_all == 3)[0]48dynamic = np.concatenate([dynamic_1, dynamic_2, dynamic_3])49X_test = X_test_all[dynamic]50y_test = y_test_all[dynamic]51# Convert (1, 2, 3) labels to (0, 1, 2)52y_test = y_test - 153print "test_dynamic shape: ", X_test.shape54n_classes = 355# Convert to one hot encoding vector56y_train_dynamic_oh = np.eye(n_classes)[y_train]57# Fit 1d CNN for dynamic HAR58seed(2017)59model = Sequential()60model.add(Conv1D(100, 3, input_shape=(561, 1), activation='relu'))61model.add(MaxPooling1D(3))62model.add(Flatten())63model.add(Dense(3, activation='softmax'))64model.add(Dropout(0.5))65adam = Adam(lr=0.0004, beta_1=0.9, beta_2=0.999, epsilon=1e-08, decay=0.0)66model.compile(loss='mean_squared_error', optimizer=adam, metrics=['accuracy'])67# Summarize layers68print(model.summary())69# Save model image70if not os.path.exists('fig_har_dyna.png'):71 model_file = 'fig_har_dyna.png'72 plot_model(model, to_file=model_file)73new_dir = 'model/'74if not os.path.exists(new_dir):75 os.makedirs(new_dir)76fpath = new_dir + 'weights.{epoch:02d}-{val_acc:.2f}.hdf5'77cp_cb = ModelCheckpoint(fpath, monitor='val_loss', verbose=1, save_best_only=True, mode='auto', period=1)78#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>79# To disable learning, the below code - two lines - is commented.80# To enable learning uncomment the below two lines of code.81#model.fit(np.expand_dims(X_train, axis=2), y_train_dynamic_oh,82# batch_size=32, epochs=50, verbose=2, validation_split=0.2, callbacks=[cp_cb])83#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>84del model85K.clear_session()86'''87/usr/bin/python2.7 /home/hcilab/Documents/OSS/sensors2018cnnhar/har/har_dyna_learn_model.py88/home/hcilab/.local/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.89 from ._conv import register_converters as _register_converters90Using TensorFlow backend.91+++ DATA STATISTICS +++92train_dynamic shape: (3285, 561)93test_dynamic shape: (1387, 561)94_________________________________________________________________95Layer (type) Output Shape Param # 96=================================================================97conv1d_1 (Conv1D) (None, 559, 100) 400 98_________________________________________________________________99max_pooling1d_1 (MaxPooling1 (None, 186, 100) 0 100_________________________________________________________________101flatten_1 (Flatten) (None, 18600) 0 102_________________________________________________________________103dense_1 (Dense) (None, 3) 55803 104_________________________________________________________________105dropout_1 (Dropout) (None, 3) 0 106=================================================================107Total params: 56,203108Trainable params: 56,203109Non-trainable params: 0110_________________________________________________________________111None112Process finished with exit code 0...
more_extensions_dynamic_pb2.py
Source:more_extensions_dynamic_pb2.py
1# -*- coding: utf-8 -*-2# Generated by the protocol buffer compiler. DO NOT EDIT!3# source: google/protobuf/internal/more_extensions_dynamic.proto4from google.protobuf import descriptor as _descriptor5from google.protobuf import message as _message6from google.protobuf import reflection as _reflection7from google.protobuf import symbol_database as _symbol_database8# @@protoc_insertion_point(imports)9_sym_db = _symbol_database.Default()10from google.protobuf.internal import more_extensions_pb2 as google_dot_protobuf_dot_internal_dot_more__extensions__pb211DESCRIPTOR = _descriptor.FileDescriptor(12 name='google/protobuf/internal/more_extensions_dynamic.proto',13 package='google.protobuf.internal',14 syntax='proto2',15 serialized_options=None,16 serialized_pb=b'\n6google/protobuf/internal/more_extensions_dynamic.proto\x12\x18google.protobuf.internal\x1a.google/protobuf/internal/more_extensions.proto\"\x1f\n\x12\x44ynamicMessageType\x12\t\n\x01\x61\x18\x01 \x01(\x05:J\n\x17\x64ynamic_int32_extension\x12).google.protobuf.internal.ExtendedMessage\x18\x64 \x01(\x05:z\n\x19\x64ynamic_message_extension\x12).google.protobuf.internal.ExtendedMessage\x18\x65 \x01(\x0b\x32,.google.protobuf.internal.DynamicMessageType:\x83\x01\n\"repeated_dynamic_message_extension\x12).google.protobuf.internal.ExtendedMessage\x18\x66 \x03(\x0b\x32,.google.protobuf.internal.DynamicMessageType'17 ,18 dependencies=[google_dot_protobuf_dot_internal_dot_more__extensions__pb2.DESCRIPTOR,])19DYNAMIC_INT32_EXTENSION_FIELD_NUMBER = 10020dynamic_int32_extension = _descriptor.FieldDescriptor(21 name='dynamic_int32_extension', full_name='google.protobuf.internal.dynamic_int32_extension', index=0,22 number=100, type=5, cpp_type=1, label=1,23 has_default_value=False, default_value=0,24 message_type=None, enum_type=None, containing_type=None,25 is_extension=True, extension_scope=None,26 serialized_options=None, file=DESCRIPTOR)27DYNAMIC_MESSAGE_EXTENSION_FIELD_NUMBER = 10128dynamic_message_extension = _descriptor.FieldDescriptor(29 name='dynamic_message_extension', full_name='google.protobuf.internal.dynamic_message_extension', index=1,30 number=101, type=11, cpp_type=10, label=1,31 has_default_value=False, default_value=None,32 message_type=None, enum_type=None, containing_type=None,33 is_extension=True, extension_scope=None,34 serialized_options=None, file=DESCRIPTOR)35REPEATED_DYNAMIC_MESSAGE_EXTENSION_FIELD_NUMBER = 10236repeated_dynamic_message_extension = _descriptor.FieldDescriptor(37 name='repeated_dynamic_message_extension', full_name='google.protobuf.internal.repeated_dynamic_message_extension', index=2,38 number=102, type=11, cpp_type=10, label=3,39 has_default_value=False, default_value=[],40 message_type=None, enum_type=None, containing_type=None,41 is_extension=True, extension_scope=None,42 serialized_options=None, file=DESCRIPTOR)43_DYNAMICMESSAGETYPE = _descriptor.Descriptor(44 name='DynamicMessageType',45 full_name='google.protobuf.internal.DynamicMessageType',46 filename=None,47 file=DESCRIPTOR,48 containing_type=None,49 fields=[50 _descriptor.FieldDescriptor(51 name='a', full_name='google.protobuf.internal.DynamicMessageType.a', index=0,52 number=1, type=5, cpp_type=1, label=1,53 has_default_value=False, default_value=0,54 message_type=None, enum_type=None, containing_type=None,55 is_extension=False, extension_scope=None,56 serialized_options=None, file=DESCRIPTOR),57 ],58 extensions=[59 ],60 nested_types=[],61 enum_types=[62 ],63 serialized_options=None,64 is_extendable=False,65 syntax='proto2',66 extension_ranges=[],67 oneofs=[68 ],69 serialized_start=132,70 serialized_end=163,71)72DESCRIPTOR.message_types_by_name['DynamicMessageType'] = _DYNAMICMESSAGETYPE73DESCRIPTOR.extensions_by_name['dynamic_int32_extension'] = dynamic_int32_extension74DESCRIPTOR.extensions_by_name['dynamic_message_extension'] = dynamic_message_extension75DESCRIPTOR.extensions_by_name['repeated_dynamic_message_extension'] = repeated_dynamic_message_extension76_sym_db.RegisterFileDescriptor(DESCRIPTOR)77DynamicMessageType = _reflection.GeneratedProtocolMessageType('DynamicMessageType', (_message.Message,), {78 'DESCRIPTOR' : _DYNAMICMESSAGETYPE,79 '__module__' : 'google.protobuf.internal.more_extensions_dynamic_pb2'80 # @@protoc_insertion_point(class_scope:google.protobuf.internal.DynamicMessageType)81 })82_sym_db.RegisterMessage(DynamicMessageType)83google_dot_protobuf_dot_internal_dot_more__extensions__pb2.ExtendedMessage.RegisterExtension(dynamic_int32_extension)84dynamic_message_extension.message_type = _DYNAMICMESSAGETYPE85google_dot_protobuf_dot_internal_dot_more__extensions__pb2.ExtendedMessage.RegisterExtension(dynamic_message_extension)86repeated_dynamic_message_extension.message_type = _DYNAMICMESSAGETYPE87google_dot_protobuf_dot_internal_dot_more__extensions__pb2.ExtendedMessage.RegisterExtension(repeated_dynamic_message_extension)...
test_dynamic.py
Source:test_dynamic.py
1# Copyright 2015-2017 ARM Limited2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7# http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# See the License for the specific language governing permissions and13# limitations under the License.14#15import unittest16import matplotlib17from test_sched import BaseTestSched18from trappy.base import Base19import trappy20class DynamicEvent(Base):21 """Test the ability to register22 specific classes to trappy"""23 unique_word = "dynamic_test_key"24 name = "dynamic_event"25class TestDynamicEvents(BaseTestSched):26 def __init__(self, *args, **kwargs):27 super(TestDynamicEvents, self).__init__(*args, **kwargs)28 def test_dynamic_data_frame(self):29 """30 Test if the dynamic events are populated31 in the data frame32 """33 parse_class = trappy.register_dynamic_ftrace("DynamicEvent", "dynamic_test_key")34 t = trappy.FTrace(name="first")35 self.assertTrue(len(t.dynamic_event.data_frame) == 1)36 trappy.unregister_dynamic_ftrace(parse_class)37 def test_dynamic_class_attr(self):38 """39 Test the attibutes of the dynamically40 generated class41 """42 cls = trappy.register_dynamic_ftrace("DynamicEvent", "dynamic_test_key",43 pivot="test_pivot")44 self.assertEquals(cls.__name__, "DynamicEvent")45 self.assertEquals(cls.name, "dynamic_event")46 self.assertEquals(cls.unique_word, "dynamic_test_key")47 self.assertEquals(cls.pivot, "test_pivot")48 trappy.unregister_dynamic_ftrace(cls)49 def test_dynamic_event_plot(self):50 """Test if plotter can accept a dynamic class51 for a template argument"""52 cls = trappy.register_dynamic_ftrace("DynamicEvent", "dynamic_test_key")53 t = trappy.FTrace(name="first")54 l = trappy.LinePlot(t, cls, column="load")55 l.view(test=True)56 trappy.unregister_dynamic_ftrace(cls)57 def test_dynamic_event_scope(self):58 """Test the case when an "all" scope class is59 registered. it should appear in both thermal and sched60 ftrace class definitions when scoped ftrace objects are created61 """62 cls = trappy.register_dynamic_ftrace("DynamicEvent", "dynamic_test_key")63 t1 = trappy.FTrace(name="first")64 self.assertTrue(t1.class_definitions.has_key(cls.name))65 trappy.unregister_dynamic_ftrace(cls)66 def test_register_ftrace_parser(self):67 trappy.register_ftrace_parser(DynamicEvent)68 t = trappy.FTrace(name="first")69 self.assertTrue(len(t.dynamic_event.data_frame) == 1)70 trappy.unregister_ftrace_parser(DynamicEvent)71 def test_no_none_pivot(self):72 """register_dynamic_ftrace() with default value for pivot doesn't create a class with a pivot=None"""73 cls = trappy.register_dynamic_ftrace("MyEvent", "my_dyn_test_key")74 self.assertFalse(hasattr(cls, "pivot"))75 trappy.unregister_dynamic_ftrace(cls)76 def test_unregister_dynamic_ftrace(self):77 """Test that dynamic events can be unregistered"""78 dyn_event = trappy.register_dynamic_ftrace("DynamicEvent",79 "dynamic_test_key")80 trace = trappy.FTrace(name="first")81 self.assertTrue(len(trace.dynamic_event.data_frame) == 1)82 trappy.unregister_dynamic_ftrace(dyn_event)83 trace = trappy.FTrace(name="first")84 self.assertFalse(hasattr(trace, "dynamic_event"))85 dyn_event = trappy.register_dynamic_ftrace("DynamicEvent",86 "dynamic_test_key",87 scope="sched")88 trace = trappy.FTrace(name="first")89 self.assertTrue(len(trace.dynamic_event.data_frame) == 1)90 trappy.unregister_dynamic_ftrace(dyn_event)91 trace = trappy.FTrace(name="first")92 self.assertFalse(hasattr(trace, "dynamic_event"))93 def test_unregister_ftrace_parser(self):94 """unregister_ftrace_parser() works"""95 trappy.register_ftrace_parser(DynamicEvent)96 trappy.unregister_ftrace_parser(DynamicEvent)97 trace = trappy.FTrace()...
har_dyna_load_model.py
Source:har_dyna_load_model.py
1import numpy as np2from sklearn.metrics import accuracy_score3from sklearn.metrics import confusion_matrix4from keras.models import load_model5import process_data6import warnings7warnings.simplefilter(action='ignore', category=UserWarning)8import os9os.environ['TF_CPP_MIN_LOG_LEVEL']='2'10'''11See paper: Sensors 2018, 18(4), 1055; https://doi.org/10.3390/s1804105512"Divide and Conquer-Based 1D CNN Human Activity Recognition Using Test Data Sharpening"13by Heeryon Cho & Sang Min Yoon14This code outputs the result of [UCI HAR (Dynamic) : 1D CNN Only (%) : 97.98%]15given in Table 8. (Sensors 2018, 18(4), 1055, page 19 of 24)16The HAR model is saved as model/dynamic.hdf517'''18# Load all train and test data (* dynamic and static data are mixed.)19X_train_all = process_data.load_x("train") # at this stage, the data includes both dynamic and static HAR data20y_train_all = process_data.load_y("train")21X_test_all = process_data.load_x("test")22y_test_all = process_data.load_y("test")23# --------------------------------------24# Only dynamic HAR data are selected25# --------------------------------------26# Select dynamic HAR train data27dynamic_1 = np.where(y_train_all == 1)[0]28dynamic_2 = np.where(y_train_all == 2)[0]29dynamic_3 = np.where(y_train_all == 3)[0]30dynamic = np.concatenate([dynamic_1, dynamic_2, dynamic_3])31X_train = X_train_all[dynamic]32y_train = y_train_all[dynamic]33# Convert (1, 2, 3) labels to (0, 1, 2)34y_train = y_train - 135print "\n+++ DATA STATISTICS +++\n"36print "train_dynamic shape: ", X_train.shape37# Select dynamic HAR test data38dynamic_1 = np.where(y_test_all == 1)[0]39dynamic_2 = np.where(y_test_all == 2)[0]40dynamic_3 = np.where(y_test_all == 3)[0]41dynamic = np.concatenate([dynamic_1, dynamic_2, dynamic_3])42X_test = X_test_all[dynamic]43y_test = y_test_all[dynamic]44# Convert (1, 2, 3) labels to (0, 1, 2)45y_test = y_test - 146print "test_dynamic shape: ", X_test.shape47# Display dynamic model accuracy48print "\n+++ DYNAMIC MODEL ACCURACY (See Table 8 in paper) +++\n"49model_path = "model/dynamic.hdf5"50model = load_model(model_path)51pred_train = model.predict(np.expand_dims(X_train, axis=2), batch_size=32)52print "------ TRAIN ACCURACY ------"53print accuracy_score(y_train, np.argmax(pred_train, axis=1))54print confusion_matrix(y_train, np.argmax(pred_train, axis=1))55pred_test = model.predict(np.expand_dims(X_test, axis=2), batch_size=32)56print "------ TEST ACCURACY ------"57print accuracy_score(y_test, np.argmax(pred_test, axis=1))58print confusion_matrix(y_test, np.argmax(pred_test, axis=1))59'''60/usr/bin/python2.7 /home/hcilab/Documents/OSS/sensors2018cnnhar/har/har_dyna_load_model.py61/home/hcilab/.local/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.62 from ._conv import register_converters as _register_converters63Using TensorFlow backend.64+++ DATA STATISTICS +++65train_dynamic shape: (3285, 561)66test_dynamic shape: (1387, 561)67+++ DYNAMIC MODEL ACCURACY (See Table 8 in paper) +++68------ TRAIN ACCURACY ------690.98630136986370[[1223 3 0]71 [ 4 1038 31]72 [ 0 7 979]]73------ TEST ACCURACY ------740.97981254506175[[495 0 1]76 [ 2 469 0]77 [ 2 23 395]]78Process finished with exit code 0...
runfile.py
Source:runfile.py
1import argparse2import os3import sys4def main():5 ap = argparse.ArgumentParser()6 ap.add_argument("--ckpt_file", type=str, default=None, help="results' dir")7 ap.add_argument("--start_layer", type=int, default=None, help="S3 Path. (haim folder is excluded)")8 ap.add_argument("--model", type=str, default=None, help="summary file Path.")9 args = ap.parse_args()10 time_steps_pool = [5]11 lr_pool = [1e-2, 5e-3, 1e-3, 5e-4, 1e-4]12 decay_pool = [1e-1, 5e-2, 1e-2, 5e-3, 1e-3]13 max_grad_pool = [2.0, 5.0, 7.]14 rms_step_pool = [False, True]15 rms_decay_pool = [False, True]16 param_settings = [(ts,lr,dc,r_step,r_dc, mx_g) for ts in time_steps_pool \17 for lr in lr_pool \18 for dc in decay_pool \19 for r_step in rms_step_pool \20 for r_dc in rms_decay_pool \21 for mx_g in max_grad_pool]22 for i,(dynamic_time_steps,dynamic_lr,dynamic_decay,dynamic_rms_step,dynamic_rms_decay, max_grad) in enumerate(param_settings):23 print("setting %d/%d\n\n" % (i+1, len(param_settings)))24 print(dynamic_time_steps, dynamic_lr, dynamic_decay, dynamic_rms_step, dynamic_rms_decay)25 cmd = "python model_estimator.py --model " + args.model + \26 " --start_layer " + str(args.start_layer) + \27 " --ckpt_file " + str(args.ckpt_file) + \28 " --dynamic_eval True --dynamic_time_steps " + str(dynamic_time_steps) + \29 " --dynamic_lr " + str(dynamic_lr) + \30 " --dynamic_decay " + str(dynamic_decay) + \31 " --dynamic_rms_step " + str(dynamic_rms_step) + \32 " --max_grad_norm " + str(max_grad) + \33 " --dynamic_rms_decay " + str(dynamic_rms_decay)34 os.system(cmd)35 return 036if __name__ == "__main__":...
Using AI Code Generation
1import { withA11y } from '@storybook/addon-a11y';2import { withKnobs } from '@storybook/addon-knobs';3import { withTests } from '@storybook/addon-jest';4import results from '../.jest-test-results.json';5import { addDecorator, addParameters } from '@storybook/react';6import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';7addDecorator(withKnobs);8addDecorator(withA11y);9addDecorator(10 withTests({11 })12);13addParameters({14 viewport: {15 },16});17import { withA11y } from '@storybook/addon-a11y';18import { withKnobs } from '@storybook/addon-knobs';19import { withTests } from '@storybook/addon-jest';20import results from '../.jest-test-results.json';21import { addDecorator, addParameters } from '@storybook/react';22import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';23addDecorator(withKnobs);24addDecorator(withA11y);25addDecorator(26 withTests({27 })28);29addParameters({30 viewport: {31 },32});33- [Chetan Kumar](
Using AI Code Generation
1import { configure } from '@storybook/react';2const req = require.context('../src/components', true, /.story.js$/);3function loadStories() {4 req.keys().forEach(filename => req(filename));5}6configure(loadStories, module);7import { configure } from '@storybook/react';8import { setOptions } from '@storybook/addon-options';9import { addDecorator } from '@storybook/react';10import { withInfo } from '@storybook/addon-info';11import { setDefaults } from '@storybook/addon-info';12import { setOptions as setOptionsInfo } from '@storybook/addon-info';13import { withNotes } from '@storybook/addon-notes';14import { withKnobs } from '@storybook/addon-knobs';15import { withOptions } from '@storybook/addon-options';16import { setDefaults as setDefaultsOptions } from '@storybook/addon-options';17import { setOptions as setOptionsOptions } from '@storybook/addon-options';18import { withConsole } from '@storybook/addon-console';19import { withViewport } from '@storybook/addon-viewport';20import { withBackgrounds } from '@storybook/addon-backgrounds';21import { withLinks } from '@storybook/addon-links';22addDecorator(23 withInfo({24 styles: stylesheet => {25 stylesheet.infoBody = {26 };27 return stylesheet;28 },29 })30);31setDefaults({32 styles: stylesheet => {33 stylesheet.infoBody = {34 };35 return stylesheet;36 },37});38setOptionsInfo({39 styles: stylesheet => {40 stylesheet.infoBody = {41 };42 return stylesheet;43 },44});45addDecorator(withNotes);46addDecorator(withKnobs);47addDecorator(48 withOptions({
Using AI Code Generation
1import { root } from 'storybook-root';2import { storiesOf } from '@storybook/react';3import { withKnobs, text } from '@storybook/addon-knobs';4import { action } from '@storybook/addon-actions';5import { withReadme, withDocs } from 'storybook-readme';6import { withInfo } from '@storybook/addon-info';7import { withTests } from '@storybook/addon-jest';8import { withConsole } from '@storybook/addon-console';9import { withViewport } from '@storybook/addon-viewport';10import { withOptions } from '@storybook/addon-options';11import { withCssResources } from '@storybook/addon-cssresources';12import { withA11y } from '@storybook/addon-a11y';13import { withPaddings } from 'storybook-addon-paddings';14import { withBackgrounds } from '@storybook/addon-backgrounds';15import { withContexts } from '@storybook/addon-contexts/react';16import { withRedux } from '@lib/storybook-addon-redux';17import { withReduxDecorator } from '@lib/storybook-addon-redux-decorator';18import { withReduxSaga } from '@lib/storybook-addon-redux-saga';19import { withReduxState } from '@lib/storybook-addon-redux-state';20import { withGlobalStyles } from '@lib/storybook-addon-global-styles';21import { withI18n } from '@lib/storybook-addon-i18n';22import { withIntl } from '@lib/storybook-addon-intl';23import { withTheme } from '@lib/storybook-addon-theme';24import { withThemes } from '@lib/storybook-addon-themes';25import { withThemeDecorator } from '@lib/storybook-addon-theme-decorator';26import { withThemeKnobs } from '@lib/storybook-addon-theme-knobs';27import { withThemeProvider } from '@lib/storybook-addon-theme-provider';28import { withThemeSelector } from '@lib/storybook-addon-theme-selector';29import { withThemeSwitcher } from '@lib/storybook-addon-theme-switcher';30import { withThemesProvider } from '@lib/storybook-addon-themes-provider';31import { withThemesProviderDecorator } from '@lib/storybook-addon-themes-provider-decorator';32import { withThemesProviderKnobs } from '@lib/storybook-addon-themes-provider-knobs';33import { withThemesProviderSwitcher } from '@lib/storybook-addon-themes-provider-switcher';34import { withThemesSelector } from
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!