Beispiel #1
0
def main():
    global state_matrix, enviromentsize, Q, steps_matrix
    steps_matrix = []
    enviromentsize = 15
    state_matrix = initialize_state_matrix(
        np.zeros((enviromentsize, enviromentsize)), enviromentsize)
    obstacles = [
        32, 33, 34, 38, 39, 40, 41, 42, 43, 48, 49, 50, 54, 55, 56, 57, 58, 64,
        65, 66, 70, 71, 72, 73, 79, 80, 81, 85, 86, 87, 88, 95, 96, 98, 101,
        102, 103, 106, 107, 109, 110, 111, 112, 113, 116, 117, 121, 122, 124,
        125, 126, 127, 132, 136, 137, 139, 140, 141, 142, 147, 156, 157, 161,
        162, 166, 167, 171, 172, 173, 177, 181, 182, 186, 187, 188, 192, 193,
        196, 197, 203, 206, 207, 208
    ]
    i = 224
    state_matrix = initialize_state_matrix(
        np.zeros((enviromentsize, enviromentsize)), enviromentsize)
    env = np.zeros((enviromentsize, enviromentsize))
    env = reset_enviroment(env, enviromentsize, i, obstacles)
    with open('pickle/with_obstacles/' + str(i) + '.pickle', "rb") as read:
        Q = pickle.load(read)
    print('evaluating optimal path to position:', i)
    select_optimal_path(Q, env, i)

    print('steps', steps_matrix)

    with open('pickle/with_obstacles/steps_positions.pickle', "wb") as write:
        pickle.dump(steps_matrix, write)
def main():
    global state_matrix, enviromentsize, Q, steps_matrix
    steps_matrix = []
    enviromentsize = 20
    state_matrix = initialize_state_matrix(
        np.zeros((enviromentsize, enviromentsize)), enviromentsize)
    obstacles = [20,21,23,24,26,27,29,30,32,33,35,36,38,39,40,41,43,44,46,47,49,50,52,53,55,56,58,59,60,61,63,64,66,67,69,70,72,73,75,76,78,79,80,81,83,84,86,87,89,90,92,93,95,96,98,99,
    120,121,123,124,126,127,129,130,132,133,135,136,138,139,140,141,143,144,146,147,149,150,152,153,155,156,158,159,160,161,163,164,166,167,169,170,172,173,175,176,178,179,180,181,183,184,
    186,187,189,190,192,193,195,196,198,199,220,221,223,224,226,227,229,230,232,233,235,236,238,239,240,241,243,244,246,247,249,250,252,253,255,256,258,259,260,261,263,264,266,267,269,270,
    272,273,275,276,278,279,280,281,283,284,286,287,289,290,292,293,295,296,298,299,320,321,323,324,326,327,329,330,332,333,335,336,338,340,341,343,344,346,347,349,350,352,353,355,356,
    358,360,361,363,364,366,367,369,370,372,373,375,376,378,380,381,383,384,386,387,389,390,392,393,395,396,398]
    i = 399
    state_matrix = initialize_state_matrix(
                np.zeros((enviromentsize, enviromentsize)), enviromentsize)
    env = np.zeros((enviromentsize, enviromentsize))
    env = reset_enviroment(env, enviromentsize, i, obstacles)
    with open('pickle/with_obstacles/'+str(i)+'.pickle', "rb") as read:
        Q = pickle.load(read)
    print('evaluating optimal path to position:',i)
    select_optimal_path(Q, env, i)

    print('steps', steps_matrix)

    with open('pickle/with_obstacles/steps_positions.pickle', "wb") as write:
        pickle.dump(steps_matrix, write)
Beispiel #3
0
def main():
    global state_matrix, enviromentsize, Q, steps_matrix
    steps_matrix = []
    enviromentsize = 100
    state_matrix = initialize_state_matrix(
        np.zeros((enviromentsize, enviromentsize)), enviromentsize)
    obstacles = [64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 92, 93, 94, 95, 96, 97, 98, 99, 164, 165, 166, 167, 168, 169, 170, 171, 172, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 192, 193, 194, 195, 196, 197, 198, 199, 263, 264, 265, 266, 267, 269, 270, 271, 274, 275, 276, 277, 278, 279, 280, 283, 284, 285, 286, 287, 291, 292, 293, 294, 295, 296, 297, 298, 299, 362, 363, 364, 365, 366, 370, 374, 375, 376, 377, 378, 379, 380, 381, 384, 385, 386, 390, 393, 394, 395, 396, 397, 398, 399, 462, 463, 464, 465, 475, 476, 477, 478, 479, 480, 481, 482, 485, 489, 490, 491, 494, 495, 496, 497, 498, 499, 562, 563, 564, 565, 572, 573, 576, 577, 578, 579, 580, 581, 582, 583, 588, 589, 590, 591, 592, 595, 596, 597, 598, 599, 663, 664, 665, 666, 667, 671, 672, 673, 674, 677, 678, 679, 680, 681, 682, 683, 687, 688, 689, 690, 691, 692, 693, 694, 696, 697, 698, 699, 764, 765, 766, 767, 770, 771, 772, 773, 774, 775, 776, 778, 779, 780, 781, 782, 783, 787, 788, 789, 790, 791, 792, 793, 794, 795, 798, 799, 865, 866, 869, 870, 871, 874, 875, 876, 877, 879, 880, 881, 882, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 968, 969, 970, 971, 972, 973, 975, 976, 977, 978, 981, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1077, 1078, 1079, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1199, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277, 1278, 1283, 1284, 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1298, 1299, 1370, 1371, 1372, 1373, 1374, 1375, 1376, 1377, 1378, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1397, 1398, 1399, 1471, 1472, 1473, 1474, 1475, 1476, 1477, 1481, 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, 1493, 1496, 1497, 1498, 1499, 1572, 1573, 1574, 1575, 1576, 1580, 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1595, 1596, 1597, 1598, 1599, 1673, 1674, 1675, 1679, 1680, 1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, 1690, 1691, 1692, 1695, 1696, 1697, 1773, 1774, 1778, 1779, 1780, 1781, 1784, 1785, 1786, 1787, 1788, 1789, 1790, 1794, 1795, 1796, 1797, 1802, 1878, 1879, 1880, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1893, 1894, 1895, 1896, 1898, 1899, 1900, 1901, 1903, 1904, 1977, 1978, 1979, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1992, 1993, 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2076, 2077, 2078, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2092, 2093, 2094, 2097, 2098, 2099, 2100, 2101, 2102, 2104, 2105, 2106, 2177, 2179, 2180, 2181, 2182, 2183, 2184, 2185, 2186, 2187, 2188, 2191, 2192, 2193, 2196, 2197, 2198, 2199, 2200, 2201, 2202, 2203, 2205, 2206, 2207, 2239, 2278, 2279, 2280, 2281, 2282, 2283, 2284, 2285, 2286, 2290, 2291, 2292, 2293, 2295, 2296, 2297, 2298, 2300, 2301, 2302, 2303, 2304, 2306, 2307, 2308, 2309, 2316, 2338, 2339, 2340, 2374, 2375, 2379, 2380, 2381, 2382, 2383, 2384, 2385, 2389, 2390, 2391, 2392, 2395, 2396, 2397, 2401, 2402, 2403, 2404, 2407, 2408, 2409, 2410, 2437, 2438, 2439, 2440, 2441, 2473, 2474, 2475, 2480, 2481, 2482, 2483, 2484, 2489, 2490, 2491, 2494, 2495, 2496, 2501, 2502, 2503, 2504, 2505, 2507, 2508, 2509, 2510, 2517, 2518, 2536, 2537, 2538, 2539, 2540, 2541, 2572, 2573, 2574, 2581, 2582, 2583, 2590, 2594, 2595, 2596, 2599, 2602, 2603, 2604, 2605, 2606, 2608, 2609, 2616, 2617, 2618, 2635, 2636, 2637, 2638, 2639, 2642, 2672, 2673, 2681, 2682, 2689, 2692, 2695, 2698, 2699, 2703, 2704, 2705, 2706, 2707, 2735, 2736, 2737, 2740, 2741, 2742, 2743, 2788, 2789, 2791, 2792, 2793, 2794, 2797, 2798, 2799, 2804, 2805, 2806, 2834, 2835, 2838, 2839, 2840, 2841, 2842, 2843, 2888, 2891, 2892, 2893, 2898, 2899, 2936, 2937, 2938, 2939, 2940, 2941, 2942, 2958, 2959, 2986, 2987, 2990, 2991, 2992, 2993, 2996, 3034, 3035, 3036, 3037, 3038, 3039, 3040, 3041, 3044, 3045, 3057, 3058, 3059, 3085, 3086, 3089, 3090, 3091, 3092, 3095, 3096, 3097, 3135, 3136, 3137, 3138, 3139, 3142, 3143, 3144, 3145, 3157, 3158, 3159, 3160, 3188, 3189, 3190, 3191, 3194, 3195, 3196, 3197, 3204, 3205, 3232, 3235, 3236, 3237, 3240, 3241, 3242, 3243, 3244, 3245, 3257, 3258, 3259, 3260, 3261, 3288, 3289, 3290, 3293, 3294, 3295, 3296, 3299, 3305, 3306, 3307, 3331, 3332, 3333, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3347, 3358, 3359, 3388, 3389, 3393, 3394, 3395, 3398, 3399, 3402, 3403, 3405, 3406, 3407, 3408, 3431, 3434, 3437, 3438, 3439, 3440, 3441, 3442, 3443, 3446, 3447, 3448, 3454, 3489, 3492, 3493, 3494, 3497, 3498, 3499, 3502, 3503, 3505, 3506, 3507, 3508, 3530, 3534, 3537, 3538, 3539, 3540, 3541, 3542, 3545, 3546, 3547, 3548, 3553, 3554, 3591, 3592, 3593, 3594, 3596, 3597, 3598, 3599, 3603, 3604, 3605, 3606, 3607, 3609, 3610, 3611, 3617, 3618, 3629, 3633, 3637, 3638, 3639, 3640, 3641, 3644, 3645, 3646, 3647, 3648, 3652, 3653, 3691, 3692, 3693, 3696, 3697, 3698, 3699, 3700, 3701, 3702, 3706, 3708, 3709, 3710, 3711, 3712, 3716, 3717, 3718, 3719, 3728, 3732, 3735, 3738, 3739, 3740, 3743, 3744, 3745, 3746, 3747, 3791, 3792, 3795, 3796, 3797, 3798, 3799, 3800, 3801, 3802, 3803, 3807, 3808, 3809, 3810, 3811, 3812, 3813, 3817, 3818, 3819, 3827, 3832, 3836, 3839, 3842, 3843, 3844, 3845, 3894, 3895, 3896, 3897, 3898, 3899, 3903, 3904, 3907, 3908, 3909, 3910, 3911, 3912, 3914, 3915, 3918, 3926, 3936, 3942, 3994, 3995, 3996, 3997, 3998, 3999, 4003, 4004, 4008, 4009, 4010, 4011, 4012, 4014, 4015, 4016, 4026, 4030, 4036, 4037, 4062, 4063, 4094, 4095, 4096, 4097, 4098, 4102, 4103, 4105, 4110, 4111, 4112, 4115, 4126, 4129, 4131, 4132, 4136, 4137, 4162, 4163, 4195, 4196, 4197, 4202, 4205, 4206, 4208, 4209, 4211, 4227, 4228, 4230, 4231, 4232, 4233, 4234, 4261, 4262, 4263, 4264, 4296, 4297, 4300, 4301, 4302, 4304, 4305, 4306, 4308, 4309, 4310, 4327, 4329, 4330, 4331, 4332, 4333, 4334, 4348, 4361, 4362, 4363, 4364, 4365, 4400, 4401, 4403, 4404, 4405, 4406, 4408, 4409, 4410, 4411, 4429, 4430, 4431, 4432, 4438, 4447, 4448, 4449, 4461, 4462, 4463, 4464, 4465, 4466, 4502, 4503, 4504, 4505, 4506, 4507, 4509, 4510, 4511, 4512, 4521, 4522, 4529, 4530, 4533, 4539, 4547, 4548, 4549, 4550, 4551, 4559, 4560, 4563, 4564, 4565, 4566, 4567, 4602, 4603, 4604, 4605, 4606, 4607, 4609, 4610, 4611, 4620, 4621, 4623, 4631, 4632, 4639, 4644, 4645, 4647, 4648, 4649, 4650, 4651, 4658, 4659, 4660, 4661, 4662, 4665, 4666, 4667, 4703, 4704, 4705, 4706, 4707, 4709, 4710, 4719, 4720, 4724, 4725, 4731, 4732, 4738, 4744, 4745, 4746, 4747, 4748, 4749, 4750, 4751, 4754, 4759, 4760, 4761, 4762, 4763, 4766, 4767, 4768, 4771, 4772, 4773, 4804, 4805, 4806, 4807, 4808, 4818, 4819, 4825, 4826, 4827, 4833, 4837, 4843, 4844, 4845, 4846, 4847, 4848, 4849, 4850, 4853, 4860, 4861, 4862, 4863, 4864, 4865, 4869, 4870, 4871, 4872, 4873, 4874, 4905, 4906, 4907, 4908, 4918, 4927, 4928, 4934, 4936, 4937, 4942, 4943, 4944, 4945, 4946, 4947, 4948, 4949, 4950, 4961, 4962, 4963, 4964, 4965, 4968, 4969, 4970, 4971, 4972, 4973, 4974, 4975, 5006, 5007, 5017, 5036, 5041, 5042, 5043, 5044, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5063, 5066, 5067, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 5116, 5125, 5126, 5127, 5141, 5142, 5143, 5144, 5145, 5146, 5147, 5148, 5149, 5150, 5165, 5166, 5167, 5168, 5169, 5170, 5171, 5172, 5173, 5174, 5175, 5176, 5216, 5225, 5226, 5231, 5232, 5243, 5244, 5245, 5246, 5247, 5248, 5249, 5266, 5267, 5268, 5269, 5270, 5271, 5272, 5273, 5274, 5275, 5276, 5277, 5317, 5323, 5328, 5329, 5330, 5331, 5332, 5333, 5344, 5345, 5346, 5347, 5348, 5363, 5367, 5368, 5369, 5370, 5371, 5372, 5373, 5374, 5375, 5376, 5377, 5378, 5418, 5419, 5421, 5422, 5427, 5428, 5429, 5430, 5431, 5434, 5437, 5446, 5447, 5448, 5463, 5469, 5470, 5471, 5472, 5473, 5474, 5475, 5476, 5477, 5478, 5519, 5520, 5524, 5525, 5527, 5528, 5529, 5532, 5533, 5534, 5536, 5537, 5538, 5547, 5570, 5571, 5572, 5573, 5574, 5575, 5576, 5577, 5578, 5614, 5615, 5622, 5623, 5625, 5630, 5631, 5632, 5633, 5635, 5636, 5637, 5638, 5639, 5672, 5673, 5674, 5675, 5676, 5677, 5714, 5715, 5721, 5722, 5728, 5729, 5730, 5731, 5732, 5733, 5735, 5736, 5737, 5738, 5739, 5740, 5741, 5773, 5774, 5775, 5776, 5777, 5778, 5818, 5819, 5820, 5828, 5829, 5830, 5831, 5832, 5834, 5835, 5836, 5837, 5838, 5839, 5840, 5841, 5842, 5875, 5876, 5877, 5878, 5879, 5880, 5917, 5918, 5919, 5920, 5929, 5930, 5931, 5932, 5933, 5934, 5935, 5936, 5937, 5939, 5940, 5941, 5942, 5943, 5944, 5971, 5972, 5976, 5977, 5978, 5979, 5980, 5981, 6016, 6017, 6026, 6031, 6033, 6034, 6035, 6036, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6070, 6071, 6072, 6073, 6078, 6079, 6080, 6081, 6125, 6133, 6134, 6135, 6136, 6138, 6139, 6140, 6141, 6143, 6144, 6145, 6170, 6171, 6172, 6173, 6174, 6175, 6179, 6180, 6224, 6229, 6234, 6235, 6237, 6238, 6239, 6240, 6241, 6242, 6243, 6244, 6248, 6249, 6269, 6270, 6271, 6272, 6273, 6274, 6275, 6276, 6324, 6329, 6332, 6336, 6337, 6338, 6339, 6340, 6341, 6342, 6343, 6347, 6348, 6349, 6350, 6368, 6369, 6370, 6371, 6372, 6373, 6374, 6375, 6376, 6377, 6378, 6398, 6399, 6423, 6428, 6437, 6438, 6439, 6441, 6442, 6443, 6446, 6447, 6448, 6449, 6450, 6468, 6469, 6470, 6471, 6472, 6473, 6474, 6475, 6476, 6477, 6478, 6479, 6498, 6499, 6530, 6540, 6541, 6542, 6546, 6547, 6548, 6549, 6551, 6552, 6553, 6567, 6568, 6569, 6570, 6571, 6572, 6573, 6574, 6575, 6576, 6577, 6578, 6579, 6580, 6627, 6629, 6630, 6636, 6640, 6641, 6645, 6646, 6647, 6648, 6649, 6651, 6652, 6653, 6654, 6666, 6667, 6668, 6669, 6670, 6671, 6672, 6673, 6674, 6675, 6676, 6677, 6678, 6679, 6680, 6729, 6737, 6738, 6744, 6745, 6746, 6747, 6748, 6750, 6751, 6752, 6753, 6755, 6756, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 6775, 6776, 6777, 6778, 6779, 6828, 6829, 6834, 6835, 6839, 6840, 6844, 6845, 6846, 6847, 6849, 6850, 6851, 6852, 6853, 6855, 6856, 6857, 6867, 6868, 6869, 6870, 6871, 6872, 6873, 6874, 6875, 6876, 6877, 6878, 6933, 6934, 6936, 6937, 6944, 6945, 6946, 6947, 6949, 6950, 6951, 6952, 6954, 6955, 6956, 6957, 6968, 6969, 6970, 6971, 6972, 6973, 6974, 6975, 6976, 6977, 6978, 7033, 7035, 7036, 7038, 7043, 7046, 7048, 7049, 7050, 7051, 7053, 7054, 7055, 7056, 7057, 7059, 7060, 7061, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 7077, 7133, 7135, 7137, 7138, 7148, 7149, 7150, 7151, 7153, 7154, 7155, 7156, 7158, 7159, 7160, 7161, 7171, 7172, 7173, 7174, 7175, 7176, 7234, 7235, 7237, 7241, 7249, 7250, 7252, 7253, 7254, 7255, 7257, 7258, 7259, 7260, 7261, 7263, 7264, 7273, 7274, 7275, 7276, 7306, 7336, 7337, 7341, 7343, 7346, 7351, 7352, 7353, 7354, 7355, 7357, 7358, 7359, 7360, 7362, 7363, 7364, 7365, 7374, 7375, 7376, 7407, 7440, 7443, 7448, 7452, 7453, 7454, 7456, 7457, 7458, 7459, 7461, 7462, 7463, 7464, 7465, 7476, 7504, 7539, 7540, 7542, 7545, 7553, 7555, 7556, 7557, 7558, 7559, 7561, 7562, 7563, 7564, 7566, 7567, 7568, 7603, 7609, 7641, 7642, 7644, 7645, 7647, 7652, 7655, 7656, 7657, 7658, 7660, 7661, 7662, 7663, 7664, 7666, 7668, 7669, 7702, 7710, 7743, 7744, 7746, 7747, 7752, 7757, 7759, 7760, 7761, 7762, 7763, 7765, 7768, 7770, 7771, 7808, 7811, 7843, 7845, 7846, 7854, 7859, 7860, 7861, 7862, 7864, 7865, 7867, 7870, 7871, 7872, 7873, 7907, 7912, 7945, 7950, 7951, 7956, 7960, 7961, 7962, 7964, 7967, 7969, 7970, 7971, 7972, 7973, 8005, 8006, 8051, 8052, 8058, 8061, 8063, 8066, 8069, 8071, 8072, 8105, 8111, 8153, 8154, 8163, 8164, 8165, 8168, 8171, 8172, 8210, 8260, 8264, 8265, 8267, 8268, 8271, 8309, 8361, 8362, 8367, 8370, 8463, 8468, 8469, 8470, 8565, 8569, 8662, 8667, 8719, 8720, 8762, 8763, 8767, 8785, 8820, 8821, 8863, 8864, 8865, 8881, 8884, 8885, 8886, 8917, 8918, 8921, 8922, 8965, 8966, 8981, 8984, 8985, 8986, 8987, 9016, 9017, 9022, 9083, 9084, 9085, 9086, 9115, 9116, 9182, 9183, 9184, 9185, 9221, 9282, 9283, 9284, 9285, 9320, 9321, 9381, 9382, 9383, 9384, 9419, 9420, 9483]
    i = 9999
    state_matrix = initialize_state_matrix(
                np.zeros((enviromentsize, enviromentsize)), enviromentsize)
    env = np.zeros((enviromentsize, enviromentsize))
    env = reset_enviroment(env, enviromentsize, i, obstacles)
    with open(r'C:\Users\mesqu\Downloads\TG\hexapo-robot-optmal\pickle\10000.pickle', "rb") as read:
        Q = pickle.load(read)
    print('evaluating optimal path to position:',i)
    select_optimal_path(Q, env, i)

    print('steps', steps_matrix)

    with open('pickle/with_obstacles/steps_positions.pickle', "wb") as write:
        pickle.dump(steps_matrix, write)
def main():
    global state_matrix, enviromentsize
    enviromentsize = 4
    env = np.zeros((enviromentsize, enviromentsize))
    env = reset_enviroment(env, enviromentsize)
    state_matrix = initialize_state_matrix(
        np.zeros((enviromentsize, enviromentsize)), enviromentsize)

    with open('pickle/q_table_2.pickle', "rb") as read:
        Q = pickle.load(read)

    select_optimal_path(Q, env)
Beispiel #5
0
def main():
    global state_matrix, enviromentsize, Q, steps_matrix
    steps_matrix = []
    enviromentsize = 4
    state_matrix = initialize_state_matrix(np.zeros((enviromentsize, enviromentsize)), enviromentsize)
    for i in range(1, 16):
            env = np.zeros((enviromentsize, enviromentsize))
            env = reset_enviroment(env, enviromentsize, i)
            with open('pickle/without_obstacles/'+str(i)+'.pickle', "rb") as read:
                Q = pickle.load(read)
                print(Q)
            select_optimal_path(Q, env)

    with open('pickle/without_obstacles/steps_positions.pickle', "wb") as write:
        pickle.dump(steps_matrix, write)

    print(steps_matrix)
Beispiel #6
0
def main():
    global state_matrix, enviromentsize, Q, steps_matrix
    steps_matrix = []
    enviromentsize = 10
    state_matrix = initialize_state_matrix(
        np.zeros((enviromentsize, enviromentsize)), enviromentsize)
    for i in range(1, 100):
        if i != 11 and i != 22 and i != 31:
            print('Q_map:', i)
            env = np.zeros((enviromentsize, enviromentsize))
            env = reset_enviroment(env, enviromentsize, i)
            with open('pickle/with_obstacles/' + str(i) + '.pickle',
                      "rb") as read:
                Q = pickle.load(read)
            select_optimal_path(Q, env)

    print('steps', steps_matrix)

    with open('pickle/with_obstacles/steps_positions.pickle', "wb") as write:
        pickle.dump(steps_matrix, write)
Beispiel #7
0
def main():
    global state_matrix, enviromentsize, Q, steps_matrix
    steps_matrix = []
    enviromentsize = 10
    state_matrix = initialize_state_matrix(
        np.zeros((enviromentsize, enviromentsize)), enviromentsize)
    i = 99
    env = np.zeros((enviromentsize, enviromentsize))
    env = reset_enviroment(env, enviromentsize, i)
    with open(
            r'C:\Users\mesqu\Downloads\TG\hexapo-robot-optmal\pickle\100.pickle',
            "rb") as read:
        Q = pickle.load(read)
        print(Q)
    select_optimal_path(Q, env, i)

    with open('pickle/without_obstacles/steps_positions.pickle',
              "wb") as write:
        pickle.dump(steps_matrix, write)

    print(steps_matrix)