user_run.py 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810
  1. import json
  2. import os
  3. import sys
  4. from matplotlib import pyplot as plt
  5. sys.path.append(os.path.dirname(os.path.abspath(__file__)) +
  6. "/../../onsite_parking/")
  7. import input.make_map as mp
  8. from input import make_car
  9. from utils import replay
  10. from utils import map_display as mdp
  11. from planner.hybridastar import planner as planner
  12. import numpy as np
  13. import time
  14. def linear_interpolation(x1,x2,y1,y2,num):
  15. x = np.linspace(x1,x2,num)
  16. y = np.linspace(y1,y2,num)
  17. return x,y
  18. def changeOxyB01(C_,park,ori_ox,ori_oy):
  19. ox = ori_ox.copy()
  20. oy = ori_oy.copy()
  21. C = C_
  22. isSearchFailed = False
  23. if 1<=int(park)<=8:
  24. x = np.linspace(10300, 10300, 500)
  25. y = np.linspace(7000, 1000, 500)
  26. for i in range(len(x)):
  27. ox.append(x[i])
  28. oy.append(y[i])
  29. x = np.linspace(9500, 9500, 500)
  30. y = np.linspace(7000, 1000, 500)
  31. for i in range(len(x)):
  32. ox.append(x[i])
  33. oy.append(y[i])
  34. x = np.linspace(8800, 8800, 500)
  35. y = np.linspace(5500, 6000, 500)
  36. for i in range(len(x)):
  37. ox.append(x[i])
  38. oy.append(y[i])
  39. x = np.linspace(4500, 8800, 500)
  40. y = np.linspace(6000, 6000, 500)
  41. for i in range(len(x)):
  42. ox.append(x[i])
  43. oy.append(y[i])
  44. x = np.linspace(0, 9500, 500)
  45. y = np.linspace(6700, 6700, 500)
  46. for i in range(len(x)):
  47. ox.append(x[i])
  48. oy.append(y[i])
  49. x = np.linspace(8800, 8800, 500)
  50. y = np.linspace(2800, 5500, 500)
  51. for i in range(len(x)):
  52. ox.append(x[i])
  53. oy.append(y[i])
  54. x = np.linspace(7200, 8800, 500)
  55. y = np.linspace(1300, 2800, 500)
  56. for i in range(len(x)):
  57. ox.append(x[i])
  58. oy.append(y[i])
  59. x = np.linspace(9200, 10300, 500)
  60. y = np.linspace(870, 1800, 500)
  61. for i in range(len(x)):
  62. ox.append(x[i])
  63. oy.append(y[i])
  64. C.XY_RESO = C.XY_RESO - 600
  65. if 9<=int(park)<=10:
  66. x = np.linspace(8200, 8200, 500)
  67. y = np.linspace(7000, 0, 500)
  68. for i in range(len(x)):
  69. ox.append(x[i])
  70. oy.append(y[i])
  71. x = np.linspace(1500, 5800, 500)
  72. y = np.linspace(2000, 2000, 500)
  73. for i in range(len(x)):
  74. ox.append(x[i])
  75. oy.append(y[i])
  76. x = np.linspace(2000, 2000, 500)
  77. y = np.linspace(4200, 2800, 500)
  78. for i in range(len(x)):
  79. ox.append(x[i])
  80. oy.append(y[i])
  81. x = np.linspace(2000, 5400, 500)
  82. y = np.linspace(2800, 2800, 500)
  83. for i in range(len(x)):
  84. ox.append(x[i])
  85. oy.append(y[i])
  86. C.XY_RESO = C.XY_RESO - 500
  87. if 11<=int(park)<=12:
  88. x = np.linspace(8200, 8200, 500)
  89. y = np.linspace(7000, 0, 500)
  90. for i in range(len(x)):
  91. ox.append(x[i])
  92. oy.append(y[i])
  93. x = np.linspace(1500, 5800, 500)
  94. y = np.linspace(2000, 2000, 500)
  95. for i in range(len(x)):
  96. ox.append(x[i])
  97. oy.append(y[i])
  98. x = np.linspace(1500, 1500, 500)
  99. y = np.linspace(2000, 4200, 500)
  100. for i in range(len(x)):
  101. ox.append(x[i])
  102. oy.append(y[i])
  103. x = np.linspace(2800, 2800, 500)
  104. y = np.linspace(2800, 4200, 500)
  105. for i in range(len(x)):
  106. ox.append(x[i])
  107. oy.append(y[i])
  108. x = np.linspace(2800, 5800, 500)
  109. y = np.linspace(2800, 2800, 500)
  110. for i in range(len(x)):
  111. ox.append(x[i])
  112. oy.append(y[i])
  113. C.XY_RESO = C.XY_RESO - 400
  114. if 13<=int(park)<=15:
  115. x = np.linspace(8200, 8200, 500)
  116. y = np.linspace(7000, 0, 500)
  117. for i in range(len(x)):
  118. ox.append(x[i])
  119. oy.append(y[i])
  120. x = np.linspace(1500, 5800, 500)
  121. y = np.linspace(2000, 2000, 500)
  122. for i in range(len(x)):
  123. ox.append(x[i])
  124. oy.append(y[i])
  125. x = np.linspace(2400, 2400, 500)
  126. y = np.linspace(2000, 4200, 500)
  127. for i in range(len(x)):
  128. ox.append(x[i])
  129. oy.append(y[i])
  130. x = np.linspace(4200, 4200, 500)
  131. y = np.linspace(2800, 4200, 500)
  132. for i in range(len(x)):
  133. ox.append(x[i])
  134. oy.append(y[i])
  135. x = np.linspace(4200, 5800, 500)
  136. y = np.linspace(2800, 2800, 500)
  137. for i in range(len(x)):
  138. ox.append(x[i])
  139. oy.append(y[i])
  140. C.XY_RESO = C.XY_RESO - 400
  141. if int(park)==16:
  142. x = np.linspace(8200, 8200, 500)
  143. y = np.linspace(7000, 0, 500)
  144. for i in range(len(x)):
  145. ox.append(x[i])
  146. oy.append(y[i])
  147. x = np.linspace(1500, 5800, 500)
  148. y = np.linspace(1800, 1800, 500)
  149. for i in range(len(x)):
  150. ox.append(x[i])
  151. oy.append(y[i])
  152. x = np.linspace(1500, 5800, 500)
  153. y = np.linspace(3200, 3200, 500)
  154. for i in range(len(x)):
  155. ox.append(x[i])
  156. oy.append(y[i])
  157. C.XY_RESO = C.XY_RESO - 300
  158. if park == '17': # TODO
  159. isSearchFailed = True
  160. if park == '18': # TODO
  161. isSearchFailed = True
  162. if park == '19' or park == '20' or park == '21'or park == '22'or park == '23'or park == '24'or park == '25':
  163. x = np.linspace(8300, 8300, 500)
  164. y = np.linspace(2800, 500, 500)
  165. for i in range(len(x)):
  166. ox.append(x[i])
  167. oy.append(y[i])
  168. x = np.linspace(1500, 5100, 500)
  169. y = np.linspace(2900, 2900, 500)
  170. for i in range(len(x)):
  171. ox.append(x[i])
  172. oy.append(y[i])
  173. x = np.linspace(1500, 3000, 500)
  174. y = np.linspace(2200, 2200, 500)
  175. for i in range(len(x)):
  176. ox.append(x[i])
  177. oy.append(y[i])
  178. x = np.linspace(5300, 3000, 500)
  179. y = np.linspace(2800, 2200, 500)
  180. for i in range(len(x)):
  181. ox.append(x[i])
  182. oy.append(y[i])
  183. C.XY_RESO = C.XY_RESO - 200
  184. if park == '26' or park == '27' or park == '28' or park == '29': # TODO
  185. isSearchFailed = True
  186. if park == '30' or park == '31' or park == '32' or park == '33' or park == '34' or park == '35':
  187. x = np.linspace(10000, 7000, 500)
  188. y = np.linspace(2000, 2000, 500)
  189. for i in range(len(x)):
  190. ox.append(x[i])
  191. oy.append(y[i])
  192. if park == '36' or park == '37' or park == '38' or park == '39' or park == '40':
  193. x = np.linspace(10000, 7000, 500)
  194. y = np.linspace(2000, 2000, 500)
  195. for i in range(len(x)):
  196. ox.append(x[i])
  197. oy.append(y[i])
  198. x = np.linspace(12000, 14000, 500)
  199. y = np.linspace(860, 860, 500)
  200. for i in range(len(x)):
  201. ox.append(x[i])
  202. oy.append(y[i])
  203. if park == '41' or park == '42' or park == '43': # TODO
  204. isSearchFailed = True
  205. if park == '44' or park == '45' or park == '46'or park == '47'or park == '48'or park == '49':
  206. x = np.linspace(9000, 9000, 500)
  207. y = np.linspace(2800, 7000, 500)
  208. for i in range(len(x)):
  209. ox.append(x[i])
  210. oy.append(y[i])
  211. x = np.linspace(7200, 8800, 500)
  212. y = np.linspace(2000, 2800, 500)
  213. for i in range(len(x)):
  214. ox.append(x[i])
  215. oy.append(y[i])
  216. x = np.linspace(8500, 10200, 500)
  217. y = np.linspace(940, 1800, 500)
  218. for i in range(len(x)):
  219. ox.append(x[i])
  220. oy.append(y[i])
  221. x = np.linspace(9000, 10500, 500)
  222. y = np.linspace(6300, 6300, 500)
  223. for i in range(len(x)):
  224. ox.append(x[i])
  225. oy.append(y[i])
  226. C.XY_RESO = C.XY_RESO - 200
  227. if park == '50':
  228. x = np.linspace(9000, 9000, 500)
  229. y = np.linspace(2800, 7000, 500)
  230. for i in range(len(x)):
  231. ox.append(x[i])
  232. oy.append(y[i])
  233. x = np.linspace(7200, 8800, 500)
  234. y = np.linspace(2000, 2800, 500)
  235. for i in range(len(x)):
  236. ox.append(x[i])
  237. oy.append(y[i])
  238. x = np.linspace(8500, 10200, 500)
  239. y = np.linspace(940, 1800, 500)
  240. for i in range(len(x)):
  241. ox.append(x[i])
  242. oy.append(y[i])
  243. x = np.linspace(9000, 10500, 500)
  244. y = np.linspace(6300, 6300, 500)
  245. for i in range(len(x)):
  246. ox.append(x[i])
  247. oy.append(y[i])
  248. C.XY_RESO = C.XY_RESO - 500
  249. x = np.linspace(10100, 10100, 500)
  250. y = np.linspace(2500, 4500, 500)
  251. for i in range(len(x)):
  252. ox.append(x[i])
  253. oy.append(y[i])
  254. x = np.linspace(8200, 8200, 500)
  255. y = np.linspace(510, 1000, 500)
  256. for i in range(len(x)):
  257. ox.append(x[i])
  258. oy.append(y[i])
  259. return ox,oy,isSearchFailed
  260. def changeOxyB02(C_,park,ori_ox,ori_oy):
  261. ox = ori_ox.copy()
  262. oy = ori_oy.copy()
  263. isSearchFailed = False
  264. C = C_
  265. if park == '1':
  266. C.XY_RESO = C.XY_RESO - 200
  267. x = np.linspace(4000, 6000, 500)
  268. y = np.linspace(7000, 7000, 500)
  269. for i in range(len(x)):
  270. ox.append(x[i])
  271. oy.append(y[i])
  272. x = np.linspace(6000, 6000, 500)
  273. y = np.linspace(6000, 7000, 500)
  274. for i in range(len(x)):
  275. ox.append(x[i])
  276. oy.append(y[i])
  277. x = np.linspace(4000, 6000, 500)
  278. y = np.linspace(4000, 4000, 500)
  279. for i in range(len(x)):
  280. ox.append(x[i])
  281. oy.append(y[i])
  282. x = np.linspace(4000, 4000, 500)
  283. y = np.linspace(5000, 7000, 500)
  284. for i in range(len(x)):
  285. ox.append(x[i])
  286. oy.append(y[i])
  287. elif park == '2':
  288. C.XY_RESO = C.XY_RESO - 800
  289. x = np.linspace(4000, 6000, 500)
  290. y = np.linspace(7000, 7000, 500)
  291. for i in range(len(x)):
  292. ox.append(x[i])
  293. oy.append(y[i])
  294. x = np.linspace(6000, 6000, 500)
  295. y = np.linspace(6000, 7000, 500)
  296. for i in range(len(x)):
  297. ox.append(x[i])
  298. oy.append(y[i])
  299. x = np.linspace(4000, 6000, 500)
  300. y = np.linspace(4500, 4500, 500)
  301. for i in range(len(x)):
  302. ox.append(x[i])
  303. oy.append(y[i])
  304. x = np.linspace(4000, 4000, 500)
  305. y = np.linspace(5000, 7000, 500)
  306. for i in range(len(x)):
  307. ox.append(x[i])
  308. oy.append(y[i])
  309. elif park == '3':
  310. C.XY_RESO = C.XY_RESO - 800
  311. x = np.linspace(4000, 6000, 500)
  312. y = np.linspace(7000, 7000, 500)
  313. for i in range(len(x)):
  314. ox.append(x[i])
  315. oy.append(y[i])
  316. x = np.linspace(6000, 6000, 500)
  317. y = np.linspace(6000, 7000, 500)
  318. for i in range(len(x)):
  319. ox.append(x[i])
  320. oy.append(y[i])
  321. x = np.linspace(4000, 6000, 500)
  322. y = np.linspace(4000, 4000, 500)
  323. for i in range(len(x)):
  324. ox.append(x[i])
  325. oy.append(y[i])
  326. x = np.linspace(4000, 4000, 500)
  327. y = np.linspace(5000, 7000, 500)
  328. for i in range(len(x)):
  329. ox.append(x[i])
  330. oy.append(y[i])
  331. elif park == '4':
  332. C.XY_RESO = C.XY_RESO - 800
  333. x = np.linspace(4000, 6000, 500)
  334. y = np.linspace(7000, 7000, 500)
  335. for i in range(len(x)):
  336. ox.append(x[i])
  337. oy.append(y[i])
  338. x = np.linspace(6000, 6000, 500)
  339. y = np.linspace(6000, 7000, 500)
  340. for i in range(len(x)):
  341. ox.append(x[i])
  342. oy.append(y[i])
  343. x = np.linspace(4000, 6000, 500)
  344. y = np.linspace(3500, 3500, 500)
  345. for i in range(len(x)):
  346. ox.append(x[i])
  347. oy.append(y[i])
  348. x = np.linspace(4000, 4000, 500)
  349. y = np.linspace(5000, 7000, 500)
  350. for i in range(len(x)):
  351. ox.append(x[i])
  352. oy.append(y[i])
  353. elif park == '5':
  354. C.XY_RESO = C.XY_RESO - 800
  355. x = np.linspace(4000, 6000, 500)
  356. y = np.linspace(7000, 7000, 500)
  357. for i in range(len(x)):
  358. ox.append(x[i])
  359. oy.append(y[i])
  360. x = np.linspace(6000, 6000, 500)
  361. y = np.linspace(6000, 7000, 500)
  362. for i in range(len(x)):
  363. ox.append(x[i])
  364. oy.append(y[i])
  365. x = np.linspace(4000, 6000, 500)
  366. y = np.linspace(3000, 3000, 500)
  367. for i in range(len(x)):
  368. ox.append(x[i])
  369. oy.append(y[i])
  370. x = np.linspace(4000, 4000, 500)
  371. y = np.linspace(5000, 7000, 500)
  372. for i in range(len(x)):
  373. ox.append(x[i])
  374. oy.append(y[i])
  375. elif park == '6':
  376. C.XY_RESO = C.XY_RESO - 800
  377. x = np.linspace(4000, 6000, 500)
  378. y = np.linspace(7000, 7000, 500)
  379. for i in range(len(x)):
  380. ox.append(x[i])
  381. oy.append(y[i])
  382. x = np.linspace(6000, 6000, 500)
  383. y = np.linspace(6000, 7000, 500)
  384. for i in range(len(x)):
  385. ox.append(x[i])
  386. oy.append(y[i])
  387. x = np.linspace(4000, 6000, 500)
  388. y = np.linspace(1500, 1500, 500)
  389. for i in range(len(x)):
  390. ox.append(x[i])
  391. oy.append(y[i])
  392. x = np.linspace(4000, 4000, 500)
  393. y = np.linspace(1500, 7000, 500)
  394. for i in range(len(x)):
  395. ox.append(x[i])
  396. oy.append(y[i])
  397. elif park == '7':
  398. C.XY_RESO = C.XY_RESO - 800
  399. x = np.linspace(4000, 6000, 500)
  400. y = np.linspace(7000, 7000, 500)
  401. for i in range(len(x)):
  402. ox.append(x[i])
  403. oy.append(y[i])
  404. x = np.linspace(6000, 6000, 500)
  405. y = np.linspace(6000, 7000, 500)
  406. for i in range(len(x)):
  407. ox.append(x[i])
  408. oy.append(y[i])
  409. x = np.linspace(4000, 6000, 500)
  410. y = np.linspace(1000, 1000, 500)
  411. for i in range(len(x)):
  412. ox.append(x[i])
  413. oy.append(y[i])
  414. x = np.linspace(4000, 4000, 500)
  415. y = np.linspace(1000, 7000, 500)
  416. for i in range(len(x)):
  417. ox.append(x[i])
  418. oy.append(y[i])
  419. elif park == '8':
  420. C.XY_RESO = C.XY_RESO - 800
  421. x = np.linspace(4000, 6000, 500)
  422. y = np.linspace(7000, 7000, 500)
  423. for i in range(len(x)):
  424. ox.append(x[i])
  425. oy.append(y[i])
  426. x = np.linspace(6000, 6000, 500)
  427. y = np.linspace(6000, 7000, 500)
  428. for i in range(len(x)):
  429. ox.append(x[i])
  430. oy.append(y[i])
  431. # x = np.linspace(4000, 6000, 500)
  432. # y = np.linspace(1000, 1000, 500)
  433. # for i in range(len(x)):
  434. # ox.append(x[i])
  435. # oy.append(y[i])
  436. x = np.linspace(4000, 4000, 500)
  437. y = np.linspace(1000, 7000, 500)
  438. for i in range(len(x)):
  439. ox.append(x[i])
  440. oy.append(y[i])
  441. elif park == '9':
  442. C.XY_RESO = C.XY_RESO - 800
  443. x = np.linspace(4000, 6000, 500)
  444. y = np.linspace(7000, 7000, 500)
  445. for i in range(len(x)):
  446. ox.append(x[i])
  447. oy.append(y[i])
  448. x = np.linspace(5500, 5500, 500)
  449. y = np.linspace(6000, 7000, 500)
  450. for i in range(len(x)):
  451. ox.append(x[i])
  452. oy.append(y[i])
  453. x = np.linspace(5000, 6000, 500)
  454. y = np.linspace(6000, 6000, 500)
  455. for i in range(len(x)):
  456. ox.append(x[i])
  457. oy.append(y[i])
  458. x = np.linspace(4500, 4500, 500)
  459. y = np.linspace(0, 7000, 500)
  460. for i in range(len(x)):
  461. ox.append(x[i])
  462. oy.append(y[i])
  463. x = np.linspace(5000, 5000, 500)
  464. y = np.linspace(1000, 6000, 500)
  465. for i in range(len(x)):
  466. ox.append(x[i])
  467. oy.append(y[i])
  468. elif park == '10':
  469. C.XY_RESO = C.XY_RESO - 800
  470. x = np.linspace(4000, 6000, 500)
  471. y = np.linspace(7000, 7000, 500)
  472. for i in range(len(x)):
  473. ox.append(x[i])
  474. oy.append(y[i])
  475. x = np.linspace(5500, 5500, 500)
  476. y = np.linspace(6000, 7000, 500)
  477. for i in range(len(x)):
  478. ox.append(x[i])
  479. oy.append(y[i])
  480. x = np.linspace(5000, 6000, 500)
  481. y = np.linspace(6000, 6000, 500)
  482. for i in range(len(x)):
  483. ox.append(x[i])
  484. oy.append(y[i])
  485. elif park == '11':
  486. C.XY_RESO = C.XY_RESO - 800
  487. x = np.linspace(4000, 6000, 500)
  488. y = np.linspace(7000, 7000, 500)
  489. for i in range(len(x)):
  490. ox.append(x[i])
  491. oy.append(y[i])
  492. x = np.linspace(5500, 5500, 500)
  493. y = np.linspace(6000, 7000, 500)
  494. for i in range(len(x)):
  495. ox.append(x[i])
  496. oy.append(y[i])
  497. x = np.linspace(5000, 6000, 500)
  498. y = np.linspace(6000, 6000, 500)
  499. for i in range(len(x)):
  500. ox.append(x[i])
  501. oy.append(y[i])
  502. x = np.linspace(4500, 4500, 500)
  503. y = np.linspace(1500, 7000, 500)
  504. for i in range(len(x)):
  505. ox.append(x[i])
  506. oy.append(y[i])
  507. x = np.linspace(5000, 5000, 500)
  508. y = np.linspace(0, 6000, 500)
  509. for i in range(len(x)):
  510. ox.append(x[i])
  511. oy.append(y[i])
  512. x = np.linspace(3000, 4500, 500)
  513. y = np.linspace(1500, 1500, 500)
  514. for i in range(len(x)):
  515. ox.append(x[i])
  516. oy.append(y[i])
  517. elif park == '12':
  518. C.XY_RESO = C.XY_RESO - 800
  519. x = np.linspace(4000, 6000, 500)
  520. y = np.linspace(7000, 7000, 500)
  521. for i in range(len(x)):
  522. ox.append(x[i])
  523. oy.append(y[i])
  524. x = np.linspace(5500, 5500, 500)
  525. y = np.linspace(6000, 7000, 500)
  526. for i in range(len(x)):
  527. ox.append(x[i])
  528. oy.append(y[i])
  529. x = np.linspace(5000, 6000, 500)
  530. y = np.linspace(6000, 6000, 500)
  531. for i in range(len(x)):
  532. ox.append(x[i])
  533. oy.append(y[i])
  534. x = np.linspace(4500, 4500, 500)
  535. y = np.linspace(1000, 7000, 500)
  536. for i in range(len(x)):
  537. ox.append(x[i])
  538. oy.append(y[i])
  539. x = np.linspace(5000, 5000, 500)
  540. y = np.linspace(0, 6000, 500)
  541. for i in range(len(x)):
  542. ox.append(x[i])
  543. oy.append(y[i])
  544. x = np.linspace(3000, 4500, 500)
  545. y = np.linspace(1000, 1000, 500)
  546. for i in range(len(x)):
  547. ox.append(x[i])
  548. oy.append(y[i])
  549. elif park == '13':
  550. C.XY_RESO = C.XY_RESO - 800
  551. x = np.linspace(4000, 6000, 500)
  552. y = np.linspace(7000, 7000, 500)
  553. for i in range(len(x)):
  554. ox.append(x[i])
  555. oy.append(y[i])
  556. x = np.linspace(5500, 5500, 500)
  557. y = np.linspace(6000, 7000, 500)
  558. for i in range(len(x)):
  559. ox.append(x[i])
  560. oy.append(y[i])
  561. x = np.linspace(5000, 6000, 500)
  562. y = np.linspace(6000, 6000, 500)
  563. for i in range(len(x)):
  564. ox.append(x[i])
  565. oy.append(y[i])
  566. x = np.linspace(4500, 4500, 500)
  567. y = np.linspace(1000, 7000, 500)
  568. for i in range(len(x)):
  569. ox.append(x[i])
  570. oy.append(y[i])
  571. x = np.linspace(5000, 5000, 500)
  572. y = np.linspace(0, 6000, 500)
  573. for i in range(len(x)):
  574. ox.append(x[i])
  575. oy.append(y[i])
  576. x = np.linspace(2000, 4500, 500)
  577. y = np.linspace(1000, 1000, 500)
  578. for i in range(len(x)):
  579. ox.append(x[i])
  580. oy.append(y[i])
  581. x = np.linspace(3000, 5000, 500)
  582. y = np.linspace(300, 300, 500)
  583. for i in range(len(x)):
  584. ox.append(x[i])
  585. oy.append(y[i])
  586. elif park == '14':
  587. C.XY_RESO = C.XY_RESO - 800
  588. x = np.linspace(4000, 6000, 500)
  589. y = np.linspace(7000, 7000, 500)
  590. for i in range(len(x)):
  591. ox.append(x[i])
  592. oy.append(y[i])
  593. x = np.linspace(5500, 5500, 500)
  594. y = np.linspace(6000, 7000, 500)
  595. for i in range(len(x)):
  596. ox.append(x[i])
  597. oy.append(y[i])
  598. x = np.linspace(5000, 6000, 500)
  599. y = np.linspace(6000, 6000, 500)
  600. for i in range(len(x)):
  601. ox.append(x[i])
  602. oy.append(y[i])
  603. x = np.linspace(4500, 4500, 500)
  604. y = np.linspace(1000, 7000, 500)
  605. for i in range(len(x)):
  606. ox.append(x[i])
  607. oy.append(y[i])
  608. x = np.linspace(5000, 5000, 500)
  609. y = np.linspace(0, 6000, 500)
  610. for i in range(len(x)):
  611. ox.append(x[i])
  612. oy.append(y[i])
  613. x = np.linspace(0, 4500, 500)
  614. y = np.linspace(1000, 1000, 500)
  615. for i in range(len(x)):
  616. ox.append(x[i])
  617. oy.append(y[i])
  618. x = np.linspace(2000, 5000, 500)
  619. y = np.linspace(300, 300, 500)
  620. for i in range(len(x)):
  621. ox.append(x[i])
  622. oy.append(y[i])
  623. elif park == '15' or park == '16' or park == '17' or park == '18' or park == '19' or park == '20' or park == '21' or park == '22':
  624. C.XY_RESO = C.XY_RESO - 200
  625. x = np.linspace(5500, 5500, 500)
  626. y = np.linspace(6200, 7000, 500)
  627. for i in range(len(x)):
  628. ox.append(x[i])
  629. oy.append(y[i])
  630. x = np.linspace(1800, 1800, 500)
  631. y = np.linspace(1000, 6200, 500)
  632. for i in range(len(x)):
  633. ox.append(x[i])
  634. oy.append(y[i])
  635. x = np.linspace(500, 5000, 500)
  636. y = np.linspace(7300, 7300, 500)
  637. for i in range(len(x)):
  638. ox.append(x[i])
  639. oy.append(y[i])
  640. x = np.linspace(3500, 5500, 500)
  641. y = np.linspace(6200, 6200, 500)
  642. for i in range(len(x)):
  643. ox.append(x[i])
  644. oy.append(y[i])
  645. elif park == '23' or park == '24': # TOD: 23,24
  646. C.XY_RESO = C.XY_RESO - 300
  647. x = np.linspace(5500, 5500, 500)
  648. y = np.linspace(6200, 7000, 500)
  649. for i in range(len(x)):
  650. ox.append(x[i])
  651. oy.append(y[i])
  652. x = np.linspace(1800, 1800, 500)
  653. y = np.linspace(1000, 6200, 500)
  654. for i in range(len(x)):
  655. ox.append(x[i])
  656. oy.append(y[i])
  657. x = np.linspace(500, 5000, 500)
  658. y = np.linspace(7300, 7300, 500)
  659. for i in range(len(x)):
  660. ox.append(x[i])
  661. oy.append(y[i])
  662. x = np.linspace(3500, 5500, 500)
  663. y = np.linspace(6200, 6200, 500)
  664. for i in range(len(x)):
  665. ox.append(x[i])
  666. oy.append(y[i])
  667. elif park =='25':
  668. C.XY_RESO = C.XY_RESO - 300
  669. x = np.linspace(5500, 5500, 500)
  670. y = np.linspace(6200, 7000, 500)
  671. for i in range(len(x)):
  672. ox.append(x[i])
  673. oy.append(y[i])
  674. x = np.linspace(1800, 1800, 500)
  675. y = np.linspace(1000, 6200, 500)
  676. for i in range(len(x)):
  677. ox.append(x[i])
  678. oy.append(y[i])
  679. x = np.linspace(500, 5000, 500)
  680. y = np.linspace(7300, 7300, 500)
  681. for i in range(len(x)):
  682. ox.append(x[i])
  683. oy.append(y[i])
  684. x = np.linspace(3500, 5500, 500)
  685. y = np.linspace(6200, 6200, 500)
  686. for i in range(len(x)):
  687. ox.append(x[i])
  688. oy.append(y[i])
  689. x = np.linspace(500, 2500, 500)
  690. y = np.linspace(5500, 5500, 500)
  691. for i in range(len(x)):
  692. ox.append(x[i])
  693. oy.append(y[i])
  694. elif park == '26':
  695. C.XY_RESO = C.XY_RESO - 200
  696. x = np.linspace(5500, 5500, 500)
  697. y = np.linspace(6200, 7000, 500)
  698. for i in range(len(x)):
  699. ox.append(x[i])
  700. oy.append(y[i])
  701. x = np.linspace(1800, 1800, 500)
  702. y = np.linspace(1000, 6200, 500)
  703. for i in range(len(x)):
  704. ox.append(x[i])
  705. oy.append(y[i])
  706. x = np.linspace(500, 5000, 500)
  707. y = np.linspace(7300, 7300, 500)
  708. for i in range(len(x)):
  709. ox.append(x[i])
  710. oy.append(y[i])
  711. x = np.linspace(3500, 5500, 500)
  712. y = np.linspace(6200, 6200, 500)
  713. for i in range(len(x)):
  714. ox.append(x[i])
  715. oy.append(y[i])
  716. elif park == '27':
  717. C.XY_RESO = C.XY_RESO - 300
  718. x = np.linspace(5500, 5500, 500)
  719. y = np.linspace(6200, 7000, 500)
  720. for i in range(len(x)):
  721. ox.append(x[i])
  722. oy.append(y[i])
  723. x = np.linspace(1500, 5000, 500)
  724. y = np.linspace(7300, 7300, 500)
  725. for i in range(len(x)):
  726. ox.append(x[i])
  727. oy.append(y[i])
  728. x = np.linspace(3500, 5500, 500)
  729. y = np.linspace(6200, 6200, 500)
  730. for i in range(len(x)):
  731. ox.append(x[i])
  732. oy.append(y[i])
  733. elif park == '28':
  734. C.XY_RESO = C.XY_RESO - 300
  735. x = np.linspace(5500, 5500, 500)
  736. y = np.linspace(6200, 7000, 500)
  737. for i in range(len(x)):
  738. ox.append(x[i])
  739. oy.append(y[i])
  740. x = np.linspace(3500, 5000, 500)
  741. y = np.linspace(7300, 7300, 500)
  742. for i in range(len(x)):
  743. ox.append(x[i])
  744. oy.append(y[i])
  745. x = np.linspace(3500, 5500, 500)
  746. y = np.linspace(6200, 6200, 500)
  747. for i in range(len(x)):
  748. ox.append(x[i])
  749. oy.append(y[i])
  750. elif park == '29': # TOD: 29
  751. C.XY_RESO = C.XY_RESO - 300
  752. x = np.linspace(5500, 5500, 500)
  753. y = np.linspace(6200, 7000, 500)
  754. for i in range(len(x)):
  755. ox.append(x[i])
  756. oy.append(y[i])
  757. x = np.linspace(4000, 5000, 500)
  758. y = np.linspace(7300, 7300, 500)
  759. for i in range(len(x)):
  760. ox.append(x[i])
  761. oy.append(y[i])
  762. x = np.linspace(3500, 5500, 500)
  763. y = np.linspace(6200, 6200, 500)
  764. for i in range(len(x)):
  765. ox.append(x[i])
  766. oy.append(y[i])
  767. elif park == '30':
  768. C.XY_RESO = C.XY_RESO - 200
  769. x = np.linspace(5500, 5500, 500)
  770. y = np.linspace(6200, 7000, 500)
  771. for i in range(len(x)):
  772. ox.append(x[i])
  773. oy.append(y[i])
  774. x = np.linspace(500, 5000, 500)
  775. y = np.linspace(7300, 7300, 500)
  776. for i in range(len(x)):
  777. ox.append(x[i])
  778. oy.append(y[i])
  779. x = np.linspace(3500, 5500, 500)
  780. y = np.linspace(6200, 6200, 500)
  781. for i in range(len(x)):
  782. ox.append(x[i])
  783. oy.append(y[i])
  784. elif park == '31':
  785. C.XY_RESO = C.XY_RESO - 200
  786. x = np.linspace(5500, 5500, 500)
  787. y = np.linspace(6200, 7000, 500)
  788. for i in range(len(x)):
  789. ox.append(x[i])
  790. oy.append(y[i])
  791. x = np.linspace(500, 5000, 500)
  792. y = np.linspace(7300, 7300, 500)
  793. for i in range(len(x)):
  794. ox.append(x[i])
  795. oy.append(y[i])
  796. x = np.linspace(3500, 5500, 500)
  797. y = np.linspace(6200, 6200, 500)
  798. for i in range(len(x)):
  799. ox.append(x[i])
  800. oy.append(y[i])
  801. x = np.linspace(1000, 1000, 500)
  802. y = np.linspace(200, 7300, 500)
  803. for i in range(len(x)):
  804. ox.append(x[i])
  805. oy.append(y[i])
  806. elif park == '32':
  807. C.XY_RESO = C.XY_RESO - 700
  808. x = np.linspace(5500, 5500, 500)
  809. y = np.linspace(6200, 7300, 500)
  810. for i in range(len(x)):
  811. ox.append(x[i])
  812. oy.append(y[i])
  813. x = np.linspace(500, 5500, 500)
  814. y = np.linspace(7200, 7200, 500)
  815. for i in range(len(x)):
  816. ox.append(x[i])
  817. oy.append(y[i])
  818. x = np.linspace(3500, 5500, 500)
  819. y = np.linspace(6200, 6200, 500)
  820. for i in range(len(x)):
  821. ox.append(x[i])
  822. oy.append(y[i])
  823. x = np.linspace(1200, 1200, 500)
  824. y = np.linspace(200, 7300, 500)
  825. for i in range(len(x)):
  826. ox.append(x[i])
  827. oy.append(y[i])
  828. x = np.linspace(1800, 1800, 500)
  829. y = np.linspace(5500, 6500, 500)
  830. for i in range(len(x)):
  831. ox.append(x[i])
  832. oy.append(y[i])
  833. x = np.linspace(500, 5500, 500)
  834. y = np.linspace(4200, 4200, 500)
  835. for i in range(len(x)):
  836. ox.append(x[i])
  837. oy.append(y[i])
  838. elif park == '33' or park == '34' or park == '36':
  839. C.XY_RESO = C.XY_RESO - 200
  840. x = np.linspace(5500, 5500, 500)
  841. y = np.linspace(6200, 7000, 500)
  842. for i in range(len(x)):
  843. ox.append(x[i])
  844. oy.append(y[i])
  845. x = np.linspace(500, 5000, 500)
  846. y = np.linspace(7300, 7300, 500)
  847. for i in range(len(x)):
  848. ox.append(x[i])
  849. oy.append(y[i])
  850. x = np.linspace(3500, 5500, 500)
  851. y = np.linspace(6200, 6200, 500)
  852. for i in range(len(x)):
  853. ox.append(x[i])
  854. oy.append(y[i])
  855. x = np.linspace(1000, 1000, 500)
  856. y = np.linspace(200, 7300, 500)
  857. for i in range(len(x)):
  858. ox.append(x[i])
  859. oy.append(y[i])
  860. elif park == '35':
  861. C.XY_RESO = C.XY_RESO - 700
  862. x = np.linspace(5500, 5500, 500)
  863. y = np.linspace(6200, 7300, 500)
  864. for i in range(len(x)):
  865. ox.append(x[i])
  866. oy.append(y[i])
  867. x = np.linspace(500, 5500, 500)
  868. y = np.linspace(7200, 7200, 500)
  869. for i in range(len(x)):
  870. ox.append(x[i])
  871. oy.append(y[i])
  872. x = np.linspace(3500, 5500, 500)
  873. y = np.linspace(6200, 6200, 500)
  874. for i in range(len(x)):
  875. ox.append(x[i])
  876. oy.append(y[i])
  877. x = np.linspace(1200, 1200, 500)
  878. y = np.linspace(200, 7300, 500)
  879. for i in range(len(x)):
  880. ox.append(x[i])
  881. oy.append(y[i])
  882. x = np.linspace(1800, 1800, 500)
  883. y = np.linspace(4500, 6500, 500)
  884. for i in range(len(x)):
  885. ox.append(x[i])
  886. oy.append(y[i])
  887. x = np.linspace(500, 5500, 500)
  888. y = np.linspace(1500, 1500, 500)
  889. for i in range(len(x)):
  890. ox.append(x[i])
  891. oy.append(y[i])
  892. elif park == '37':
  893. C.XY_RESO = C.XY_RESO - 700
  894. x = np.linspace(5500, 5500, 500)
  895. y = np.linspace(6200, 7300, 500)
  896. for i in range(len(x)):
  897. ox.append(x[i])
  898. oy.append(y[i])
  899. x = np.linspace(500, 5500, 500)
  900. y = np.linspace(7200, 7200, 500)
  901. for i in range(len(x)):
  902. ox.append(x[i])
  903. oy.append(y[i])
  904. x = np.linspace(3500, 5500, 500)
  905. y = np.linspace(6200, 6200, 500)
  906. for i in range(len(x)):
  907. ox.append(x[i])
  908. oy.append(y[i])
  909. x = np.linspace(1200, 1200, 500)
  910. y = np.linspace(200, 7300, 500)
  911. for i in range(len(x)):
  912. ox.append(x[i])
  913. oy.append(y[i])
  914. x = np.linspace(1800, 1800, 500)
  915. y = np.linspace(2500, 6500, 500)
  916. for i in range(len(x)):
  917. ox.append(x[i])
  918. oy.append(y[i])
  919. x = np.linspace(500, 5500, 500)
  920. y = np.linspace(500, 500, 500)
  921. for i in range(len(x)):
  922. ox.append(x[i])
  923. oy.append(y[i])
  924. elif park == '38':
  925. C.XY_RESO = C.XY_RESO - 700
  926. x = np.linspace(5500, 5500, 500)
  927. y = np.linspace(6200, 7300, 500)
  928. for i in range(len(x)):
  929. ox.append(x[i])
  930. oy.append(y[i])
  931. x = np.linspace(500, 5500, 500)
  932. y = np.linspace(7200, 7200, 500)
  933. for i in range(len(x)):
  934. ox.append(x[i])
  935. oy.append(y[i])
  936. x = np.linspace(3500, 5500, 500)
  937. y = np.linspace(6200, 6200, 500)
  938. for i in range(len(x)):
  939. ox.append(x[i])
  940. oy.append(y[i])
  941. x = np.linspace(1200, 1200, 500)
  942. y = np.linspace(200, 7300, 500)
  943. for i in range(len(x)):
  944. ox.append(x[i])
  945. oy.append(y[i])
  946. x = np.linspace(1800, 1800, 500)
  947. y = np.linspace(2500, 6500, 500)
  948. for i in range(len(x)):
  949. ox.append(x[i])
  950. oy.append(y[i])
  951. x = np.linspace(500, 5500, 500)
  952. y = np.linspace(500, 500, 500)
  953. for i in range(len(x)):
  954. ox.append(x[i])
  955. oy.append(y[i])
  956. elif park == '39' or park == '42' or park == '43' or park == '44':
  957. x = np.linspace(5500, 5500, 500)
  958. y = np.linspace(6200, 7300, 500)
  959. for i in range(len(x)):
  960. ox.append(x[i])
  961. oy.append(y[i])
  962. x = np.linspace(500, 5500, 500)
  963. y = np.linspace(7200, 7200, 500)
  964. for i in range(len(x)):
  965. ox.append(x[i])
  966. oy.append(y[i])
  967. x = np.linspace(4500, 4500, 500)
  968. y = np.linspace(500, 6200, 500)
  969. for i in range(len(x)):
  970. ox.append(x[i])
  971. oy.append(y[i])
  972. x = np.linspace(3500, 3500, 500)
  973. y = np.linspace(6200, 7300, 500)
  974. for i in range(len(x)):
  975. ox.append(x[i])
  976. oy.append(y[i])
  977. elif park == '40' or park == '41' or park == '45':
  978. x = np.linspace(3500, 3500, 500)
  979. y = np.linspace(6200, 7300, 500)
  980. for i in range(len(x)):
  981. ox.append(x[i])
  982. oy.append(y[i])
  983. x = np.linspace(3500, 5000, 500)
  984. y = np.linspace(7000, 7000, 500)
  985. for i in range(len(x)):
  986. ox.append(x[i])
  987. oy.append(y[i])
  988. x = np.linspace(5100, 5100, 500)
  989. y = np.linspace(3700, 6500, 500)
  990. for i in range(len(x)):
  991. ox.append(x[i])
  992. oy.append(y[i])
  993. elif park == '46' or park == '47':
  994. x = np.linspace(3500, 3500, 500)
  995. y = np.linspace(6200, 7300, 500)
  996. for i in range(len(x)):
  997. ox.append(x[i])
  998. oy.append(y[i])
  999. x = np.linspace(3500, 5000, 500)
  1000. y = np.linspace(7000, 7000, 500)
  1001. for i in range(len(x)):
  1002. ox.append(x[i])
  1003. oy.append(y[i])
  1004. x = np.linspace(5100, 5100, 500)
  1005. y = np.linspace(3700, 6500, 500)
  1006. for i in range(len(x)):
  1007. ox.append(x[i])
  1008. oy.append(y[i])
  1009. x = np.linspace(3500, 5000, 500)
  1010. y = np.linspace(4500, 4500, 500)
  1011. for i in range(len(x)):
  1012. ox.append(x[i])
  1013. oy.append(y[i])
  1014. return ox,oy,isSearchFailed
  1015. def changeOxyB03(C_,park,ori_ox,ori_oy):
  1016. ox = ori_ox.copy()
  1017. oy = ori_oy.copy()
  1018. isSearchFailed = False
  1019. C = C_
  1020. if park == '1' or park == '2' or park == '3' or park == '4' or park == '5' or park == '6' or park == '7' or park == '8' or park == '9' or park == '10' or park == '11' or park == '12' or park == '13' or park == '14' or park == '15' or park == '16':
  1021. C.XY_RESO = C.XY_RESO - 200
  1022. x = np.linspace(4500, 4500, 500)
  1023. y = np.linspace(6000, 5000, 500)
  1024. for i in range(len(x)):
  1025. ox.append(x[i])
  1026. oy.append(y[i])
  1027. x = np.linspace(3500, 3500, 500)
  1028. y = np.linspace(3100, 7000, 500)
  1029. for i in range(len(x)):
  1030. ox.append(x[i])
  1031. oy.append(y[i])
  1032. x = np.linspace(0, 2100, 500)
  1033. y = np.linspace(5600, 5600, 500)
  1034. for i in range(len(x)):
  1035. ox.append(x[i])
  1036. oy.append(y[i])
  1037. x = np.linspace(2100, 2100, 500)
  1038. y = np.linspace(4500, 5700, 500)
  1039. for i in range(len(x)):
  1040. ox.append(x[i])
  1041. oy.append(y[i])
  1042. x = np.linspace(1000, 4000, 500)
  1043. y = np.linspace(6600, 6600, 500)
  1044. for i in range(len(x)):
  1045. ox.append(x[i])
  1046. oy.append(y[i])
  1047. x = np.linspace(1000, 1000, 100)
  1048. y = np.linspace(7700, 6600, 100)
  1049. for i in range(len(x)):
  1050. ox.append(x[i])
  1051. oy.append(y[i])
  1052. x = np.linspace(1000, 3500, 100)
  1053. y = np.linspace(3100, 3100, 100)
  1054. for i in range(len(x)):
  1055. ox.append(x[i])
  1056. oy.append(y[i])
  1057. elif park == '17' or park == '18' or park == '19' or park == '20':
  1058. x = np.linspace(4500, 4500, 500)
  1059. y = np.linspace(6000, 5000, 500)
  1060. for i in range(len(x)):
  1061. ox.append(x[i])
  1062. oy.append(y[i])
  1063. if park == '24' or park == '25' or park == '26' or park == '27' or park == '30' or park == '31' or park == '32':
  1064. isSearchFailed = True
  1065. if park == '28' or park == '29':
  1066. C.XY_RESO = C.XY_RESO - 800
  1067. x = np.linspace(1000, 1000, 500)
  1068. y = np.linspace(7700, 6600, 500)
  1069. for i in range(len(x)):
  1070. ox.append(x[i])
  1071. oy.append(y[i])
  1072. x = np.linspace(1000, 5000, 500)
  1073. y = np.linspace(6600, 6600, 500)
  1074. for i in range(len(x)):
  1075. ox.append(x[i])
  1076. oy.append(y[i])
  1077. x = np.linspace(1000, 5000, 500)
  1078. y = np.linspace(4500, 4500, 500)
  1079. for i in range(len(x)):
  1080. ox.append(x[i])
  1081. oy.append(y[i])
  1082. x = np.linspace(4500, 4500, 500)
  1083. y = np.linspace(5000, 6000, 500)
  1084. for i in range(len(x)):
  1085. ox.append(x[i])
  1086. oy.append(y[i])
  1087. if park == '62'or park == '61':
  1088. for i in range(0, 3000, 1):
  1089. ox.append(i)
  1090. oy.append(5600)
  1091. for i in range(1000, 4500, 1):
  1092. ox.append(i)
  1093. oy.append(6500)
  1094. for i in range(6500, 7700, 1):
  1095. ox.append(1000)
  1096. oy.append(i)
  1097. x = np.linspace(3000, 4500, 500)
  1098. y = np.linspace(5600, 5000, 500)
  1099. for i in range(len(x)):
  1100. ox.append(x[i])
  1101. oy.append(y[i])
  1102. x = np.linspace(6000, 7800, 500)
  1103. y = np.linspace(5000, 5300, 500)
  1104. for i in range(len(x)):
  1105. ox.append(x[i])
  1106. oy.append(y[i])
  1107. x = np.linspace(8200, 10500, 500)
  1108. y = np.linspace(5720, 7700, 500)
  1109. for i in range(len(x)):
  1110. ox.append(x[i])
  1111. oy.append(y[i])
  1112. x = np.linspace(6000, 9200, 500)
  1113. y = np.linspace(4050, 4400, 500)
  1114. for i in range(len(x)):
  1115. ox.append(x[i])
  1116. oy.append(y[i])
  1117. if park == '60' or park == '59':
  1118. x = np.linspace(0, 3000, 500)
  1119. y = np.linspace(5600, 5600, 500)
  1120. for i in range(len(x)):
  1121. ox.append(x[i])
  1122. oy.append(y[i])
  1123. for i in range(1000, 4500, 1):
  1124. ox.append(i)
  1125. oy.append(6500)
  1126. for i in range(6500, 7700, 1):
  1127. ox.append(1000)
  1128. oy.append(i)
  1129. x = np.linspace(3000, 4500, 500)
  1130. y = np.linspace(5600, 5000, 500)
  1131. for i in range(len(x)):
  1132. ox.append(x[i])
  1133. oy.append(y[i])
  1134. x = np.linspace(6000, 9200, 500)
  1135. y = np.linspace(5000, 4400, 500)
  1136. for i in range(len(x)):
  1137. ox.append(x[i])
  1138. oy.append(y[i])
  1139. x = np.linspace(6000, 7000, 500)
  1140. y = np.linspace(3100, 3100, 500)
  1141. for i in range(len(x)):
  1142. ox.append(x[i])
  1143. oy.append(y[i])
  1144. x = np.linspace(8500, 7500, 500)
  1145. y = np.linspace(3100, 4800, 500)
  1146. for i in range(len(x)):
  1147. ox.append(x[i])
  1148. oy.append(y[i])
  1149. if park == '58' or park == '57':
  1150. for i in range(0, 3000, 1):
  1151. ox.append(i)
  1152. oy.append(5600)
  1153. for i in range(1000, 4500, 1):
  1154. ox.append(i)
  1155. oy.append(6500)
  1156. for i in range(6500, 7700, 1):
  1157. ox.append(1000)
  1158. oy.append(i)
  1159. x = np.linspace(3000, 4500, 500)
  1160. y = np.linspace(5600, 5000, 500)
  1161. for i in range(len(x)):
  1162. ox.append(x[i])
  1163. oy.append(y[i])
  1164. x = np.linspace(6000, 9200, 500)
  1165. y = np.linspace(5000, 4400, 500)
  1166. for i in range(len(x)):
  1167. ox.append(x[i])
  1168. oy.append(y[i])
  1169. x = np.linspace(6000, 7000, 500)
  1170. y = np.linspace(4000, 3100, 500)
  1171. for i in range(len(x)):
  1172. ox.append(x[i])
  1173. oy.append(y[i])
  1174. if park == '56':
  1175. x = np.linspace(0, 3000, 500)
  1176. y = np.linspace(5600, 5600, 500)
  1177. for i in range(len(x)):
  1178. ox.append(x[i])
  1179. oy.append(y[i])
  1180. for i in range(1000, 4500, 1):
  1181. ox.append(i)
  1182. oy.append(6500)
  1183. for i in range(6500, 7700, 1):
  1184. ox.append(1000)
  1185. oy.append(i)
  1186. x = np.linspace(3000, 4500, 500)
  1187. y = np.linspace(5600, 5000, 500)
  1188. for i in range(len(x)):
  1189. ox.append(x[i])
  1190. oy.append(y[i])
  1191. x = np.linspace(6000, 9200, 500)
  1192. y = np.linspace(5000, 4100, 500)
  1193. for i in range(len(x)):
  1194. ox.append(x[i])
  1195. oy.append(y[i])
  1196. x = np.linspace(6000, 8500, 500)
  1197. y = np.linspace(4100, 3100, 500)
  1198. for i in range(len(x)):
  1199. ox.append(x[i])
  1200. oy.append(y[i])
  1201. C.XY_RESO = C.XY_RESO - 200
  1202. if park == '55':
  1203. for i in range(0, 3000, 1):
  1204. ox.append(i)
  1205. oy.append(5600)
  1206. for i in range(1000, 4500, 1):
  1207. ox.append(i)
  1208. oy.append(6500)
  1209. for i in range(6500, 7700, 1):
  1210. ox.append(1000)
  1211. oy.append(i)
  1212. x = np.linspace(3000, 4500, 500)
  1213. y = np.linspace(5600, 5000, 500)
  1214. for i in range(len(x)):
  1215. ox.append(x[i])
  1216. oy.append(y[i])
  1217. x = np.linspace(6000, 9200, 500)
  1218. y = np.linspace(5000, 4100, 500)
  1219. for i in range(len(x)):
  1220. ox.append(x[i])
  1221. oy.append(y[i])
  1222. x = np.linspace(6000, 8500, 500)
  1223. y = np.linspace(4100, 3100, 500)
  1224. for i in range(len(x)):
  1225. ox.append(x[i])
  1226. oy.append(y[i])
  1227. C.XY_RESO = C.XY_RESO - 300
  1228. if park == '54':
  1229. x = np.linspace(0, 3000, 500)
  1230. y = np.linspace(5750, 5750, 500)
  1231. for i in range(len(x)):
  1232. ox.append(x[i])
  1233. oy.append(y[i])
  1234. for i in range(1000, 4500, 1):
  1235. ox.append(i)
  1236. oy.append(6500)
  1237. for i in range(6500, 7700, 1):
  1238. ox.append(1000)
  1239. oy.append(i)
  1240. x = np.linspace(3000, 4500, 500)
  1241. y = np.linspace(5750, 5000, 500)
  1242. for i in range(len(x)):
  1243. ox.append(x[i])
  1244. oy.append(y[i])
  1245. x = np.linspace(6000, 9600, 500)
  1246. y = np.linspace(5000, 4050, 500)
  1247. for i in range(len(x)):
  1248. ox.append(x[i])
  1249. oy.append(y[i])
  1250. x = np.linspace(6000, 9200, 500)
  1251. y = np.linspace(4000, 3100, 500)
  1252. for i in range(len(x)):
  1253. ox.append(x[i])
  1254. oy.append(y[i])
  1255. x = np.linspace(4500, 4200, 500)
  1256. y = np.linspace(6000, 6500, 500)
  1257. for i in range(len(x)):
  1258. ox.append(x[i])
  1259. oy.append(y[i])
  1260. C.XY_RESO = C.XY_RESO - 400
  1261. if park == '53' or park == '52':
  1262. for i in range(0, 3000, 1):
  1263. ox.append(i)
  1264. oy.append(5600)
  1265. for i in range(1000, 4500, 1):
  1266. ox.append(i)
  1267. oy.append(6500)
  1268. for i in range(6500, 7700, 1):
  1269. ox.append(1000)
  1270. oy.append(i)
  1271. x = np.linspace(3000, 4500, 500)
  1272. y = np.linspace(5600, 5000, 500)
  1273. for i in range(len(x)):
  1274. ox.append(x[i])
  1275. oy.append(y[i])
  1276. x = np.linspace(6000, 9900, 500)
  1277. y = np.linspace(5000, 5000, 500)
  1278. for i in range(len(x)):
  1279. ox.append(x[i])
  1280. oy.append(y[i])
  1281. x = np.linspace(7500, 7500, 500)
  1282. y = np.linspace(3100, 6000, 500)
  1283. for i in range(len(x)):
  1284. ox.append(x[i])
  1285. oy.append(y[i])
  1286. # x = np.linspace(6000, 7500, 500)
  1287. # y = np.linspace(730, 730, 500)
  1288. # for i in range(len(x)):
  1289. # ox.append(x[i])
  1290. # oy.append(y[i])
  1291. x = np.linspace(7000, 7500, 500)
  1292. y = np.linspace(1700, 1700, 500)
  1293. for i in range(len(x)):
  1294. ox.append(x[i])
  1295. oy.append(y[i])
  1296. C.XY_RESO = C.XY_RESO-100
  1297. if park == '51' or park == '50' or park == '49'or park == '48'or park == '47':
  1298. for i in range(0, 3000, 1):
  1299. ox.append(i)
  1300. oy.append(5600)
  1301. for i in range(1000, 4500, 1):
  1302. ox.append(i)
  1303. oy.append(6500)
  1304. for i in range(6500, 7700, 1):
  1305. ox.append(1000)
  1306. oy.append(i)
  1307. x = np.linspace(3000, 4500, 500)
  1308. y = np.linspace(5600, 5000, 500)
  1309. for i in range(len(x)):
  1310. ox.append(x[i])
  1311. oy.append(y[i])
  1312. x = np.linspace(6000, 9100, 500)
  1313. y = np.linspace(5000, 5000, 500)
  1314. for i in range(len(x)):
  1315. ox.append(x[i])
  1316. oy.append(y[i])
  1317. # x = np.linspace(6000, 10500, 500)
  1318. # y = np.linspace(700, 700, 500)
  1319. # for i in range(len(x)):
  1320. # ox.append(x[i])
  1321. # oy.append(y[i])
  1322. x = np.linspace(7500, 7500, 500)
  1323. y = np.linspace(3100, 5000, 500)
  1324. for i in range(len(x)):
  1325. ox.append(x[i])
  1326. oy.append(y[i])
  1327. x = np.linspace(7000, 8000, 500)
  1328. y = np.linspace(3100, 3100, 500)
  1329. for i in range(len(x)):
  1330. ox.append(x[i])
  1331. oy.append(y[i])
  1332. C.XY_RESO = C.XY_RESO - 100
  1333. if park == '46' or park == '45':
  1334. for i in range(0, 2200, 1):
  1335. ox.append(i)
  1336. oy.append(5600)
  1337. for i in range(1000, 4500, 1):
  1338. ox.append(i)
  1339. oy.append(6500)
  1340. for i in range(6500, 7700, 1):
  1341. ox.append(1000)
  1342. oy.append(i)
  1343. x = np.linspace(2100, 4500, 500)
  1344. y = np.linspace(5600, 5000, 500)
  1345. for i in range(len(x)):
  1346. ox.append(x[i])
  1347. oy.append(y[i])
  1348. x = np.linspace(6000, 9100, 500)
  1349. y = np.linspace(5000, 5000, 500)
  1350. for i in range(len(x)):
  1351. ox.append(x[i])
  1352. oy.append(y[i])
  1353. if park == '44' or park == '43':
  1354. for i in range(0, 2200, 1):
  1355. ox.append(i)
  1356. oy.append(5600)
  1357. for i in range(1000, 4500, 1):
  1358. ox.append(i)
  1359. oy.append(6500)
  1360. for i in range(6500, 7700, 1):
  1361. ox.append(1000)
  1362. oy.append(i)
  1363. x = np.linspace(2100, 4500, 500)
  1364. y = np.linspace(5600, 5000, 500)
  1365. for i in range(len(x)):
  1366. ox.append(x[i])
  1367. oy.append(y[i])
  1368. x = np.linspace(7000, 10500, 500)
  1369. y = np.linspace(3100, 3100, 500)
  1370. for i in range(len(x)):
  1371. ox.append(x[i])
  1372. oy.append(y[i])
  1373. x = np.linspace(6000, 10500, 500)
  1374. y = np.linspace(5000, 5000, 500)
  1375. for i in range(len(x)):
  1376. ox.append(x[i])
  1377. oy.append(y[i])
  1378. x = np.linspace(8500, 8500, 500)
  1379. y = np.linspace(3100, 6000, 500)
  1380. for i in range(len(x)):
  1381. ox.append(x[i])
  1382. oy.append(y[i])
  1383. if park == '42':
  1384. for i in range(0, 2200, 1):
  1385. ox.append(i)
  1386. oy.append(5600)
  1387. for i in range(1000, 4500, 1):
  1388. ox.append(i)
  1389. oy.append(6500)
  1390. for i in range(6500, 7700, 1):
  1391. ox.append(1000)
  1392. oy.append(i)
  1393. x = np.linspace(2100, 4500, 500)
  1394. y = np.linspace(5600, 5000, 500)
  1395. for i in range(len(x)):
  1396. ox.append(x[i])
  1397. oy.append(y[i])
  1398. x = np.linspace(7000, 10500, 500)
  1399. y = np.linspace(3100, 3100, 500)
  1400. for i in range(len(x)):
  1401. ox.append(x[i])
  1402. oy.append(y[i])
  1403. x = np.linspace(6000, 8000, 500)
  1404. y = np.linspace(5000, 5000, 500)
  1405. for i in range(len(x)):
  1406. ox.append(x[i])
  1407. oy.append(y[i])
  1408. x = np.linspace(6900, 6900, 500)
  1409. y = np.linspace(3100, 6000, 500)
  1410. for i in range(len(x)):
  1411. ox.append(x[i])
  1412. oy.append(y[i])
  1413. x = np.linspace(6950, 6950, 500)
  1414. y = np.linspace(1700, 2700, 500)
  1415. for i in range(len(x)):
  1416. ox.append(x[i])
  1417. oy.append(y[i])
  1418. C.XY_RESO = C.XY_RESO - 100
  1419. if park == '41':
  1420. for i in range(0, 2200, 1):
  1421. ox.append(i)
  1422. oy.append(5600)
  1423. for i in range(1000, 4500, 1):
  1424. ox.append(i)
  1425. oy.append(6500)
  1426. for i in range(6500, 7700, 1):
  1427. ox.append(1000)
  1428. oy.append(i)
  1429. x = np.linspace(2100, 4500, 500)
  1430. y = np.linspace(5600, 5000, 500)
  1431. for i in range(len(x)):
  1432. ox.append(x[i])
  1433. oy.append(y[i])
  1434. x = np.linspace(7000, 10500, 500)
  1435. y = np.linspace(3100, 3100, 500)
  1436. for i in range(len(x)):
  1437. ox.append(x[i])
  1438. oy.append(y[i])
  1439. x = np.linspace(6000, 8000, 500)
  1440. y = np.linspace(5000, 5000, 500)
  1441. for i in range(len(x)):
  1442. ox.append(x[i])
  1443. oy.append(y[i])
  1444. x = np.linspace(6900, 6900, 500)
  1445. y = np.linspace(3100, 6000, 500)
  1446. for i in range(len(x)):
  1447. ox.append(x[i])
  1448. oy.append(y[i])
  1449. x = np.linspace(7000, 8000, 500)
  1450. y = np.linspace(750, 750, 500)
  1451. for i in range(len(x)):
  1452. ox.append(x[i])
  1453. oy.append(y[i])
  1454. C.XY_RESO = C.XY_RESO - 100
  1455. if park == '40':
  1456. for i in range(0, 2200, 1):
  1457. ox.append(i)
  1458. oy.append(5600)
  1459. for i in range(1000, 4500, 1):
  1460. ox.append(i)
  1461. oy.append(6500)
  1462. for i in range(6500, 7700, 1):
  1463. ox.append(1000)
  1464. oy.append(i)
  1465. x = np.linspace(2100, 4500, 500)
  1466. y = np.linspace(5600, 5000, 500)
  1467. for i in range(len(x)):
  1468. ox.append(x[i])
  1469. oy.append(y[i])
  1470. x = np.linspace(7000, 10500, 500)
  1471. y = np.linspace(3100, 3100, 500)
  1472. for i in range(len(x)):
  1473. ox.append(x[i])
  1474. oy.append(y[i])
  1475. x = np.linspace(6000, 8000, 500)
  1476. y = np.linspace(5000, 5000, 500)
  1477. for i in range(len(x)):
  1478. ox.append(x[i])
  1479. oy.append(y[i])
  1480. x = np.linspace(6900, 6900, 500)
  1481. y = np.linspace(3100, 6000, 500)
  1482. for i in range(len(x)):
  1483. ox.append(x[i])
  1484. oy.append(y[i])
  1485. C.XY_RESO = C.XY_RESO - 100
  1486. if park == '39':
  1487. for i in range(0, 2200, 1):
  1488. ox.append(i)
  1489. oy.append(5700)
  1490. for i in range(1000, 4500, 1):
  1491. ox.append(i)
  1492. oy.append(6500)
  1493. for i in range(6500, 7700, 1):
  1494. ox.append(1000)
  1495. oy.append(i)
  1496. x = np.linspace(2100, 4500, 500)
  1497. y = np.linspace(5700, 5000, 500)
  1498. for i in range(len(x)):
  1499. ox.append(x[i])
  1500. oy.append(y[i])
  1501. x = np.linspace(7000, 10500, 500)
  1502. y = np.linspace(3100, 3100, 500)
  1503. for i in range(len(x)):
  1504. ox.append(x[i])
  1505. oy.append(y[i])
  1506. x = np.linspace(6000, 8000, 500)
  1507. y = np.linspace(5700, 5700, 500)
  1508. for i in range(len(x)):
  1509. ox.append(x[i])
  1510. oy.append(y[i])
  1511. x = np.linspace(7000, 7000, 500)
  1512. y = np.linspace(3100, 6000, 500)
  1513. for i in range(len(x)):
  1514. ox.append(x[i])
  1515. oy.append(y[i])
  1516. x = np.linspace(7000, 9000, 500)
  1517. y = np.linspace(1700, 1700, 500)
  1518. for i in range(len(x)):
  1519. ox.append(x[i])
  1520. oy.append(y[i])
  1521. x = np.linspace(6000, 8500, 500)
  1522. y = np.linspace(5000, 5000, 500)
  1523. for i in range(len(x)):
  1524. ox.append(x[i])
  1525. oy.append(y[i])
  1526. x = np.linspace(6950, 6950, 500)
  1527. y = np.linspace(1600, 3700, 500)
  1528. for i in range(len(x)):
  1529. ox.append(x[i])
  1530. oy.append(y[i])
  1531. x = np.linspace(6000, 8500, 500)
  1532. y = np.linspace(780, 780, 500)
  1533. for i in range(len(x)):
  1534. ox.append(x[i])
  1535. oy.append(y[i])
  1536. x = np.linspace(6000, 6500, 500)
  1537. y = np.linspace(1200, 750, 500)
  1538. for i in range(len(x)):
  1539. ox.append(x[i])
  1540. oy.append(y[i])
  1541. x = np.linspace(4500, 4000, 500)
  1542. y = np.linspace(6000, 6500, 500)
  1543. for i in range(len(x)):
  1544. ox.append(x[i])
  1545. oy.append(y[i])
  1546. C.XY_RESO = C.XY_RESO - 300
  1547. if park == '38':
  1548. for i in range(0, 2200, 1):
  1549. ox.append(i)
  1550. oy.append(5700)
  1551. for i in range(1000, 4500, 1):
  1552. ox.append(i)
  1553. oy.append(6500)
  1554. for i in range(6500, 7700, 1):
  1555. ox.append(1000)
  1556. oy.append(i)
  1557. x = np.linspace(2200, 4500, 500)
  1558. y = np.linspace(5700, 5000, 500)
  1559. for i in range(len(x)):
  1560. ox.append(x[i])
  1561. oy.append(y[i])
  1562. x = np.linspace(7000, 10500, 500)
  1563. y = np.linspace(3100, 3100, 500)
  1564. for i in range(len(x)):
  1565. ox.append(x[i])
  1566. oy.append(y[i])
  1567. x = np.linspace(6000, 8000, 500)
  1568. y = np.linspace(5700, 5700, 500)
  1569. for i in range(len(x)):
  1570. ox.append(x[i])
  1571. oy.append(y[i])
  1572. x = np.linspace(7000, 7000, 500)
  1573. y = np.linspace(3100, 6000, 500)
  1574. for i in range(len(x)):
  1575. ox.append(x[i])
  1576. oy.append(y[i])
  1577. x = np.linspace(7000, 9500, 500)
  1578. y = np.linspace(1700, 1700, 500)
  1579. for i in range(len(x)):
  1580. ox.append(x[i])
  1581. oy.append(y[i])
  1582. x = np.linspace(6000, 8500, 500)
  1583. y = np.linspace(5000, 5000, 500)
  1584. for i in range(len(x)):
  1585. ox.append(x[i])
  1586. oy.append(y[i])
  1587. x = np.linspace(6950, 6950, 500)
  1588. y = np.linspace(1600, 3700, 500)
  1589. for i in range(len(x)):
  1590. ox.append(x[i])
  1591. oy.append(y[i])
  1592. x = np.linspace(6000, 9500, 500)
  1593. y = np.linspace(780, 780, 500)
  1594. for i in range(len(x)):
  1595. ox.append(x[i])
  1596. oy.append(y[i])
  1597. x = np.linspace(6000, 6500, 500)
  1598. y = np.linspace(1200, 750, 500)
  1599. for i in range(len(x)):
  1600. ox.append(x[i])
  1601. oy.append(y[i])
  1602. x = np.linspace(4500, 4100, 500)
  1603. y = np.linspace(6000, 6500, 500)
  1604. for i in range(len(x)):
  1605. ox.append(x[i])
  1606. oy.append(y[i])
  1607. C.XY_RESO = C.XY_RESO - 400
  1608. if park == '37'or park == '36' or park == '35' or park == '34':
  1609. for i in range(0, 2200, 1):
  1610. ox.append(i)
  1611. oy.append(5600)
  1612. for i in range(1000, 4500, 1):
  1613. ox.append(i)
  1614. oy.append(6500)
  1615. for i in range(6500, 7700, 1):
  1616. ox.append(1000)
  1617. oy.append(i)
  1618. x = np.linspace(2100, 4500, 500)
  1619. y = np.linspace(5600, 5000, 500)
  1620. for i in range(len(x)):
  1621. ox.append(x[i])
  1622. oy.append(y[i])
  1623. x = np.linspace(6000, 9200, 500)
  1624. y = np.linspace(4000, 4400, 500)
  1625. for i in range(len(x)):
  1626. ox.append(x[i])
  1627. oy.append(y[i])
  1628. if park == '33':
  1629. for i in range(0, 2200, 1):
  1630. ox.append(i)
  1631. oy.append(5600)
  1632. for i in range(1000, 4500, 1):
  1633. ox.append(i)
  1634. oy.append(6500)
  1635. for i in range(6500, 7700, 1):
  1636. ox.append(1000)
  1637. oy.append(i)
  1638. x = np.linspace(2100, 4500, 500)
  1639. y = np.linspace(5600, 5000, 500)
  1640. for i in range(len(x)):
  1641. ox.append(x[i])
  1642. oy.append(y[i])
  1643. x = np.linspace(6000, 9900, 500)
  1644. y = np.linspace(4000, 5200, 500)
  1645. for i in range(len(x)):
  1646. ox.append(x[i])
  1647. oy.append(y[i])
  1648. x = np.linspace(8800, 8800, 500)
  1649. y = np.linspace(6700, 4000, 500)
  1650. for i in range(len(x)):
  1651. ox.append(x[i])
  1652. oy.append(y[i])
  1653. if park == '23' or park == '22' or park == '21':
  1654. x = np.linspace(4500, 4500, 500)
  1655. y = np.linspace(6000, 5000, 500)
  1656. for i in range(len(x)):
  1657. ox.append(x[i])
  1658. oy.append(y[i])
  1659. x = np.linspace(0, 2100, 500)
  1660. y = np.linspace(5700, 5700, 500)
  1661. for i in range(len(x)):
  1662. ox.append(x[i])
  1663. oy.append(y[i])
  1664. x = np.linspace(0, 1000, 500)
  1665. y = np.linspace(3000, 3000, 500)
  1666. for i in range(len(x)):
  1667. ox.append(x[i])
  1668. oy.append(y[i])
  1669. x = np.linspace(3500, 3500, 500)
  1670. y = np.linspace(3100, 7000, 500)
  1671. for i in range(len(x)):
  1672. ox.append(x[i])
  1673. oy.append(y[i])
  1674. x = np.linspace(0, 2100, 500)
  1675. y = np.linspace(4000, 4000, 500)
  1676. for i in range(len(x)):
  1677. ox.append(x[i])
  1678. oy.append(y[i])
  1679. x = np.linspace(2100, 2100, 100)
  1680. y = np.linspace(4600, 5100, 100)
  1681. for i in range(len(x)):
  1682. ox.append(x[i])
  1683. oy.append(y[i])
  1684. x = np.linspace(1000, 4000, 500)
  1685. y = np.linspace(6600, 6600, 500)
  1686. for i in range(len(x)):
  1687. ox.append(x[i])
  1688. oy.append(y[i])
  1689. x = np.linspace(1000, 1000, 100)
  1690. y = np.linspace(7700, 6600, 100)
  1691. for i in range(len(x)):
  1692. ox.append(x[i])
  1693. oy.append(y[i])
  1694. x = np.linspace(2500, 3500, 100)
  1695. y = np.linspace(3100, 3100, 100)
  1696. for i in range(len(x)):
  1697. ox.append(x[i])
  1698. oy.append(y[i])
  1699. C.XY_RESO = C.XY_RESO - 100
  1700. return ox,oy,isSearchFailed
  1701. def main():
  1702. in_path="./input/"
  1703. # 遍历input文件夹下所有文件
  1704. start = time.time()
  1705. for root,dirs,files in os.walk(in_path):
  1706. for file in files:
  1707. if "json" in file: # 找到.json文件
  1708. t1 = time.time()
  1709. map_path = in_path+file
  1710. # mdp.map_display(map_path) # 仅绘制地图
  1711. ori_ox, ori_oy,sp,gp = mp.make_map(in_path+file) #获取地图信息(障碍物,起点,车位)
  1712. sx, sy, syaw0 = sp['x'], sp['y'], sp['yaw']# 获取起点的信息
  1713. C = make_car.C # 获取车辆的属性信息
  1714. isSearchFailed = False
  1715. # 遍历所有车位
  1716. for i in range(1,len(gp)+1):
  1717. # print(f"parking:{str(i)}")
  1718. # 获取该车位的信息
  1719. gx, gy, gyaw0 = gp[str(i)]['x_end'], gp[str(i)]['y_end'], gp[str(i)]['yaw']
  1720. if file == "B01.json":
  1721. # continue
  1722. add_ox,add_oy,isSearchFailed = changeOxyB01(C,str(i),ori_ox, ori_oy)
  1723. # continue
  1724. elif file == "B02.json":
  1725. # continue
  1726. add_ox,add_oy,isSearchFailed = changeOxyB02(C,str(i),ori_ox, ori_oy)
  1727. elif file == "B03.json":
  1728. add_ox,add_oy,isSearchFailed = changeOxyB03(C,str(i),ori_ox, ori_oy)
  1729. # 请在此调用planer文件夹下的规控算法
  1730. if isSearchFailed:
  1731. print(f"Searching failed! parking:{str(i)}")
  1732. with open(f"./output/result_{str(file).split('.json')[0]}_{str(i)}.json", "w") as file1:
  1733. json.dump({}, file1)
  1734. isSearchFailed = False
  1735. continue
  1736. try:
  1737. path = planner.hybrid_astar_planning(sx, sy, syaw0, gx, gy, gyaw0, add_ox, add_oy, C.XY_RESO, C.YAW_RESO)
  1738. C.XY_RESO = 1000
  1739. except:
  1740. continue
  1741. # 算法测试结果保存
  1742. # print(C.XY_RESO)
  1743. if not path:
  1744. print("Searching failed!")
  1745. continue
  1746. output_dit={
  1747. "parking":str(i),
  1748. "output_x": path.x,
  1749. "output_y": path.y,
  1750. "output_yaw": path.yaw,
  1751. "output_dir": path.direction,
  1752. }
  1753. with open(f"./output/result_{str(file).split('.json')[0]}_{str(i)}.json", "w") as file1:
  1754. json.dump(output_dit, file1)
  1755. print(f"output/result_{str(file).split('.json')[0]}_{str(i)}.json saved!")
  1756. # 仿真回放
  1757. # result_path = f"./Onsite_Parking/output/result_{map_path.split('/')[-1].split('.json')[0]}_{str(i)}.json"
  1758. # replay.replay(map_path, result_path)
  1759. t2 = time.time()
  1760. print(f"Time in map {file}: {t2-t1}")
  1761. end = time.time()
  1762. print("Time:", end-start)
  1763. if __name__ == '__main__':
  1764. main()