动态规划路线指不依赖现有路径,根据一定的起点动态生成遍历路线。
一般动态规划会分几步
- 以固定的几个出生点(Location)\ 或者通过Gruop/Group+Name的方式获得(searchroom) 起始房间
- 通过dilate膨胀算法,配合指令的黑白名单设置,计算出 npc的 RandomMove 可能出现的房间
- 就近到达最近的的一个房间
- 以当前房间为起点,通过模拟移动接口(querypathall) 获得遍历路径,开始遍历
local hmmlib=require('hmm')
local hmm=hmmlib.new()
hmm.DllEncoding=0 --0 for utf-8, 1 for gbk
local json=require('json')
local file=assert(io.open("hongchen.hmm","r"))
local data=file:read("*a")
file:close();
hmm:call("import",data)
local blacklist={"ask ","yell ","cross","jump ","enter "}
local current="3431"
local search=hmmlib.SearchRooms.new()
search.Filter.HasAnyGroup={"扬州城"}
-- 获取所有属于扬州的房间名
local yzrooms={}
local searchresult=json.decode(hmm:call("searchrooms",json.encode(search)))
for _,room in ipairs(searchresult) do
table.insert(yzrooms, room.Key)
end
local dilate=hmmlib.Dilate.new()
dilate.Source=yzrooms
-- 膨胀3步
dilate.Iterations=3
dilate.Options=hmmlib.MapperOptions.new()
dilate.Options.CommandNotContains=blacklist
local rooms=json.decode(hmm:call("dilate",json.encode(dilate)))
print(json.encode(rooms))
local query=hmmlib.QueryPathAny.new()
query.From={current}
query.Target=rooms
-- 获取前往遍历区域的路线
local result=json.decode(hmm:call("querypathany",json.encode(query)))
print(json.encode(result))
-- 获取遍历路线
local allquery=hmmlib.QueryPath.new()
allquery.Start=result["To"]
allquery.Target=rooms
local allresult=json.decode(hmm:call("querypathall",json.encode(allquery)))
print(json.encode(allresult))
import json
import hmmpy
blacklist=["ask ","yell ","cross","jump ","enter "]
current="3431"
hmm = hmmpy.HMMDll("./HellMapManager.so")
with open('hongchen.hmm', 'r', encoding='utf-8') as f:
hmm.call("import",f.read())
search=hmmpy.SearchRooms()
search.Filter.HasAnyGroup=["扬州城"]
## 获取所有属于扬州的房间名
yzrooms=list(map(lambda r:r.get("Key"),json.loads(hmm.call("searchrooms",hmm.encode(search)))))
dilate=hmmpy.Dilate()
dilate.Source=yzrooms
## 膨胀3步
dilate.Iterations=3
dilate.Options=hmmpy.MapperOptions()
dilate.Options.CommandNotContains=blacklist
rooms=json.loads(hmm.call("dilate",hmm.encode(dilate)))
print(rooms)
query=hmmpy.QueryPathAny()
query.From=[current]
query.Target=rooms
## 获取前往遍历区域的路线
result=json.loads(hmm.call("querypathany",hmm.encode(query)))
print(result)
## 获取遍历路线
allquery=hmmpy.QueryPath()
allquery.Start=result["To"]
allquery.Target=rooms
allresult=json.loads(hmm.call("querypathall",hmm.encode(allquery)))
print(allresult)['2439', '2440', '2441', '2442', '2444', '2445', '2446', '2447', '2448', '2449', '2450', '2452', '2453', '2456', '2457', '2458', '2459', '2460', '2461', '2462', '2463', '2464', '2465', '2466', '2467', '2468', '2469', '2470', '2471', '2472', '2473', '2474', '2477', '2478', '2479', '2480', '2482', '2483', '2484', '2485', '2494', '2495', '2496', '2497', '2498', '2499', '2500', '2501', '2502', '2503', '2504', '2505', '2506', '2508', '2509', '2510', '2511', '2512', '2513', '2514', '2515', '2516', '2517', '2518', '2519', '2520', '2521', '2522', '2523', '2528', '2529', '2530', '2531', '2539', '2540', '2542', '2544', '2545', '2546', '2547', '4180', '4181', '4183', '4184', '4185', '4186', '4187', '4188', '4195', '4196', '4197', '4198', '4230', '1787', '3981', '4033', '4179', '3652', '1859', '4176', '2475', '2601', '2298', '4142', '1137', '3904', '494', '1049', '2724', '3432', '3726', '3166', '1600', '541', '2924', '3769', '2541', '4182', '4999', '1788', '3982', '4034', '3654', '1860', '2476', '2401', '2610', '1967', '1459', '2915', '2292', '690', '4140', '1302', '1106', '325', '3893', '551', '4141', '1043', '2696', '3436', '3611', '415', '2829', '3704', '374', '1814', '3095', '1602', '556', '2925', '3768', '2451', '2532', '2507', '4998', '1821', '3983', '4035', '4151', '3651', '3653', '1863', '1861', '2398', '974', '2590', '2564', '1876', '1456', '2902', '2325', '2293', '686', '4154', '2734', '4157', '4137', '1309', '1105', '1113', '1130', '351', '3906', '3894', '520', '552', '4164', '1018', '1044', '2738', '2697', '3500', '3603', '396', '2817', '3705', '3798', '3729', '355', '1810', '3173', '3096', '1866', '1603', '480', '2926', '3767', '4997', '4996']
{'From': '3431', 'To': '3500', 'Cost': 4, 'Steps': [{'Command': 's', 'Target': '3430', 'Cost': 1}, {'Command': 'w', 'Target': '3404', 'Cost': 1}, {'Command': 'w', 'Target': '3501', 'Cost': 1}, {'Command': 'w', 'Target': '3500', 'Cost': 1}], 'Unvisited': ['2439', '2440', '2441', '2442', '2444', '2445', '2446', '2447', '2448', '2449', '2450', '2452', '2453', '2456', '2457', '2458', '2459', '2460', '2461', '2462', '2463', '2464', '2465', '2466', '2467', '2468', '2469', '2470', '2471', '2472', '2473', '2474', '2477', '2478', '2479', '2480', '2482', '2483', '2484', '2485', '2494', '2495', '2496', '2497', '2498', '2499', '2500', '2501', '2502', '2503', '2504', '2505', '2506', '2508', '2509', '2510', '2511', '2512', '2513', '2514', '2515', '2516', '2517', '2518', '2519', '2520', '2521', '2522', '2523', '2528', '2529', '2530', '2531', '2539', '2540', '2542', '2544', '2545', '2546', '2547', '4180', '4181', '4183', '4184', '4185', '4186', '4187', '4188', '4195', '4196', '4197', '4198', '4230', '1787', '3981', '4033', '4179', '3652', '1859', '4176', '2475', '2601', '2298', '4142', '1137', '3904', '494', '1049', '2724', '3432', '3726', '3166', '1600', '541', '2924', '3769', '2541', '4182', '4999', '1788', '3982', '4034', '3654', '1860', '2476', '2401', '2610', '1967', '1459', '2915', '2292', '690', '4140', '1302', '1106', '325', '3893', '551', '4141', '1043', '2696', '3436', '3611', '415', '2829', '3704', '374', '1814', '3095', '1602', '556', '2925', '3768', '2451', '2532', '2507', '4998', '1821', '3983', '4035', '4151', '3651', '3653', '1863', '1861', '2398', '974', '2590', '2564', '1876', '1456', '2902', '2325', '2293', '686', '4154', '2734', '4157', '4137', '1309', '1105', '1113', '1130', '351', '3906', '3894', '520', '552', '4164', '1018', '1044', '2738', '2697', '3603', '396', '2817', '3705', '3798', '3729', '355', '1810', '3173', '3096', '1866', '1603', '480', '2926', '3767', '4997', '4996']}
{'From': '3500', 'To': '1876', 'Cost': 780, 'Steps': [{'Command': 'w', 'Target': '3436', 'Cost': 1}, {'Command': 'w', 'Target': '3432', 'Cost': 1}, {'Command': 'goto xiangyang', 'Target': '2601', 'Cost': 20}, {'Command': 's', 'Target': '2610', 'Cost': 1}, {'Command': 'e', 'Target': '2590', 'Cost': 1}, {'Command': 'w', 'Target': '2610', 'Cost': 1}, {'Command': 'w', 'Target': '2564', 'Cost': 1}, {'Command': 'e', 'Target': '2610', 'Cost': 1}, {'Command': 'e', 'Target': '2590', 'Cost': 1}, {'Command': 's', 'Target': '2572', 'Cost': 1}, {'Command': 's', 'Target': '2571', 'Cost': 1}, {'Command': 's', 'Target': '2569', 'Cost': 1}, {'Command': 'w', 'Target': '2568', 'Cost': 1}, {'Command': 'w', 'Target': '2575', 'Cost': 1}, {'Command': 's', 'Target': '2617', 'Cost': 1}, {'Command': 's', 'Target': '2618', 'Cost': 1}, {'Command': 's', 'Target': '2619', 'Cost': 1}, {'Command': 's', 'Target': '2615', 'Cost': 1}, {'Command': 's', 'Target': '2616', 'Cost': 1}, {'Command': 's', 'Target': '2560', 'Cost': 1}, {'Command': 's', 'Target': '1605', 'Cost': 1}, {'Command': 'e', 'Target': '1604', 'Cost': 1}, {'Command': 'n', 'Target': '1603', 'Cost': 1}, {'Command': 'n', 'Target': '1602', 'Cost': 1}, {'Command': 'se', 'Target': '1866', 'Cost': 1}, {'Command': 'e', 'Target': '1865', 'Cost': 1}, {'Command': 'ne', 'Target': '1863', 'Cost': 1}, {'Command': 'e', 'Target': '1860', 'Cost': 1}, {'Command': 'nw', 'Target': '1859', 'Cost': 1}, {'Command': 'nw', 'Target': '2468', 'Cost': 1}, {'Command': 'w', 'Target': '2469', 'Cost': 1}, {'Command': 'w', 'Target': '2470', 'Cost': 1}, {'Command': 'w', 'Target': '2471', 'Cost': 1}, {'Command': 'w', 'Target': '2506', 'Cost': 1}, {'Command': 'w', 'Target': '2472', 'Cost': 1}, {'Command': 'w', 'Target': '2473', 'Cost': 1}, {'Command': 'w', 'Target': '2462', 'Cost': 1}, {'Command': 'w', 'Target': '2463', 'Cost': 1}, {'Command': 'n', 'Target': '2465', 'Cost': 1}, {'Command': 'e', 'Target': '2464', 'Cost': 1}, {'Command': 's', 'Target': '2462', 'Cost': 1}, {'Command': 'e', 'Target': '2473', 'Cost': 1}, {'Command': 'e', 'Target': '2472', 'Cost': 1}, {'Command': 'e', 'Target': '2506', 'Cost': 1}, {'Command': 's', 'Target': '1600', 'Cost': 1}, {'Command': 'n', 'Target': '2506', 'Cost': 1}, {'Command': 'n', 'Target': '2505', 'Cost': 1}, {'Command': 'e', 'Target': '2479', 'Cost': 1}, {'Command': 'u', 'Target': '2480', 'Cost': 1}, {'Command': 'd', 'Target': '2479', 'Cost': 1}, {'Command': 'w', 'Target': '2505', 'Cost': 1}, {'Command': 'w', 'Target': '2444', 'Cost': 1}, {'Command': 'e', 'Target': '2505', 'Cost': 1}, {'Command': 'n', 'Target': '2504', 'Cost': 1}, {'Command': 'e', 'Target': '2445', 'Cost': 1}, {'Command': 'w', 'Target': '2504', 'Cost': 1}, {'Command': 'w', 'Target': '2452', 'Cost': 1}, {'Command': 'enter', 'Target': '4179', 'Cost': 1}, {'Command': 'out', 'Target': '2452', 'Cost': 1}, {'Command': 'u', 'Target': '2453', 'Cost': 1}, {'Command': 's', 'Target': '2514', 'Cost': 1}, {'Command': 'n', 'Target': '2453', 'Cost': 1}, {'Command': 'e', 'Target': '2456', 'Cost': 1}, {'Command': 'w', 'Target': '2453', 'Cost': 1}, {'Command': 'w', 'Target': '2516', 'Cost': 1}, {'Command': 'e', 'Target': '2453', 'Cost': 1}, {'Command': 'n', 'Target': '2508', 'Cost': 1}, {'Command': 's', 'Target': '2453', 'Cost': 1}, {'Command': 'd', 'Target': '2452', 'Cost': 1}, {'Command': 'w', 'Target': '2447', 'Cost': 1}, {'Command': 'e', 'Target': '2452', 'Cost': 1}, {'Command': 'n', 'Target': '2442', 'Cost': 1}, {'Command': 's', 'Target': '2452', 'Cost': 1}, {'Command': 'e', 'Target': '2504', 'Cost': 1}, {'Command': 'n', 'Target': '2460', 'Cost': 1}, {'Command': 'climb tree', 'Target': '2515', 'Cost': 1}, {'Command': 'd', 'Target': '2460', 'Cost': 1}, {'Command': 'e', 'Target': '2448', 'Cost': 1}, {'Command': 'e', 'Target': '2449', 'Cost': 1}, {'Command': 'e', 'Target': '2450', 'Cost': 1}, {'Command': 'e', 'Target': '4033', 'Cost': 1}, {'Command': 'e', 'Target': '4034', 'Cost': 1}, {'Command': 'ne', 'Target': '4035', 'Cost': 1}, {'Command': 'sw', 'Target': '4034', 'Cost': 1}, {'Command': 'se', 'Target': '4151', 'Cost': 1}, {'Command': 's', 'Target': '4152', 'Cost': 1}, {'Command': 'e', 'Target': '4137', 'Cost': 1}, {'Command': 's', 'Target': '4140', 'Cost': 1}, {'Command': 's', 'Target': '4154', 'Cost': 1}, {'Command': 'n', 'Target': '4140', 'Cost': 1}, {'Command': 'se', 'Target': '2734', 'Cost': 1}, {'Command': 'nw', 'Target': '4140', 'Cost': 1}, {'Command': 'e', 'Target': '4157', 'Cost': 1}, {'Command': 'w', 'Target': '4140', 'Cost': 1}, {'Command': 'sw', 'Target': '4142', 'Cost': 1}, {'Command': 'ne', 'Target': '4140', 'Cost': 1}, {'Command': 'n', 'Target': '4137', 'Cost': 1}, {'Command': 'w', 'Target': '4152', 'Cost': 1}, {'Command': 'n', 'Target': '4151', 'Cost': 1}, {'Command': 'nw', 'Target': '4034', 'Cost': 1}, {'Command': 'w', 'Target': '4033', 'Cost': 1}, {'Command': 'w', 'Target': '2450', 'Cost': 1}, {'Command': 's', 'Target': '2461', 'Cost': 1}, {'Command': 's', 'Target': '2466', 'Cost': 1}, {'Command': 's', 'Target': '2467', 'Cost': 1}, {'Command': 's', 'Target': '2468', 'Cost': 1}, {'Command': 'se', 'Target': '1859', 'Cost': 1}, {'Command': 'se', 'Target': '1860', 'Cost': 1}, {'Command': 'se', 'Target': '1861', 'Cost': 1}, {'Command': 'e', 'Target': '1862', 'Cost': 1}, {'Command': 's', 'Target': '1855', 'Cost': 1}, {'Command': 'ne', 'Target': '1856', 'Cost': 1}, {'Command': 'se', 'Target': '1055', 'Cost': 1}, {'Command': 's', 'Target': '1020', 'Cost': 1}, {'Command': 's', 'Target': '1019', 'Cost': 1}, {'Command': 's', 'Target': '1018', 'Cost': 1}, {'Command': 'e', 'Target': '1043', 'Cost': 1}, {'Command': 'e', 'Target': '1049', 'Cost': 1}, {'Command': 'w', 'Target': '1043', 'Cost': 1}, {'Command': 'u*', 'Target': '1044', 'Cost': 1}, {'Command': 'd', 'Target': '1043', 'Cost': 1}, {'Command': 'w', 'Target': '1018', 'Cost': 1}, {'Command': 's', 'Target': '1022', 'Cost': 1}, {'Command': 's', 'Target': '1086', 'Cost': 1}, {'Command': 'e', 'Target': '1027', 'Cost': 1}, {'Command': 'e', 'Target': '1028', 'Cost': 1}, {'Command': 'e', 'Target': '1029', 'Cost': 1}, {'Command': 'e', 'Target': '4152', 'Cost': 1}, {'Command': 'n', 'Target': '4151', 'Cost': 1}, {'Command': 'nw', 'Target': '4034', 'Cost': 1}, {'Command': 'w', 'Target': '4033', 'Cost': 1}, {'Command': 'w', 'Target': '2450', 'Cost': 1}, {'Command': 'n', 'Target': '2496', 'Cost': 1}, {'Command': 'e', 'Target': '2497', 'Cost': 1}, {'Command': 'n', 'Target': '2498', 'Cost': 1}, {'Command': 'w', 'Target': '2499', 'Cost': 1}, {'Command': 'n', 'Target': '2500', 'Cost': 1}, {'Command': 'e', 'Target': '2501', 'Cost': 1}, {'Command': 'w', 'Target': '2502', 'Cost': 1}, {'Command': 'n', 'Target': '2509', 'Cost': 1}, {'Command': 'enter*', 'Target': '2459', 'Cost': 1}, {'Command': 'out', 'Target': '2509', 'Cost': 1}, {'Command': 's', 'Target': '2499', 'Cost': 1}, {'Command': 's', 'Target': '2450', 'Cost': 1}, {'Command': 'w', 'Target': '2449', 'Cost': 1}, {'Command': 's', 'Target': '2446', 'Cost': 1}, {'Command': 'n', 'Target': '2449', 'Cost': 1}, {'Command': 'n', 'Target': '2540', 'Cost': 1}, {'Command': 's', 'Target': '2449', 'Cost': 1}, {'Command': 'w', 'Target': '2448', 'Cost': 1}, {'Command': 's', 'Target': '2542', 'Cost': 1}, {'Command': 'u', 'Target': '2458', 'Cost': 1}, {'Command': 'd', 'Target': '2542', 'Cost': 1}, {'Command': 'n', 'Target': '2448', 'Cost': 1}, {'Command': 'n', 'Target': '2512', 'Cost': 1}, {'Command': 'u', 'Target': '2513', 'Cost': 1}, {'Command': 'u', 'Target': '4183', 'Cost': 1}, {'Command': 'u', 'Target': '4184', 'Cost': 1}, {'Command': 'u', 'Target': '4185', 'Cost': 1}, {'Command': 'u', 'Target': '4186', 'Cost': 1}, {'Command': 'u', 'Target': '4187', 'Cost': 1}, {'Command': 'u', 'Target': '4188', 'Cost': 1}, {'Command': 'd', 'Target': '4187', 'Cost': 1}, {'Command': 'd', 'Target': '4186', 'Cost': 1}, {'Command': 'd', 'Target': '4185', 'Cost': 1}, {'Command': 'd', 'Target': '4184', 'Cost': 1}, {'Command': 'd', 'Target': '4183', 'Cost': 1}, {'Command': 'd', 'Target': '2513', 'Cost': 1}, {'Command': 'd', 'Target': '2512', 'Cost': 1}, {'Command': 's', 'Target': '2448', 'Cost': 1}, {'Command': 'w', 'Target': '2460', 'Cost': 1}, {'Command': 'enter dong', 'Target': '3652', 'Cost': 1}, {'Command': 'd', 'Target': '3654', 'Cost': 1}, {'Command': 'e', 'Target': '3651', 'Cost': 1}, {'Command': 'w', 'Target': '3654', 'Cost': 1}, {'Command': 'w', 'Target': '3653', 'Cost': 1}, {'Command': 'e', 'Target': '3654', 'Cost': 1}, {'Command': 'u', 'Target': '3652', 'Cost': 1}, {'Command': 'out', 'Target': '2460', 'Cost': 1}, {'Command': 'w', 'Target': '2528', 'Cost': 1}, {'Command': 'w', 'Target': '2529', 'Cost': 1}, {'Command': 'w', 'Target': '2530', 'Cost': 1}, {'Command': 's', 'Target': '541', 'Cost': 1}, {'Command': 'n', 'Target': '2530', 'Cost': 1}, {'Command': 'w', 'Target': '2531', 'Cost': 1}, {'Command': 'sw', 'Target': '2924', 'Cost': 1}, {'Command': 'sw', 'Target': '2925', 'Cost': 1}, {'Command': 'sw', 'Target': '2926', 'Cost': 1}, {'Command': 'ne', 'Target': '2925', 'Cost': 1}, {'Command': 'ne', 'Target': '2924', 'Cost': 1}, {'Command': 'ne', 'Target': '2531', 'Cost': 1}, {'Command': 's', 'Target': '2520', 'Cost': 1}, {'Command': 'se', 'Target': '2517', 'Cost': 1}, {'Command': 'sw', 'Target': '2519', 'Cost': 1}, {'Command': 'nw', 'Target': '2518', 'Cost': 1}, {'Command': 'ne', 'Target': '2520', 'Cost': 1}, {'Command': 'leitai', 'Target': '2477', 'Cost': 1}, {'Command': 'nd', 'Target': '2520', 'Cost': 1}, {'Command': 'n', 'Target': '2531', 'Cost': 1}, {'Command': 'w', 'Target': '3769', 'Cost': 1}, {'Command': 'w', 'Target': '3768', 'Cost': 1}, {'Command': 'w', 'Target': '3767', 'Cost': 1}, {'Command': 'e', 'Target': '3768', 'Cost': 1}, {'Command': 'e', 'Target': '3769', 'Cost': 1}, {'Command': 'e', 'Target': '2531', 'Cost': 1}, {'Command': 'e', 'Target': '2530', 'Cost': 1}, {'Command': 'e', 'Target': '2529', 'Cost': 1}, {'Command': 's', 'Target': '2521', 'Cost': 1}, {'Command': 'n', 'Target': '2529', 'Cost': 1}, {'Command': 'n', 'Target': '2483', 'Cost': 1}, {'Command': 'n', 'Target': '2484', 'Cost': 1}, {'Command': 'e', 'Target': '2482', 'Cost': 1}, {'Command': 'w', 'Target': '2484', 'Cost': 1}, {'Command': 'n', 'Target': '2485', 'Cost': 1}, {'Command': 's', 'Target': '2484', 'Cost': 1}, {'Command': 's', 'Target': '2483', 'Cost': 1}, {'Command': 's', 'Target': '2529', 'Cost': 1}, {'Command': 'e', 'Target': '2528', 'Cost': 1}, {'Command': 's', 'Target': '2511', 'Cost': 1}, {'Command': 'n', 'Target': '2528', 'Cost': 1}, {'Command': 'n', 'Target': '2539', 'Cost': 1}, {'Command': 'n*', 'Target': '2541', 'Cost': 1}, {'Command': 'e', 'Target': '2451', 'Cost': 1}, {'Command': 'w', 'Target': '2541', 'Cost': 1}, {'Command': 'w', 'Target': '2532', 'Cost': 1}, {'Command': 'e', 'Target': '2541', 'Cost': 1}, {'Command': 'n', 'Target': '2507', 'Cost': 1}, {'Command': 's', 'Target': '2541', 'Cost': 1}, {'Command': 's', 'Target': '2539', 'Cost': 1}, {'Command': 's', 'Target': '2528', 'Cost': 1}, {'Command': 'e', 'Target': '2460', 'Cost': 1}, {'Command': 'n', 'Target': '2439', 'Cost': 1}, {'Command': 'e', 'Target': '2474', 'Cost': 1}, {'Command': 's', 'Target': '2478', 'Cost': 1}, {'Command': 'n', 'Target': '2474', 'Cost': 1}, {'Command': '#enterchatroom', 'Target': '4176', 'Cost': 1}, {'Command': 'out', 'Target': '2474', 'Cost': 1}, {'Command': 'd', 'Target': '4181', 'Cost': 1}, {'Command': 'd', 'Target': '4182', 'Cost': 1}, {'Command': 'u', 'Target': '4181', 'Cost': 1}, {'Command': 'u', 'Target': '2474', 'Cost': 1}, {'Command': 'u*', 'Target': '2475', 'Cost': 1}, {'Command': 'enter', 'Target': '2476', 'Cost': 1}, {'Command': 'out', 'Target': '2475', 'Cost': 1}, {'Command': 'd', 'Target': '2474', 'Cost': 1}, {'Command': 'w', 'Target': '2439', 'Cost': 1}, {'Command': 'w', 'Target': '2510', 'Cost': 1}, {'Command': 'u', 'Target': '4180', 'Cost': 1}, {'Command': 'd', 'Target': '2510', 'Cost': 1}, {'Command': 'e', 'Target': '2439', 'Cost': 1}, {'Command': 'n', 'Target': '2440', 'Cost': 1}, {'Command': 'e', 'Target': '2544', 'Cost': 1}, {'Command': 'e', 'Target': '2494', 'Cost': 1}, {'Command': 'w', 'Target': '2544', 'Cost': 1}, {'Command': 'u', 'Target': '2545', 'Cost': 1}, {'Command': 'e', 'Target': '2547', 'Cost': 1}, {'Command': 'e', 'Target': '2495', 'Cost': 1}, {'Command': 'w', 'Target': '2547', 'Cost': 1}, {'Command': 's', 'Target': '2503', 'Cost': 1}, {'Command': 'n', 'Target': '2547', 'Cost': 1}, {'Command': 'n', 'Target': '2457', 'Cost': 1}, {'Command': 's', 'Target': '2547', 'Cost': 1}, {'Command': 'w', 'Target': '2545', 'Cost': 1}, {'Command': 'u', 'Target': '2546', 'Cost': 1}, {'Command': 'd', 'Target': '2545', 'Cost': 1}, {'Command': 'd', 'Target': '2544', 'Cost': 1}, {'Command': 'w', 'Target': '2440', 'Cost': 1}, {'Command': 'w', 'Target': '2522', 'Cost': 1}, {'Command': 'w', 'Target': '4195', 'Cost': 1}, {'Command': 'w', 'Target': '4196', 'Cost': 1}, {'Command': 's', 'Target': '4230', 'Cost': 1}, {'Command': 'n', 'Target': '4196', 'Cost': 1}, {'Command': 'w', 'Target': '4197', 'Cost': 1}, {'Command': 'e', 'Target': '4196', 'Cost': 1}, {'Command': 'n', 'Target': '4198', 'Cost': 1}, {'Command': 's', 'Target': '4196', 'Cost': 1}, {'Command': 'e', 'Target': '4195', 'Cost': 1}, {'Command': 'n', 'Target': '4999', 'Cost': 1}, {'Command': 'n', 'Target': '4998', 'Cost': 1}, {'Command': 'w', 'Target': '4997', 'Cost': 1}, {'Command': 'e', 'Target': '4998', 'Cost': 1}, {'Command': 'n', 'Target': '4996', 'Cost': 1}, {'Command': 's', 'Target': '4998', 'Cost': 1}, {'Command': 's', 'Target': '4999', 'Cost': 1}, {'Command': 's', 'Target': '4195', 'Cost': 1}, {'Command': 'e', 'Target': '2522', 'Cost': 1}, {'Command': 'u', 'Target': '2523', 'Cost': 1}, {'Command': 'd', 'Target': '2522', 'Cost': 1}, {'Command': 'e', 'Target': '2440', 'Cost': 1}, {'Command': 'n', 'Target': '2441', 'Cost': 1}, {'Command': 'w', 'Target': '1787', 'Cost': 1}, {'Command': 'w', 'Target': '1788', 'Cost': 1}, {'Command': 'w', 'Target': '1821', 'Cost': 1}, {'Command': 'e', 'Target': '1788', 'Cost': 1}, {'Command': 'e', 'Target': '1787', 'Cost': 1}, {'Command': 'e', 'Target': '2441', 'Cost': 1}, {'Command': 'n', 'Target': '3981', 'Cost': 1}, {'Command': 'n', 'Target': '3982', 'Cost': 1}, {'Command': 'n', 'Target': '3983', 'Cost': 1}, {'Command': 's', 'Target': '3982', 'Cost': 1}, {'Command': 's', 'Target': '3981', 'Cost': 1}, {'Command': 's', 'Target': '2441', 'Cost': 1}, {'Command': 's', 'Target': '2440', 'Cost': 1}, {'Command': 's', 'Target': '2439', 'Cost': 1}, {'Command': 's', 'Target': '2460', 'Cost': 1}, {'Command': 's', 'Target': '2504', 'Cost': 1}, {'Command': 's', 'Target': '2505', 'Cost': 1}, {'Command': 's', 'Target': '2506', 'Cost': 1}, {'Command': 's', 'Target': '1600', 'Cost': 1}, {'Command': 's', 'Target': '1602', 'Cost': 1}, {'Command': 's', 'Target': '1603', 'Cost': 1}, {'Command': 's', 'Target': '1604', 'Cost': 1}, {'Command': 'w', 'Target': '1605', 'Cost': 1}, {'Command': 'sd', 'Target': '2897', 'Cost': 1}, {'Command': 's', 'Target': '2874', 'Cost': 1}, {'Command': 's', 'Target': '2873', 'Cost': 1}, {'Command': 'e', 'Target': '2902', 'Cost': 1}, {'Command': 'e', 'Target': '2915', 'Cost': 1}, {'Command': 'w', 'Target': '2902', 'Cost': 1}, {'Command': 'w', 'Target': '2873', 'Cost': 1}, {'Command': 'n', 'Target': '2874', 'Cost': 1}, {'Command': 'n', 'Target': '2897', 'Cost': 1}, {'Command': 'nu', 'Target': '1605', 'Cost': 1}, {'Command': 'e', 'Target': '1604', 'Cost': 1}, {'Command': 'su', 'Target': '1110', 'Cost': 1}, {'Command': 'se', 'Target': '1111', 'Cost': 1}, {'Command': 'sw', 'Target': '1112', 'Cost': 1}, {'Command': 'w', 'Target': '1107', 'Cost': 1}, {'Command': 'w', 'Target': '1104', 'Cost': 1}, {'Command': 'w', 'Target': '1105', 'Cost': 1}, {'Command': 'w', 'Target': '1106', 'Cost': 1}, {'Command': 'w', 'Target': '1113', 'Cost': 1}, {'Command': 'e', 'Target': '1106', 'Cost': 1}, {'Command': 's', 'Target': '1137', 'Cost': 1}, {'Command': 'n', 'Target': '1106', 'Cost': 1}, {'Command': 'n', 'Target': '1130', 'Cost': 1}, {'Command': 's', 'Target': '1106', 'Cost': 1}, {'Command': 'w', 'Target': '1113', 'Cost': 1}, {'Command': 'w', 'Target': '1114', 'Cost': 1}, {'Command': 'su', 'Target': '1118', 'Cost': 1}, {'Command': 'sd', 'Target': '326', 'Cost': 1}, {'Command': 's', 'Target': '327', 'Cost': 1}, {'Command': 's', 'Target': '347', 'Cost': 1}, {'Command': 'e', 'Target': '348', 'Cost': 1}, {'Command': 's', 'Target': '351', 'Cost': 1}, {'Command': 's', 'Target': '325', 'Cost': 1}, {'Command': 'n', 'Target': '351', 'Cost': 1}, {'Command': 'n', 'Target': '348', 'Cost': 1}, {'Command': 'e', 'Target': '349', 'Cost': 1}, {'Command': 'e', 'Target': '324', 'Cost': 1}, {'Command': 'e', 'Target': '342', 'Cost': 1}, {'Command': 'e', 'Target': '343', 'Cost': 1}, {'Command': 'e', 'Target': '331', 'Cost': 1}, {'Command': 'ne', 'Target': '332', 'Cost': 1}, {'Command': 'ne', 'Target': '334', 'Cost': 1}, {'Command': 'ne', 'Target': '335', 'Cost': 1}, {'Command': 'e', 'Target': '4158', 'Cost': 1}, {'Command': 'e', 'Target': '4160', 'Cost': 1}, {'Command': 'e', 'Target': '4164', 'Cost': 1}, {'Command': 'se', 'Target': '4141', 'Cost': 1}, {'Command': 'nw', 'Target': '4164', 'Cost': 1}, {'Command': 'n', 'Target': '4131', 'Cost': 1}, {'Command': 'n', 'Target': '1308', 'Cost': 1}, {'Command': 'n', 'Target': '1335', 'Cost': 1}, {'Command': 'n', 'Target': '1305', 'Cost': 1}, {'Command': 'n', 'Target': '1306', 'Cost': 1}, {'Command': 'n', 'Target': '1304', 'Cost': 1}, {'Command': 'n', 'Target': '1282', 'Cost': 1}, {'Command': 'e', 'Target': '1281', 'Cost': 1}, {'Command': 'n', 'Target': '1309', 'Cost': 1}, {'Command': 'n', 'Target': '1302', 'Cost': 1}, {'Command': 'goto hangzhou', 'Target': '2724', 'Cost': 20}, {'Command': 'w', 'Target': '2696', 'Cost': 1}, {'Command': 'w', 'Target': '2738', 'Cost': 1}, {'Command': 'e', 'Target': '2696', 'Cost': 1}, {'Command': 'u*', 'Target': '2697', 'Cost': 1}, {'Command': 'd', 'Target': '2696', 'Cost': 1}, {'Command': 'w', 'Target': '2738', 'Cost': 1}, {'Command': 'n', 'Target': '2737', 'Cost': 1}, {'Command': 'n', 'Target': '2736', 'Cost': 1}, {'Command': 'n', 'Target': '2735', 'Cost': 1}, {'Command': 'n', 'Target': '2753', 'Cost': 1}, {'Command': 'w', 'Target': '2752', 'Cost': 1}, {'Command': 'w', 'Target': '2751', 'Cost': 1}, {'Command': 'w', 'Target': '2750', 'Cost': 1}, {'Command': 'w', 'Target': '2749', 'Cost': 1}, {'Command': 'sw', 'Target': '2748', 'Cost': 1}, {'Command': 's', 'Target': '2687', 'Cost': 1}, {'Command': 'sw', 'Target': '2747', 'Cost': 1}, {'Command': 'w', 'Target': '2745', 'Cost': 1}, {'Command': 'sw', 'Target': '2734', 'Cost': 1}, {'Command': 'nw', 'Target': '4140', 'Cost': 1}, {'Command': 'n', 'Target': '4137', 'Cost': 1}, {'Command': 'w', 'Target': '4152', 'Cost': 1}, {'Command': 'w', 'Target': '1029', 'Cost': 1}, {'Command': 'w', 'Target': '1028', 'Cost': 1}, {'Command': 'w', 'Target': '1027', 'Cost': 1}, {'Command': 'w', 'Target': '1086', 'Cost': 1}, {'Command': 'w', 'Target': '1071', 'Cost': 1}, {'Command': 'w', 'Target': '1072', 'Cost': 1}, {'Command': 'w', 'Target': '1073', 'Cost': 1}, {'Command': 'w', 'Target': '1056', 'Cost': 1}, {'Command': 'w', 'Target': '1057', 'Cost': 1}, {'Command': 'w', 'Target': '1058', 'Cost': 1}, {'Command': 'w', 'Target': '478', 'Cost': 1}, {'Command': 'w', 'Target': '547', 'Cost': 1}, {'Command': 'nw', 'Target': '546', 'Cost': 1}, {'Command': 'w', 'Target': '545', 'Cost': 1}, {'Command': 'w', 'Target': '512', 'Cost': 1}, {'Command': 'n', 'Target': '520', 'Cost': 1}, {'Command': 'e', 'Target': '551', 'Cost': 1}, {'Command': 'e', 'Target': '494', 'Cost': 1}, {'Command': 'w', 'Target': '551', 'Cost': 1}, {'Command': 'u', 'Target': '552', 'Cost': 1}, {'Command': 'd', 'Target': '551', 'Cost': 1}, {'Command': 'w', 'Target': '520', 'Cost': 1}, {'Command': 'n', 'Target': '521', 'Cost': 1}, {'Command': 'n', 'Target': '522', 'Cost': 1}, {'Command': 'n', 'Target': '523', 'Cost': 1}, {'Command': 'n', 'Target': '470', 'Cost': 1}, {'Command': 'n', 'Target': '518', 'Cost': 1}, {'Command': 'n', 'Target': '517', 'Cost': 1}, {'Command': 'n', 'Target': '516', 'Cost': 1}, {'Command': 'n', 'Target': '480', 'Cost': 1}, {'Command': 'n', 'Target': '556', 'Cost': 1}, {'Command': 's', 'Target': '480', 'Cost': 1}, {'Command': 's', 'Target': '516', 'Cost': 1}, {'Command': 's', 'Target': '517', 'Cost': 1}, {'Command': 's', 'Target': '518', 'Cost': 1}, {'Command': 's', 'Target': '470', 'Cost': 1}, {'Command': 's', 'Target': '523', 'Cost': 1}, {'Command': 's', 'Target': '522', 'Cost': 1}, {'Command': 's', 'Target': '521', 'Cost': 1}, {'Command': 's', 'Target': '520', 'Cost': 1}, {'Command': 'e', 'Target': '551', 'Cost': 1}, {'Command': 'e', 'Target': '494', 'Cost': 1}, {'Command': 'goto luoyang', 'Target': '2298', 'Cost': 20}, {'Command': 'w', 'Target': '2292', 'Cost': 1}, {'Command': 'w', 'Target': '2325', 'Cost': 1}, {'Command': 'e', 'Target': '2292', 'Cost': 1}, {'Command': 'u', 'Target': '2293', 'Cost': 1}, {'Command': 'd', 'Target': '2292', 'Cost': 1}, {'Command': 'e', 'Target': '2298', 'Cost': 1}, {'Command': 'goto changan', 'Target': '3726', 'Cost': 20}, {'Command': 's', 'Target': '3704', 'Cost': 1}, {'Command': 'e', 'Target': '3705', 'Cost': 1}, {'Command': 'w', 'Target': '3704', 'Cost': 1}, {'Command': 'w', 'Target': '3798', 'Cost': 1}, {'Command': 'e', 'Target': '3704', 'Cost': 1}, {'Command': 's', 'Target': '3729', 'Cost': 1}, {'Command': 'n', 'Target': '3704', 'Cost': 1}, {'Command': 'e', 'Target': '3705', 'Cost': 1}, {'Command': 'e', 'Target': '3706', 'Cost': 1}, {'Command': 'e', 'Target': '3737', 'Cost': 1}, {'Command': 's', 'Target': '3735', 'Cost': 1}, {'Command': 'sw', 'Target': '668', 'Cost': 1}, {'Command': 'w', 'Target': '669', 'Cost': 1}, {'Command': 'w', 'Target': '655', 'Cost': 1}, {'Command': 'w', 'Target': '654', 'Cost': 1}, {'Command': 'n', 'Target': '686', 'Cost': 1}, {'Command': 'n', 'Target': '690', 'Cost': 1}, {'Command': 's', 'Target': '686', 'Cost': 1}, {'Command': 's', 'Target': '654', 'Cost': 1}, {'Command': 'e', 'Target': '655', 'Cost': 1}, {'Command': 'e', 'Target': '669', 'Cost': 1}, {'Command': 'e', 'Target': '668', 'Cost': 1}, {'Command': 'ne', 'Target': '3735', 'Cost': 1}, {'Command': 'n', 'Target': '3737', 'Cost': 1}, {'Command': 'n', 'Target': '3736', 'Cost': 1}, {'Command': 'n', 'Target': '3741', 'Cost': 1}, {'Command': 'n', 'Target': '3676', 'Cost': 1}, {'Command': 'n', 'Target': '3703', 'Cost': 1}, {'Command': 'n', 'Target': '3675', 'Cost': 1}, {'Command': 'n', 'Target': '3656', 'Cost': 1}, {'Command': 'n', 'Target': '3664', 'Cost': 1}, {'Command': 'n', 'Target': '3665', 'Cost': 1}, {'Command': 'n', 'Target': '3663', 'Cost': 1}, {'Command': 'n', 'Target': '3773', 'Cost': 1}, {'Command': 'ne', 'Target': '3774', 'Cost': 1}, {'Command': 'nu', 'Target': '3775', 'Cost': 1}, {'Command': 'ne', 'Target': '3776', 'Cost': 1}, {'Command': 'nd', 'Target': '1841', 'Cost': 1}, {'Command': 'w', 'Target': '1810', 'Cost': 1}, {'Command': 'w', 'Target': '1814', 'Cost': 1}, {'Command': 'e', 'Target': '1810', 'Cost': 1}, {'Command': 'e', 'Target': '1841', 'Cost': 1}, {'Command': 'su', 'Target': '3776', 'Cost': 1}, {'Command': 'sw', 'Target': '3775', 'Cost': 1}, {'Command': 'sd', 'Target': '3774', 'Cost': 1}, {'Command': 'w', 'Target': '3725', 'Cost': 1}, {'Command': 'w', 'Target': '367', 'Cost': 1}, {'Command': 'w', 'Target': '366', 'Cost': 1}, {'Command': 'w', 'Target': '369', 'Cost': 1}, {'Command': 'n', 'Target': '354', 'Cost': 1}, {'Command': 'n', 'Target': '355', 'Cost': 1}, {'Command': 'e', 'Target': '374', 'Cost': 1}, {'Command': 'w', 'Target': '355', 'Cost': 1}, {'Command': 's', 'Target': '354', 'Cost': 1}, {'Command': 's', 'Target': '369', 'Cost': 1}, {'Command': 'w', 'Target': '389', 'Cost': 1}, {'Command': 'w', 'Target': '390', 'Cost': 1}, {'Command': 'w', 'Target': '2863', 'Cost': 1}, {'Command': 'wd', 'Target': '2824', 'Cost': 1}, {'Command': 'w', 'Target': '2841', 'Cost': 1}, {'Command': 'w', 'Target': '2842', 'Cost': 1}, {'Command': 'nw', 'Target': '2843', 'Cost': 1}, {'Command': 'w', 'Target': '2844', 'Cost': 1}, {'Command': 'nw', 'Target': '2839', 'Cost': 1}, {'Command': 'nw', 'Target': '2817', 'Cost': 1}, {'Command': 'n', 'Target': '2829', 'Cost': 1}, {'Command': 'goto lingzhou', 'Target': '415', 'Cost': 20}, {'Command': 'w', 'Target': '396', 'Cost': 1}, {'Command': 'e', 'Target': '415', 'Cost': 1}, {'Command': 'goto kaifeng', 'Target': '3166', 'Cost': 20}, {'Command': 'w', 'Target': '3095', 'Cost': 1}, {'Command': 'w', 'Target': '3173', 'Cost': 1}, {'Command': 'e', 'Target': '3095', 'Cost': 1}, {'Command': 'u', 'Target': '3096', 'Cost': 1}, {'Command': 'd', 'Target': '3095', 'Cost': 1}, {'Command': 'w', 'Target': '3173', 'Cost': 1}, {'Command': 'n', 'Target': '3174', 'Cost': 1}, {'Command': 'nu', 'Target': '3175', 'Cost': 1}, {'Command': 'nd', 'Target': '3176', 'Cost': 1}, {'Command': 'n', 'Target': '3177', 'Cost': 1}, {'Command': 'n', 'Target': '3194', 'Cost': 1}, {'Command': 'n', 'Target': '3158', 'Cost': 1}, {'Command': 'wu', 'Target': '3179', 'Cost': 1}, {'Command': 'wd', 'Target': '3180', 'Cost': 1}, {'Command': 'n', 'Target': '291', 'Cost': 1}, {'Command': 'e', 'Target': '3911', 'Cost': 1}, {'Command': 's', 'Target': '3984', 'Cost': 1}, {'Command': 's', 'Target': '3906', 'Cost': 1}, {'Command': 'e', 'Target': '3893', 'Cost': 1}, {'Command': 'e', 'Target': '3904', 'Cost': 1}, {'Command': 'w', 'Target': '3893', 'Cost': 1}, {'Command': 'u*', 'Target': '3894', 'Cost': 1}, {'Command': 'd', 'Target': '3893', 'Cost': 1}, {'Command': 'w', 'Target': '3906', 'Cost': 1}, {'Command': 'n', 'Target': '3984', 'Cost': 1}, {'Command': 'n', 'Target': '3911', 'Cost': 1}, {'Command': 'n', 'Target': '3452', 'Cost': 1}, {'Command': 'n', 'Target': '3460', 'Cost': 1}, {'Command': 'n', 'Target': '3459', 'Cost': 1}, {'Command': 'n', 'Target': '3455', 'Cost': 1}, {'Command': 'n', 'Target': '3454', 'Cost': 1}, {'Command': 'ne', 'Target': '3605', 'Cost': 1}, {'Command': 'nw', 'Target': '3629', 'Cost': 1}, {'Command': 'ne', 'Target': '3620', 'Cost': 1}, {'Command': 'ne', 'Target': '3621', 'Cost': 1}, {'Command': 'ne', 'Target': '3622', 'Cost': 1}, {'Command': 'n', 'Target': '3618', 'Cost': 1}, {'Command': 'ne', 'Target': '3623', 'Cost': 1}, {'Command': 'ne', 'Target': '3624', 'Cost': 1}, {'Command': 'n', 'Target': '3625', 'Cost': 1}, {'Command': 'n', 'Target': '3626', 'Cost': 1}, {'Command': 'n', 'Target': '3627', 'Cost': 1}, {'Command': 'n', 'Target': '3616', 'Cost': 1}, {'Command': 'n', 'Target': '3617', 'Cost': 1}, {'Command': 'n', 'Target': '3602', 'Cost': 1}, {'Command': 'w', 'Target': '3603', 'Cost': 1}, {'Command': 'w', 'Target': '3611', 'Cost': 1}, {'Command': 'goto beijing', 'Target': '3432', 'Cost': 20}, {'Command': 'goto xiangyang', 'Target': '2601', 'Cost': 20}, {'Command': 'goto kunming', 'Target': '2401', 'Cost': 20}, {'Command': 'e', 'Target': '2398', 'Cost': 1}, {'Command': 'e', 'Target': '2403', 'Cost': 1}, {'Command': 'n', 'Target': '2402', 'Cost': 1}, {'Command': 'n', 'Target': '2396', 'Cost': 1}, {'Command': 'w', 'Target': '2395', 'Cost': 1}, {'Command': 'w', 'Target': '2428', 'Cost': 1}, {'Command': 'w', 'Target': '2431', 'Cost': 1}, {'Command': 'w', 'Target': '2432', 'Cost': 1}, {'Command': 'w', 'Target': '1985', 'Cost': 1}, {'Command': 'ne', 'Target': '989', 'Cost': 1}, {'Command': 'w', 'Target': '924', 'Cost': 1}, {'Command': 'w', 'Target': '974', 'Cost': 1}, {'Command': 'e', 'Target': '924', 'Cost': 1}, {'Command': 'e', 'Target': '989', 'Cost': 1}, {'Command': 'ne', 'Target': '988', 'Cost': 1}, {'Command': 'w', 'Target': '1471', 'Cost': 1}, {'Command': 'nw', 'Target': '1472', 'Cost': 1}, {'Command': 'w', 'Target': '1452', 'Cost': 1}, {'Command': 'w', 'Target': '1448', 'Cost': 1}, {'Command': 'w', 'Target': '1450', 'Cost': 1}, {'Command': 's', 'Target': '1451', 'Cost': 1}, {'Command': 'sw', 'Target': '1498', 'Cost': 1}, {'Command': 'se', 'Target': '1456', 'Cost': 1}, {'Command': 'e', 'Target': '1459', 'Cost': 1}, {'Command': 'goto dali', 'Target': '1967', 'Cost': 20}, {'Command': 'e', 'Target': '1876', 'Cost': 1}], 'Unvisited': []}