diff --git a/.idea/misc.xml b/.idea/misc.xml index 8a27f0b..384e5d8 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -11,7 +11,7 @@ - + \ No newline at end of file diff --git a/JDSimpleConvergenceResults.txt b/JDSimpleConvergenceResults.txt deleted file mode 100644 index e32dd0a..0000000 --- a/JDSimpleConvergenceResults.txt +++ /dev/null @@ -1,20 +0,0 @@ -0.05,447,1036,447,788,499,499,880,514,583,420,759,678,529,781,742,185,848,346,733,961,657,312,599,245,1076,1361,377,612,821,481,374,250,171,949,1079,788,465,537,431,312,565,1046,825,579,1178,547,1111,518,949,779,924,430,543,1262,642,814,508,422,1120,536,591,381,670,681,382,297,795,774,1552,691,909,748,520,639,704,575,752,418,503,292,1159,1020,570,839,696,895,511,635,830,522,628,518,408,392,605,888,790,629,547,999 -0.1,337,303,221,455,64,271,377,946,381,253,669,479,267,870,250,364,347,83,124,464,356,535,820,180,369,310,284,456,166,267,240,215,347,295,226,409,344,266,404,480,195,235,655,233,429,149,304,164,409,276,268,139,495,388,401,283,343,284,720,351,170,781,59,369,789,155,206,464,380,272,645,180,216,698,166,497,650,297,595,352,138,163,412,238,336,90,453,238,306,598,487,722,640,592,493,144,435,441,387,374 -0.15,288,400,363,158,414,302,126,175,323,303,391,202,295,329,468,198,199,179,384,193,168,443,74,153,347,458,395,209,545,199,421,587,144,200,219,204,134,200,253,193,396,108,530,728,286,118,256,351,279,308,210,713,474,415,397,328,220,201,136,515,374,154,847,578,313,250,224,392,362,551,127,211,321,176,372,572,304,290,225,541,296,315,392,235,161,359,307,360,613,194,389,278,334,153,402,224,246,260,264,226 -0.2,193,331,294,156,245,530,237,199,225,298,414,424,342,239,361,295,176,326,155,371,272,255,259,201,506,520,108,172,416,220,245,283,203,213,164,469,262,263,177,80,174,346,573,577,243,226,437,427,261,195,210,389,286,297,263,328,393,174,166,267,344,223,161,171,321,256,322,251,238,164,216,198,449,327,328,175,334,260,479,269,389,137,292,384,232,549,394,177,207,165,123,304,346,407,437,66,176,358,277,111 -0.25,155,195,340,162,250,300,204,218,278,291,184,282,95,370,265,275,168,229,207,463,273,157,233,106,338,414,397,305,283,374,347,243,78,172,284,296,187,439,149,513,689,99,93,260,382,204,141,310,170,409,436,112,283,435,284,108,210,264,335,177,121,181,124,294,129,394,183,117,211,137,254,384,263,228,423,443,349,142,115,276,268,251,275,191,387,283,124,212,191,167,490,329,293,194,294,241,432,50,105,341 -0.3,282,128,127,74,136,311,303,206,150,387,167,353,286,138,107,269,343,301,157,370,553,161,292,175,250,187,259,451,222,203,312,177,212,248,197,276,122,236,159,480,274,474,46,208,96,248,131,358,301,142,302,298,153,105,524,131,225,343,207,301,409,321,505,546,131,395,275,151,148,280,266,539,116,105,166,232,245,155,219,222,123,174,221,162,521,206,325,77,388,199,380,222,52,177,119,98,323,378,262,214 -0.35,404,130,174,176,297,284,274,139,279,225,105,115,238,191,278,162,185,316,233,535,175,131,86,245,135,262,285,427,214,224,139,170,348,371,385,151,231,258,202,260,293,109,159,323,317,68,231,170,313,168,222,216,357,225,177,125,195,361,242,133,258,158,174,101,132,272,131,213,224,124,232,701,395,321,173,144,226,260,220,211,352,190,188,422,260,151,167,241,459,237,298,225,123,274,107,242,253,134,132,288 -0.40,318,374,159,305,164,220,69,174,233,277,163,293,236,323,154,210,209,117,271,126,155,632,233,208,417,273,127,213,73,223,99,118,178,197,137,207,138,351,208,254,232,207,609,256,169,164,403,589,145,79,344,293,270,218,162,221,341,71,125,203,215,178,81,150,213,223,368,236,244,249,231,166,317,171,164,208,292,172,174,256,285,136,236,446,312,371,285,152,155,524,171,113,287,156,281,97,209,195,368,283 -0.45,198,106,298,295,298,124,168,159,194,144,110,270,253,225,126,191,184,119,255,484,528,147,181,190,345,166,158,211,304,242,92,199,219,129,86,170,167,150,190,168,514,317,154,164,186,261,276,234,72,241,130,233,269,136,217,73,219,193,353,42,127,305,361,313,86,109,254,400,327,452,165,350,192,139,499,192,147,313,225,159,122,121,228,217,79,162,183,354,360,432,258,313,325,317,265,33,175,233,203,178 -0.50,149,341,278,153,204,216,244,250,291,247,268,114,175,202,87,236,377,280,161,444,199,185,112,52,495,248,87,199,327,374,192,136,545,92,174,186,85,238,277,274,227,139,112,300,205,292,398,188,329,214,114,55,212,154,533,109,139,165,216,280,210,231,193,295,149,190,131,130,184,159,161,229,286,146,218,151,137,265,80,191,326,282,194,164,114,203,221,495,298,187,116,110,119,140,237,203,124,307,260,164 -0.55,190,161,170,533,205,104,85,228,610,294,293,380,297,333,498,303,198,248,430,180,157,131,402,706,346,282,151,102,346,227,195,98,306,391,533,312,297,149,480,191,93,110,233,104,434,244,296,124,131,275,157,165,93,94,241,96,82,417,283,150,148,142,262,216,425,223,531,430,203,153,254,221,162,472,361,286,243,202,205,433,228,266,162,156,296,487,288,196,278,195,88,400,302,216,181,283,185,137,262,120 -0.60,106,272,207,213,259,228,104,214,245,230,122,170,296,190,223,208,455,133,207,257,147,182,252,475,193,115,254,97,406,167,49,179,199,77,163,234,242,157,153,347,200,322,62,191,152,381,236,119,229,563,127,171,127,126,371,213,565,505,135,242,301,224,221,135,466,185,470,217,403,334,122,362,449,349,285,101,114,281,194,210,410,200,400,199,428,306,387,146,102,375,209,75,139,100,214,295,187,284,230,175 -0.65,136,80,343,113,146,367,303,463,507,284,211,365,259,522,44,261,122,188,1135,253,305,97,252,234,54,217,220,114,203,194,151,163,201,233,284,603,170,247,299,564,255,333,373,256,244,152,301,86,125,149,263,457,420,431,68,297,336,329,290,194,230,288,161,124,108,201,1089,296,233,737,351,253,38,688,448,148,807,273,119,131,514,98,157,159,486,231,288,164,228,47,163,287,576,141,145,197,272,248,201,787 -0.70,272,201,329,67,281,293,356,217,213,372,266,346,434,143,264,390,341,296,142,263,330,102,384,669,602,275,149,259,225,227,339,222,397,422,474,274,481,337,585,344,387,308,222,249,396,615,321,310,135,187,296,225,362,146,222,157,336,307,187,486,89,217,223,277,262,235,157,548,249,119,403,348,550,326,273,428,322,225,192,240,824,779,343,146,406,96,268,144,653,344,527,121,224,562,416,180,166,151,201,64 -0.75,815,131,219,257,95,270,177,38,283,207,451,478,422,108,331,666,573,281,139,102,179,218,87,284,274,370,173,130,235,534,420,219,174,352,234,343,337,171,302,276,1122,220,236,181,200,423,208,348,191,205,346,545,333,438,178,281,270,203,90,238,436,66,236,561,174,299,188,147,140,217,298,263,244,84,639,126,285,233,159,138,47,378,845,166,317,236,480,91,306,163,325,732,106,271,299,398,125,238,588,306 -0.80,295,191,493,205,1165,763,1031,238,69,412,56,509,356,336,97,722,106,524,239,403,493,337,270,341,112,147,448,603,356,130,336,490,854,672,253,188,375,442,308,222,625,353,216,160,265,442,263,464,143,261,686,319,160,413,237,128,147,165,391,478,632,598,333,187,463,433,253,357,134,84,671,224,273,334,185,142,666,200,112,270,113,221,1003,432,210,414,194,187,101,292,69,424,862,190,306,235,339,268,64,178 -0.85,221,61,356,234,367,238,586,474,171,168,411,157,295,304,242,118,245,361,250,856,256,194,738,391,499,213,234,411,1910,369,455,315,800,85,212,117,200,518,99,76,796,640,335,256,225,415,612,123,141,301,154,313,329,812,414,104,648,657,192,163,544,1346,305,229,131,4275,222,374,484,386,139,287,734,251,187,232,688,293,718,276,156,507,289,395,493,152,107,905,184,507,267,307,437,724,241,518,238,183,379,285 -0.90,651,606,207,546,347,1180,121,112,1135,135,203,396,245,275,354,130,320,254,255,148,291,263,448,344,237,357,211,318,700,212,234,545,240,404,277,438,391,383,402,551,392,131,740,643,393,373,288,297,403,342,288,234,319,352,869,396,277,595,87,150,833,710,129,520,619,151,150,375,860,243,282,242,296,549,426,100,890,315,505,451,184,167,643,154,56,252,147,915,463,139,227,697,386,324,292,625,66,161,420,526 -0.95,421,588,274,114,492,232,230,464,736,233,182,92,401,208,116,357,313,200,308,331,4166,440,575,1279,104,849,42,246,657,2075,203,85,1028,963,1433,696,221,169,168,276,166,238,434,713,1769,295,638,386,186,255,167,382,830,242,1249,260,592,1796,816,359,416,202,3354,928,220,343,596,57,146,705,313,309,500,138,482,57,309,590,913,380,311,212,286,324,950,894,532,525,231,2050,537,72,616,220,273,307,836,105,324,332 -1.00,898,274,43,1486,173,433,52,573,214,154,602,339,66,719,378,366,857,438,246,775,1006,551,390,182,479,365,473,765,487,1763,759,185,335,286,369,138,220,240,307,669,239,402,180,254,224,240,327,197,2168,363,364,139,485,1176,322,257,707,667,208,794,166,2786,769,147,525,584,329,667,1233,613,456,3296,386,216,684,956,217,1735,662,146,447,99,681,38,1009,133,258,935,229,878,283,499,304,155,611,532,1257,621,394,564 diff --git a/con.txt b/con.txt deleted file mode 100644 index 90f4d05..0000000 --- a/con.txt +++ /dev/null @@ -1,20 +0,0 @@ -0.05,8565,3803,4010,5419,1733,4070,7502,7880,12776,2242,10489,4384,23578,14718,17801,7770,4097,5905,4027,5969,8492,1994,1542,18577,2346,13550,2279,5072,15109,4419,10970,6150,2359,3093,7131,5932,18531,6887,22726,4925,3320,6832,13704,10372,22945,4526,12461,1831,20964,21963,2749,7112,3260,14907,9168,7133,6590,21075,5302,2546,10164,3101,3204,7850,14204,4431,12038,13430,13976,7385,7647,9634,12230,6635,9532,4181,12857,10473 -0.1,1550,4416,3473,2821,2101,3635,5168,9641,7074,5623,2571,2253,2595,4347,24575,4239,4552,6372,6638,2686,1976,7638,2479,3555,4496,2321,11712,1934,3668,9398,1312,4422,3217,9472,7053,5539,2140,2928,1576,12121,5023,2458,5947,2374,10197,1701,6186,7013,3061,3108,1856,4052,2327,2287,2026,1606,1567,2414,3756,2648,3409,4195,4803,11940,2171,1574,2656,3221,2044,2250,1528,1348,7785,3141,6622,4520,2118,2489,7125,4182,1495,2475,5037,3839,4218,1929,2302,5339,1827,5444,3710,2555,2373,2108 -0.15,2328,3189,5422,1943,2057,1630,1405,2079,8071,22741,4056,1704,2727,2339,10381,1246,1831,6658,2760,9416,4036,1243,3716,1199,8678,5480,4038,1133,3576,3852,4014,1487,5849,4275,3766,2240,3917,2164,3695,1954,1869,1854,1751,2785,2334,2821,5942,1310,1680,7867,1987,2345,1785,3898,1598,4382,2881,4874,2345,2483,3962,8058,10204,6444,2885,8494,5135,7150,1041,8020,24960,1720,3546,3751,2077,2269,6051,5372,4247,10739,7114,1169,1757,1162,2699,1765,1367,3226,2290,3695,1756,2452,7385,2599,1426,7600,15285,4712 -0.2,1406,918,2393,1369,1913,2101,5855,1967,2146,8616,1630,6279,3109,6358,2462,2387,2113,1580,1679,3521,1354,6432,1156,5562,4964,2883,1622,2395,2259,2620,5165,597,1678,1499,3081,1663,1445,915,1385,980,1794,3339,2668,2901,3156,775,1432,2226,1790,2057,2441,1090,1165,839,5338,1085,3086,1336,2527,1392,892,1498,3915,4456,852,1467,3217,3454,2225,8179,1410,1390,3432,958,714,920,1543,1432,5129,2868,1236,917,7646,12936,5340,1456,2233,1176,1113,2152,2637,4778,3093,1706,1465,4785,1633,940,2669,2219 -0.25,2467,2964,947,4283,3290,887,3352,5430,2617,2126,1285,1493,3685,1348,1680,3302,5434,2659,1528,836,1387,1164,1339,3796,8728,1008,3197,2314,1852,1302,1338,1531,2064,1034,3022,4221,1165,1820,588,2878,1330,1504,2328,1000,1758,1217,1243,1127,1385,19537,2437,4459,1488,3603,1604,974,1756,1468,2696,2511,4003,3352,1015,1150,1341,1916,1552,13896,4017,935,3175,1430,1494,1165,10492,2132,1478,5363,4016,1730,1262,4001,774,2865,4585,909,1759,993,3900,1446,2101,1542,1791,4580,3227,1322,914,1014,5030,3115 -0.3,5105,2480,2842,1427,860,5434,2914,3608,2814,2037,775,654,2607,1418,786,1093,6668,967,2877,3091,2022,1799,2963,741,1352,1126,915,2413,1938,1709,2025,1192,1787,2065,1319,4872,1162,1752,3669,971,1702,3016,718,5211,2023,2113,1912,1419,1271,1323,2039,2624,2886,1404,1914,872,1292,1102,3544,2138,953,1698,800,2866,1492,1640,1270,12637,2851,3677,2295,4025,16097,2613,2591,2223,4112,1563,2441,1120,1886,2588,1559,1690,3034,937,847,6815,1616,1398,2439,1087,1603,841,4226,2110,1412,1852,2030,1651 -0.35,2154,1462,564,1702,1024,1400,960,2879,1226,2021,3619,951,4514,878,1796,2912,2112,1128,6131,733,2392,1413,2338,1437,1694,1440,1667,1714,1025,1625,2729,1200,4780,1431,2054,4221,21191,2106,2524,1742,1743,2546,1435,2707,1590,1228,2792,6297,1181,2126,2354,4585,736,1181,797,1287,1167,2023,947,628,2975,1069,1803,1558,4170,1695,3664,2169,1026,1381,1914,1497,1547,1508,3400,1533,1706,1511,973,1514,1334,833,3001,1891,1171,1797,1867,1107,1066,1180,710,2204,2308,2090,4976,3246,3289,2952,2053,1858 -0.40,1358,2175,1946,3255,3528,1126,3074,3633,2082,3648,1478,2562,3231,2679,1471,2027,1011,2322,2608,1063,1191,2552,2487,1648,4293,1907,1158,1239,1650,2524,1264,1676,2506,2911,1078,1664,2119,1234,4422,1787,1264,1923,2271,617,1489,2358,1089,2072,3087,1224,1261,761,2000,1166,1197,3519,816,2670,3148,1543,2279,973,2901,2117,2817,2979,1035,2630,501,884,901,1088,3228,1340,2681,1404,999,880,2641,2097,1168,5745,1426,1621,2584,1248,860,867,1987,844,2770,1839,1387,8928,1918,2712,1874,4033,2830,1160 -0.45,952,3145,3339,1530,2135,1357,2356,3650,2091,3197,2500,2467,1558,1743,2915,1107,1560,1467,1984,4573,1161,1532,2155,3748,3453,1670,3841,2159,6404,1278,1013,3146,3325,1537,1202,3885,3577,847,3355,1316,773,1269,7931,759,3015,1318,1848,1707,3255,2499,1592,3410,1890,1461,1025,1330,2008,2333,838,798,4177,3636,4507,3540,3155,1250,2368,4013,1714,1045,1268,2063,3622,1994,2293,1280,2493,3504,1371,1539,1616,722,2119,6346,1275,2904,4186,3192,1409,2475,966,2020,1789,2340,2919,1735,3885,1880,2238,1097 -0.50,2374,4721,1629,1025,1505,3695,1230,1273,1615,1390,7918,3475,2994,1421,10052,1094,4076,1060,2741,10973,18456,2725,2103,909,6923,2194,8988,6814,2834,1035,6925,8001,1394,1356,1668,1536,1633,1029,3789,3673,2044,4382,1978,1337,2870,1469,929,1041,2102,1395,3240,2511,4085,1021,1881,4816,2775,2959,629,1489,2970,2494,1653,8340,1005,13202,1187,14008,2906,1174,3777,6520,2468,3466,5371,4582,2002,3097,913,3358,2075,1522,1651,2916,2235,1341,2166,2797,3426,1181,1320,3434,3799,1107,1523,13668,1183,2368,698,5306 -0.55,2647,1750,2096,2452,10203,3576,3104,4698,3485,1774,3832,1944,2167,706,5664,1154,2000,2251,2947,1433,3874,1247,783,6218,2633,3426,4620,3234,1425,1348,6754,9355,6974,9257,1669,1237,4517,1173,3650,3293,2227,1132,8711,6037,4353,2363,1788,3505,1206,1706,2020,2427,2429,2819,3784,3714,2489,943,4019,1275,651,4592,5342,1367,4862,4260,5722,1937,2618,1715,1719,14424,2459,1758,5275,619,3354,1439,1834,3520,1539,4790,1338,1385,3732,747,5776,4451,1812,1780,1459,4366,1624,2262,4316,2707,634,1521,2472 -0.60,3791,2167,4108,1529,6057,10906,1848,3916,2554,2260,10363,3852,1868,4647,2310,2445,4288,6644,4171,1847,3360,3840,9454,3431,5358,1506,3422,2613,8244,1601,3807,2675,1066,10286,1533,12266,1587,6858,1335,4647,6590,4669,6556,1865,4763,3360,1336,2594,3571,1451,3525,4525,10153,1950,1550,1622,4162,4054,3396,2066,7273,5209,1565,17691,3451,6348,8727,5952,1031,1667,1334,1739,4680,2429,4557,2444,1913,2060,5295,11317,4703,1610,5416,1454,5184,3950,1121,1682,836,1488,3644,8243,1917,9651,5226,3574,1816,11354 -0.65,2927,2667,6480,3327,1148,20622,1159,1995,11561,1387,3423,8214,4808,2243,895,12123,3130,4774,18643,1420,2069,8101,1203,2343,3404,812,7383,3894,1275,7371,2794,2107,4178,4916,906,1482,6988,5286,3549,825,14992,4329,9648,12596,1520,1953,1714,16021,1544,9407,12398,1461,3339,2375,3976,6882,1225,5720,4793,2890,978,9106,1114,2978,6228,1833,1369,1516,5869,3312,1511,1897,13421,2159,5183,5017,4529,2060,9510,1367,13258,2115,2921,3235,1910,7535,3969,1416,2256,8444,4304,2881,3293,4981,3895,1728,10426,11769 -0.70,1873,4185,17340,4931,5268,2872,995,1878,6787,5225,2391,2046,796,7451,4642,2507,4279,2829,3556,7686,2601,6621,5950,1451,7073,5008,4269,19619,6826,1939,18936,2616,1352,1546,4311,2623,9623,3558,3586,7553,6106,1623,2159,5808,3135,7249,2643,4079,2036,3324,1584,8870,2322,8866,8451,6603,9716,18438,1468,7903,7222,1878,12807,5844,1268,2276,13139,8881,11004,4889,1717,5348,7186,2271,1639,2325,6008,2738,3918,3949,1502,2461,2454,5256,3672,1521,1480,7782,2869,796,12067,11323,2872 -0.75,5316,6466,2819,1521,8721,5240,2167,7393,23803,2967,11932,9338,17412,11452,16091,1828,11745,2245,24697,1786,5518,2423,2680,7215,7624,4498,6302,19095,1255,8959,2094,11525,7324,13853,2935,23283,11041,3041,5165,22986,3130,21531,13741,6549,3985,3451,14035,5976,13429,6650,5788,19359,7972,4733,13785,3008,2927,5636,4063,1151,1713,4341,22161,2441,3818,2231,11920,17832,13841,16102,8596,3899,11222,940,10479,10952,2209,19993,12426,4239,13743,4139,10398,2877,1111,4726 -0.80,19870,3288,13724,4492,8159,5058,16764,5648,9462,19071,3914,1242,8262,4036,9421,4914,2535,5362,7298,9587,1837,15272,14922,14138,7115,17236,5123,12157,6086,1672,15573,14241,2049,2602,6802,22362,7936,7544,5330,13155,16016,4544,1489,3780,6326,7794,2808,1493,7788,12646,22312,1681,12084,4163,2197,7950,22478,5106,4382,10615,2586,12214,4799,6297,7589,4585,15734,5480,8626,7387,11932,4245,21532,1710,12737,7132,4740,14578 -0.85,5493,10568,19366,5705,15430,8183,5721,13314,3753,23888,21843,6856,2803,9434,4794,10730,4484,23990,6350,16180,8099,4298,11220,4624,5946,24895,8464,4416,6619,2800,4081,12459,1981,12488,6380,9597,10328,1901,24563,13059,3639,12988,2604,4440,22666,1775,4078,5175,1144,3759,11119,1856,10831,2229,5333,17121,9698,14919,2353,3963,8189,13920,5301,16516,2446,3985 -0.90,24592,18962,2318,17604,14327,4999,9023,5562,7541,11799,8724,12642,2147,5909,5414,12572,10018,18962,3444,16813,16492,3991,7315,17775,11087,3479,2540,9597,13169,8588,2794,24864,19491,2673,5363,4799,5852,3757,1115,5798,24249,2576 -0.95,24269,14543,6828,3800,2930,12482,8749,17286,9802,7114,3756,14507,15139,1266,3794,15184,23713,6453,15157,7045,8048,6274,4713,5024,7315,8193,3695,2114,5084,12686,19158,20940,9037,15016,15530,11063,8586,15635,7196 -1.00,11364,6363,8012,19730,8425,21388,7864,18427,3126,9522,3180,4838,4078,22968,21540,4050,5612,4990,9933,1969,20399,3691,14813,14994,1577,1587,23322,22071,13903,3584,9721 diff --git a/convergence.txt b/convergence.txt deleted file mode 100644 index ba6b6c3..0000000 --- a/convergence.txt +++ /dev/null @@ -1,20 +0,0 @@ -0.05,300,2426,159,339,537,264,1223,298,314,295,177,343,272,256,214,105,87,2851,395,4537,9444,1,7466,25,1371,1020,112,5354,358,48,181,2327,112,21,682,504,2593,637,179,348,215,1294,1222,177,4454,974,1,24,4844,95,961,24,900,424,72,81,572,464,1280,1104,118,345,1748,506,2558,92,1977,804,1884,640,351,3124,2849,2360,708,143,177,209,69,1479,602,2108,2864,223,928,190,5142,79,774,540,1882,966,226,2262,295,2267,1536,103,244,2202 -0.1,76,346,1058,131,17,773,58,168,78,3976,3294,548,271,22,135,543,408,441,33,988,911,337,82,1368,1107,3645,6,64,783,388,110,1096,189,347,36,1115,46,79,76,385,400,1455,333,1259,224,417,17,75,1095,334,6,711,150,28,510,54,759,1,931,156,1176,221,218,404,661,221,103,44,154,56,116,3316,348,338,130,257,1243,278,150,488,65,1063,33,77,17,827,51,674,885,374,1354,1245,1391,87,70,420,47,118,484,51 -0.15,245,125,2100,41,73,69,75,262,43,91,48,10,80,2380,441,29,446,590,112,13,1496,50,131,633,262,851,738,43,167,95,1107,392,278,133,359,376,354,146,63,304,99,311,102,1047,123,298,757,158,5,33,1118,1727,169,182,265,24,39,62,53,442,6,50,127,523,729,192,19,268,351,1321,284,618,77,251,54,258,957,17,338,104,53,91,20,902,139,391,140,77,40,176,1066,7,1642,8,75,87,624,247,56,36 -0.2,160,24,239,85,142,27,94,138,554,348,104,266,3,164,59,37,28,885,629,14,22,193,306,288,55,841,95,75,146,19,349,110,167,3,14,166,71,61,554,244,362,341,47,96,229,101,968,878,785,1,20,82,6,30,396,172,3,170,244,71,750,86,137,76,71,273,177,72,12,150,470,31,879,766,472,1958,10,420,16,19,170,82,575,110,32,493,249,12,106,996,297,184,111,127,1641,148,73,46,42,433 -0.25,103,256,99,321,122,56,266,185,27,55,58,107,174,769,280,433,800,51,166,38,9,48,533,186,893,519,46,213,647,310,109,62,376,382,91,9,186,45,41,38,84,55,1725,128,161,693,325,270,38,1,588,953,26,201,494,79,235,224,65,260,57,843,111,357,526,59,328,893,372,826,26,506,125,168,414,71,24,22,144,270,530,140,261,297,13,181,1257,219,675,135,148,61,322,105,52,108,25,51,348,86 -0.3,179,82,59,15,42,10,13,69,121,30,240,264,93,41,27,537,32,462,145,20,270,98,25,105,78,81,155,411,75,94,120,229,44,183,41,122,281,344,11,314,30,223,200,42,26,52,12,85,799,521,187,44,420,17,109,323,51,169,114,6,133,20,558,85,6,252,54,23,245,139,22,140,320,177,91,773,92,87,26,60,380,226,198,198,178,453,541,210,237,7,158,70,128,483,101,854,75,217,156,121 -0.35,156,101,203,72,359,238,53,72,236,179,229,75,135,82,44,220,58,90,239,82,98,294,31,209,51,6,158,39,18,339,164,23,24,189,182,80,80,104,552,204,179,186,141,87,125,122,451,13,337,244,16,81,41,73,93,43,120,279,184,280,90,10,54,71,18,53,315,427,67,65,54,8,182,71,227,21,293,175,101,16,365,138,9,93,404,274,17,922,198,90,196,17,341,99,98,243,173,184,218,74 -0.40,45,30,405,378,48,534,78,5,107,180,71,35,833,313,48,140,68,125,215,105,104,152,41,83,90,14,105,65,127,16,116,234,99,25,392,54,311,139,122,36,164,124,135,113,61,254,91,137,23,201,92,278,88,100,153,91,96,53,36,309,217,8,31,169,17,236,304,223,37,214,56,658,63,115,3,13,69,52,76,33,225,81,59,2,66,84,2,52,67,8,509,51,139,82,51,198,5,22,71,80 -0.45,69,89,236,173,91,327,198,117,141,47,284,40,54,43,10,56,337,56,35,7,48,57,102,146,10,149,25,178,26,91,49,238,62,12,60,3,35,59,27,117,18,152,180,3,129,24,18,71,23,126,138,25,146,374,434,270,38,54,105,82,22,82,35,189,120,29,448,56,49,208,405,120,223,23,5,90,112,195,47,129,53,83,48,81,77,12,91,159,219,22,120,3,383,1,36,340,109,231,11,68 -0.50,905,53,32,251,57,219,103,87,145,32,174,150,33,75,61,69,78,49,22,1,121,248,45,45,242,40,115,257,58,113,283,157,152,53,634,260,23,101,77,7,139,32,47,218,66,32,68,46,182,2,65,204,175,91,3,102,124,96,283,331,3,63,78,32,1,34,48,68,54,192,91,28,1,31,18,326,273,13,166,415,36,20,80,40,14,64,5,17,29,115,115,209,209,28,47,3,34,48,97,32 -0.55,363,334,78,36,344,270,80,67,115,27,228,94,56,122,100,44,41,85,266,53,158,179,120,31,121,108,50,73,50,154,83,6,328,133,151,24,129,117,39,48,92,9,103,172,24,160,87,99,35,231,243,56,17,52,161,136,24,38,20,42,122,51,53,231,295,52,37,51,190,84,13,12,48,46,121,27,169,219,170,97,86,12,117,54,35,127,55,3,108,199,8,3,30,83,266,65,248,296,73,192 -0.60,144,14,172,55,264,46,56,59,290,256,211,97,90,29,242,90,16,31,25,59,75,74,66,240,155,6,57,53,282,190,61,129,37,23,3,260,361,22,57,125,43,102,36,59,36,81,148,40,39,62,32,232,158,2,1,63,414,38,194,137,51,183,387,15,37,75,40,69,313,23,271,54,178,50,11,47,25,70,273,58,52,11,21,36,92,174,144,47,120,38,66,84,195,342,99,186,164,64,221,15 -0.65,73,139,22,146,3,111,16,12,55,51,129,164,59,21,1,198,93,81,119,40,168,51,88,2,49,32,112,146,80,183,49,40,36,231,29,52,102,22,193,160,1,28,21,55,136,90,141,315,154,103,42,2,146,40,46,51,60,24,95,13,215,12,37,250,146,64,8,59,215,120,200,28,139,21,64,23,61,5,181,161,157,74,261,97,39,68,125,444,118,198,67,33,17,194,30,254,79,94,37,210 -0.70,74,103,14,73,123,115,128,93,12,54,1,34,78,294,77,27,5,17,46,31,255,154,83,59,66,152,125,103,28,94,73,79,110,290,3,100,208,42,28,193,120,278,170,141,169,45,143,121,145,127,91,97,126,287,80,97,79,83,102,109,241,280,247,26,90,84,104,78,99,218,17,256,380,135,18,17,121,72,119,50,35,46,54,219,55,113,185,178,140,55,121,155,126,4,8,115,40,13,98,12 -0.75,9,91,100,130,203,86,54,44,1,52,51,43,116,135,121,13,482,59,2,74,98,18,85,137,57,106,116,161,60,38,7,46,54,228,204,120,97,405,175,74,199,151,35,42,371,93,197,17,94,128,191,301,201,55,106,126,178,116,369,37,35,71,26,102,153,62,34,47,14,89,102,124,98,152,12,117,136,1,146,72,219,38,61,106,34,22,27,56,120,48,6,6,29,57,98,9,208,39,390,147 -0.80,42,45,81,110,48,158,63,40,60,106,52,90,129,105,81,193,54,67,164,79,302,86,237,160,204,213,18,50,37,85,168,148,84,213,13,25,185,25,8,20,69,78,312,62,255,50,248,144,223,3,34,161,132,138,113,39,60,83,65,20,94,96,196,51,30,58,147,22,84,102,109,189,79,124,196,58,147,69,33,130,82,10,290,77,39,48,76,158,202,60,178,20,132,39,19,85,186,108,35,222 -0.85,74,12,115,22,86,14,503,244,15,89,81,186,17,79,133,87,4,98,68,30,105,214,33,46,9,105,173,309,117,147,54,84,27,293,347,136,17,57,120,54,235,98,90,155,71,274,4,327,128,460,93,122,196,98,148,51,125,113,72,325,70,202,39,186,42,37,31,45,154,20,80,61,24,32,66,127,43,85,90,146,27,146,78,60,166,213,67,199,119,21,158,128,147,16,37,28,2,145,282,40 -0.90,31,147,81,271,124,26,142,48,49,103,61,114,62,188,135,220,56,100,107,267,4,372,165,227,26,226,180,241,50,83,39,217,480,208,95,58,55,95,28,66,370,32,37,10,11,292,85,470,173,185,1,331,116,593,47,365,140,88,189,73,17,15,250,100,483,210,65,72,89,52,48,53,47,164,94,4,141,143,140,263,50,135,1,152,67,68,59,166,114,11,41,224,26,40,81,224,132,49,439,41 -0.95,183,71,44,60,53,174,226,160,83,147,83,203,83,146,331,218,2,111,17,152,238,127,187,108,66,55,88,51,49,193,158,249,132,276,383,215,365,31,136,181,284,21,92,120,55,107,340,296,135,13,76,293,301,193,119,57,23,232,23,119,76,137,68,135,118,42,67,202,155,156,57,178,259,221,22,102,69,97,75,164,83,137,46,165,80,33,279,118,65,30,4,134,6,28,161,23,16,403,172,66 -1.00,264,486,133,12,484,71,319,98,96,110,251,22,221,201,39,6,28,384,280,105,41,226,298,135,341,117,125,432,180,89,73,146,199,17,70,354,264,50,137,147,343,393,332,59,128,44,21,569,123,285,110,153,15,168,142,361,216,331,22,338,132,124,371,28,4,77,125,466,48,231,254,231,8,287,96,114,162,201,154,247,220,133,123,2,175,71,213,280,74,25,343,480,70,206,22,23,92,107,204,91 diff --git a/convergenceAdv.txt b/convergenceAdv.txt deleted file mode 100644 index 1d40ebf..0000000 --- a/convergenceAdv.txt +++ /dev/null @@ -1,2 +0,0 @@ -0.05,5,5,5,5,5,5,5,5,5,5,5,5,56,56 -0.10,6,6,6,6,6,6,6,6,6 diff --git a/convergenceAdv2.txt b/convergenceAdv2.txt deleted file mode 100644 index 40dc883..0000000 --- a/convergenceAdv2.txt +++ /dev/null @@ -1,6 +0,0 @@ -0.05,8,64,62,15,84,5,72,183, -0.1,15,15,6,18,46,28,307, -0.15,177,20,12,9,21,4,6,65,173, -0.2,6,56,13,28,4,231,9,11,22, -0.25,92,37,11,4,310, -0.3,106,7,302,12,23,4,5,177, \ No newline at end of file diff --git a/convergenceAdvanced.txt b/convergenceAdvanced.txt new file mode 100644 index 0000000..827d701 --- /dev/null +++ b/convergenceAdvanced.txt @@ -0,0 +1,21 @@ +# 4 speeds, 4 distance. Distance, inJump and incomming speed; Monte Carlo +0.05,8565,3803,4010,30744,5419,1733,30335,4070,7502,7880,12776,2242,10489,4384,23578,14718,17801,7770,4097,5905,4027,5969,8492,1994,1542,18577,2346,13550,2279,5072,39861,15109,4419,10970,6150,2359,3093,7131,5932,18531,6887,22726,4925,3320,6832,13704,10372,25447,22945,28991,4526,12461,1831,20964,21963,2749,7112,3260,33941,14907,9168,7133,6590,21075,5302,2546,10164,3101,3204,7850,40776,38750,32898,14204,4431,12038,13430,13976,7385,7647,9634,12230,6635,9532,4181,12857,10473,2609,3827,4800,4316,5114,4153,6282,4737,5078,7358,11660,4750,16256 +0.1,1550,4416,3473,2821,2101,3635,5168,9641,7074,5623,2571,2253,2595,4347,24575,4239,4552,6372,6638,2686,33218,1976,7638,2479,3555,4496,2321,11712,1934,3668,9398,1312,4422,3217,9472,7053,5539,2140,2928,1576,12121,5023,2458,5947,2374,10197,1701,6186,7013,3061,3108,1856,4052,2327,2287,2026,1606,1567,2414,3756,2648,3409,4195,4803,11940,2171,1574,2656,3221,2044,2250,1528,1348,7785,3141,6622,25696,4520,2118,2489,7125,4182,1495,2475,5037,3839,4218,1929,2302,5339,1827,5444,3710,47322,2555,2373,2108,1550,4416,3473 +0.15,2328,3189,5422,1943,2057,1630,1405,2079,8071,22741,4056,1704,2727,2339,10381,1246,1831,6658,2760,9416,4036,1243,3716,1199,8678,5480,4038,42601,1133,3576,3852,4014,1487,5849,4275,3766,2240,3917,2164,3695,1954,1869,1854,1751,2785,2334,2821,5942,1310,1680,7867,1987,2345,1785,3898,1598,4382,2881,4874,2345,2483,3962,8058,10204,6444,2885,8494,5135,7150,1041,8020,24960,1720,45430,3546,3751,2077,2269,6051,5372,4247,10739,7114,1169,1757,1162,2699,1765,1367,3226,2290,3695,1756,2452,7385,2599,1426,7600,15285,4712 +0.2,1406,918,2393,1369,1913,2101,5855,1967,2146,8616,1630,6279,3109,6358,2462,2387,2113,1580,1679,3521,1354,6432,1156,5562,4964,2883,1622,2395,2259,2620,5165,597,1678,1499,3081,1663,1445,915,1385,980,1794,3339,2668,2901,3156,775,1432,2226,1790,2057,2441,1090,1165,839,5338,1085,3086,1336,2527,1392,892,1498,3915,4456,852,1467,3217,3454,2225,8179,1410,1390,3432,958,714,920,1543,1432,5129,2868,1236,917,7646,12936,5340,1456,2233,1176,1113,2152,2637,4778,3093,1706,1465,4785,1633,940,2669,2219 +0.25,2467,2964,947,4283,3290,887,3352,5430,2617,2126,1285,1493,3685,1348,1680,3302,5434,2659,1528,836,1387,1164,1339,3796,8728,1008,3197,2314,1852,1302,1338,1531,2064,1034,3022,4221,1165,1820,588,2878,1330,1504,2328,1000,1758,1217,1243,1127,1385,19537,2437,4459,1488,3603,1604,974,1756,1468,2696,2511,4003,3352,1015,1150,1341,1916,1552,13896,4017,935,3175,1430,1494,1165,10492,2132,1478,5363,4016,1730,1262,4001,774,2865,4585,909,1759,993,3900,1446,2101,1542,1791,4580,3227,1322,914,1014,5030,3115 +0.3,5105,2480,2842,1427,860,5434,2914,3608,2814,2037,775,654,2607,1418,786,1093,6668,967,2877,3091,2022,1799,2963,741,1352,1126,915,2413,1938,1709,2025,1192,1787,2065,1319,4872,1162,1752,3669,971,1702,3016,718,5211,2023,2113,1912,1419,1271,1323,2039,2624,2886,1404,1914,872,1292,1102,3544,2138,953,1698,800,2866,1492,1640,1270,12637,2851,3677,2295,4025,16097,2613,2591,2223,4112,1563,2441,1120,1886,2588,1559,1690,3034,937,847,6815,1616,1398,2439,1087,1603,841,4226,2110,1412,1852,2030,1651 +0.35,2154,1462,564,1702,1024,1400,960,2879,1226,2021,3619,951,4514,878,1796,2912,2112,1128,6131,733,2392,1413,2338,1437,1694,1440,1667,1714,1025,1625,2729,1200,4780,1431,2054,4221,21191,2106,2524,1742,1743,2546,1435,2707,1590,1228,2792,6297,1181,2126,2354,4585,736,1181,797,1287,1167,2023,947,628,2975,1069,1803,1558,4170,1695,3664,2169,1026,1381,1914,1497,1547,1508,3400,1533,1706,1511,973,1514,1334,833,3001,1891,1171,1797,1867,1107,1066,1180,710,2204,2308,2090,4976,3246,3289,2952,2053,1858 +0.4,1358,2175,1946,3255,3528,1126,3074,3633,2082,3648,1478,2562,3231,2679,1471,2027,1011,2322,2608,1063,1191,2552,2487,1648,4293,1907,1158,1239,1650,2524,1264,1676,2506,2911,1078,1664,2119,1234,4422,1787,1264,1923,2271,617,1489,2358,1089,2072,3087,1224,1261,761,2000,1166,1197,3519,816,2670,3148,1543,2279,973,2901,2117,2817,2979,1035,2630,501,884,901,1088,3228,1340,2681,1404,999,880,2641,2097,1168,5745,1426,1621,2584,1248,860,867,1987,844,2770,1839,1387,8928,1918,2712,1874,4033,2830,1160 +0.45,952,3145,3339,1530,2135,1357,2356,3650,2091,3197,2500,2467,1558,1743,2915,1107,1560,1467,1984,4573,1161,1532,2155,3748,3453,1670,3841,2159,6404,1278,1013,3146,3325,1537,1202,3885,3577,847,3355,1316,773,1269,7931,759,3015,1318,1848,1707,3255,2499,1592,3410,1890,1461,1025,1330,2008,2333,838,798,4177,3636,4507,3540,3155,1250,2368,4013,1714,1045,1268,2063,3622,1994,2293,1280,2493,3504,1371,1539,1616,722,2119,6346,1275,2904,4186,3192,1409,2475,966,2020,1789,2340,2919,1735,3885,1880,2238,1097 +0.5,2374,4721,1629,1025,1505,3695,1230,1273,1615,1390,7918,3475,2994,1421,10052,1094,4076,1060,2741,10973,18456,2725,2103,909,6923,2194,8988,6814,2834,1035,6925,8001,1394,1356,1668,1536,1633,1029,3789,3673,2044,4382,1978,1337,2870,1469,929,1041,2102,1395,3240,2511,4085,1021,1881,4816,2775,2959,629,1489,2970,2494,1653,8340,1005,13202,1187,14008,2906,1174,3777,6520,2468,3466,5371,4582,2002,3097,913,3358,2075,1522,1651,2916,2235,1341,2166,2797,3426,1181,1320,3434,3799,1107,1523,13668,1183,2368,698,5306 +0.55,2647,1750,2096,2452,10203,3576,3104,4698,3485,1774,3832,1944,2167,706,5664,1154,2000,2251,2947,1433,3874,1247,783,6218,2633,3426,4620,3234,1425,1348,6754,9355,6974,9257,1669,1237,4517,1173,3650,3293,25827,2227,1132,8711,6037,4353,2363,1788,3505,1206,1706,2020,2427,2429,2819,3784,3714,2489,943,4019,1275,651,4592,5342,1367,4862,4260,5722,1937,2618,1715,1719,14424,2459,1758,5275,619,3354,1439,1834,3520,1539,4790,1338,1385,3732,747,5776,4451,1812,1780,1459,4366,1624,2262,4316,2707,634,1521,2472 +0.6,3791,2167,4108,1529,6057,10906,1848,3916,2554,2260,10363,3852,1868,4647,2310,2445,4288,6644,4171,1847,3360,3840,9454,3431,5358,1506,3422,2613,8244,1601,3807,2675,1066,10286,1533,12266,1587,6858,1335,4647,6590,4669,6556,1865,4763,3360,1336,2594,3571,1451,3525,4525,10153,1950,1550,1622,4162,4054,3396,2066,7273,5209,1565,17691,3451,6348,8727,5952,1031,1667,1334,1739,4680,2429,4557,2444,1913,2060,5295,15284,4703,1610,5416,1454,5184,3950,1121,1682,836,28294,1488,3644,8243,1917,9651,5226,3574,1816,11354,3791 +0.65,2927,2667,6480,3327,1148,20622,1159,1995,11561,1387,3423,8214,4808,2243,895,12123,3130,4774,18643,1420,2069,8101,1203,2343,3404,812,7383,3894,1275,7371,2794,2107,4178,4916,906,1482,6988,5286,3549,825,14992,45974,4329,9648,12596,1520,1953,1714,16021,1544,9407,12398,1461,3339,2375,3976,6370,1225,5720,4793,2890,978,9106,35243,1114,2978,6228,1833,1369,1516,5869,3312,1511,1897,13421,2159,5183,5017,4529,2060,9510,1367,13258,2115,2921,3235,1910,7535,3969,1416,2256,8444,4304,2881,3293,4981,3895,1728,10426,11769 +0.7,1873,4185,17340,4931,5268,2872,995,1878,6787,5225,2391,2046,796,7451,4642,2507,4279,2829,3556,7686,2601,6621,5950,1451,7073,5008,4269,19619,6826,1939,18936,2616,1352,1546,4311,2623,9623,3558,3586,7553,6106,1623,2159,5808,3135,7249,2643,27678,4079,2036,27513,3324,1584,8870,2322,8866,8451,6603,9716,18438,25974,1468,7903,7222,1878,12807,5844,1268,2276,13139,8881,11004,4889,1717,5348,7186,2271,1639,2325,25466,6008,28975,2738,3918,3949,1502,2461,2454,5256,3672,1521,1480,7782,2869,796,12067,11323,2872,17587,8254 +0.75,5316,6466,2819,1521,8721,5240,2167,7393,23803,2967,11932,37884,9338,17412,11452,16091,1828,11745,2245,24697,1786,25564,5518,2423,2680,7215,7624,4498,6302,19095,1255,26793,8959,2094,11525,7324,13853,2935,23283,11041,3041,5165,22986,30790,3130,33125,21531,13741,6549,40701,3985,3451,14035,5976,13429,6650,5788,19359,7972,4733,13785,3008,2927,5636,4063,1151,1713,4341,22161,2441,3818,27604,2231,11920,17832,13841,16102,8596,3899,11222,35054,940,47249,10479,10952,2209,36197,19993,12426,4239,13743,4139,10398,2877,1111,4726,67426,32716,16350,5256 +0.8,19870,3288,13724,4492,8159,5058,16764,5648,9462,19071,3914,1242,8262,26004,4036,9421,4914,2535,5362,7298,9587,37133,1837,35325,15272,14922,14138,7115,17236,5123,12157,37380,6086,37390,1672,15573,14241,2049,2602,6802,22362,7936,7544,5330,13155,16016,4544,1489,3780,6326,7794,31553,2808,1493,7788,12646,30464,22312,1681,12084,4163,2197,7950,22478,5106,26771,4382,10615,2586,12214,4799,6297,7589,4585,30365,32302,15734,5480,8626,7387,11932,4245,21532,1710,12737,7132,4740,14578,10680,8266,17300,4213,3264,35920,38026,10272,3984,2279,9739,33900 +0.85,5493,10568,19366,5705,15430,8183,5721,13314,36667,33059,3753,40243,23888,25085,21843,6856,2803,9434,4794,29944,10730,39271,4484,23990,6350,16180,8099,4298,11220,4624,5946,24895,8464,4416,6619,2800,4081,12459,1981,12488,6380,9597,10328,1901,24563,13059,3639,12988,2604,4440,22666,1775,4078,5175,1144,3759,11119,1856,34970,10831,2229,5333,17121,9698,14919,2353,3963,8189,36145,13920,5301,16516,2446,46848,3985,,20640,151501,17556,1882,44216,39795,1638,57957,62050,3130,3693,5563,9780,3327,22969,39357,13749,37555,60070,9249,35426,4405,8340,18973 +0.9,27355,24592,18962,2318,17604,35725,14327,38167,25602,50236,4999,9023,5562,7541,11799,25139,8724,12642,28509,57095,2147,5909,5414,12572,10018,68830,45393,18962,51656,25601,3444,45667,16813,57110,16492,3991,7315,17775,69277,34769,29824,11087,26371,3479,2540,9597,32593,13169,8588,2794,40136,56004,65307,24864,35523,19491,2673,5363,4799,5852,28566,42427,44011,40146,3757,1115,49574,5798,24249,2576,118943,6169,65584,7057,49505,116138,52083,1809,127776,3214,25689,103442,15260,62754,12390,3233,35309,68989,6615,30593,2503,29359,98237,11900,3240,64969,84134,25361,7384,13141 +0.95,24269,14543,6828,3800,41079,47279,27177,17286,9802,7114,3756,85275,14507,34993,15139,15184,90742,27554,23713,6453,15157,7045,8048,47550,84540,93729,68601,6274,4713,30578,5024,94239,7315,8193,46871,96466,3695,70915,62947,32258,66228,2114,5084,12686,62905,19158,20940,36270,9037,34034,15016,15530,46276,11063,8586,15635,7196,70708,50836,22464,13463,86986,43541,2001,40565,28534,44700,5625,6552,16140,2450,8492,3304,22904,20951,100472,131147,131728,43674,514,79827,181148,31431,4761,1515,2075,138139,137795,71014170145,60000,42790,179835,18982,48085,28398,56788,126115,5442,118289,9386 +1.0,11364,6363,8012,109822,19730,8425,21388,7864,18427,34072,3126,52381,35105,86487,73913,88033,76264,105864,30103,9522,31049,3180,4838,4078,133687,39236,59239,22968,21540,98395,109063,4050,5612,4990,9933,83766,140114,116077,135653,130826,130070,92207,14994,87801,1577,70868,133816,79790,1587,23322,22071,13903,3584,9721,,38605,52375,67392,10075,97733,46173,29647,2558,28151,162569,4054,10537,30871,45538,97835,45132,35042,70203,3862,100614,84525,140691,81880,80914,35187,11596,51448,2945,56551,39236,84707,64324,100588,78645,12929,32701,63306,163991,2864,34802,72929,198161,71332,98627,137754 diff --git a/src/main/java/core/algo/EpisodicLearning.java b/src/main/java/core/algo/EpisodicLearning.java index 05a84d5..a91ad19 100644 --- a/src/main/java/core/algo/EpisodicLearning.java +++ b/src/main/java/core/algo/EpisodicLearning.java @@ -5,7 +5,7 @@ import core.Environment; import core.LearningConfig; import core.StepResult; import core.listener.LearningListener; -import example.DinoSampling; +import core.policy.EpsilonGreedyPolicy; import lombok.Getter; import lombok.Setter; @@ -104,10 +104,10 @@ public abstract class EpisodicLearning extends Learning imple timestamp++; timestampCurrentEpisode++; // TODO: more sophisticated way to check convergence - if(timestampCurrentEpisode > 50000) { + if(timestampCurrentEpisode > 300000){ converged = true; // t - File file = new File(DinoSampling.FILE); + File file = new File(DinoSampling.FILE_NAME); try { Files.writeString(Path.of(file.getPath()), currentEpisode/2 + ",", StandardOpenOption.APPEND); } catch (IOException e) { diff --git a/src/main/java/core/algo/td/QLearningOffPolicyTDControl.java b/src/main/java/core/algo/td/QLearningOffPolicyTDControl.java index 274e2ab..69919fa 100644 --- a/src/main/java/core/algo/td/QLearningOffPolicyTDControl.java +++ b/src/main/java/core/algo/td/QLearningOffPolicyTDControl.java @@ -39,14 +39,23 @@ public class QLearningOffPolicyTDControl extends EpisodicLearnin sumOfRewards = 0; while(envResult == null || !envResult.isDone()) { actionValues = stateActionTable.getActionValues(state); - A action = policy.chooseAction(actionValues); - + A action; + if(currentEpisode % 2 == 0){ + action = greedyPolicy.chooseAction(actionValues); + }else{ + action = policy.chooseAction(actionValues); + } + if(converged) return; // Take a step envResult = environment.step(action); double reward = envResult.getReward(); State nextState = envResult.getState(); sumOfRewards += reward; - + if(currentEpisode % 2 == 0){ + state = nextState; + dispatchStepEnd(); + continue; + } // Q Update double currentQValue = stateActionTable.getActionValues(state).get(action); // maxQ(S', a); diff --git a/src/main/java/core/algo/td/SARSA.java b/src/main/java/core/algo/td/SARSA.java index 10c9346..336516d 100644 --- a/src/main/java/core/algo/td/SARSA.java +++ b/src/main/java/core/algo/td/SARSA.java @@ -3,12 +3,15 @@ package core.algo.td; import core.*; import core.algo.EpisodicLearning; import core.policy.EpsilonGreedyPolicy; +import core.policy.GreedyPolicy; +import core.policy.Policy; import java.util.Map; public class SARSA extends EpisodicLearning { private float alpha; + private Policy greedyPolicy = new GreedyPolicy<>(); public SARSA(Environment environment, DiscreteActionSpace actionSpace, float discountFactor, float epsilon, float learningRate, int delay) { super(environment, actionSpace, discountFactor, delay); @@ -32,10 +35,18 @@ public class SARSA extends EpisodicLearning { StepResultEnvironment envResult = null; Map actionValues = stateActionTable.getActionValues(state); - A action = policy.chooseAction(actionValues); + A action; + if(currentEpisode % 2 == 1){ + action = greedyPolicy.chooseAction(actionValues); + }else{ + action = policy.chooseAction(actionValues); + } + //A action = policy.chooseAction(actionValues); sumOfRewards = 0; while(envResult == null || !envResult.isDone()) { + + if(converged) return; // Take a step envResult = environment.step(action); sumOfRewards += envResult.getReward(); @@ -44,8 +55,20 @@ public class SARSA extends EpisodicLearning { // Pick next action actionValues = stateActionTable.getActionValues(nextState); - A nextAction = policy.chooseAction(actionValues); + A nextAction; + if(currentEpisode % 2 == 1){ + nextAction = greedyPolicy.chooseAction(actionValues); + }else{ + nextAction = policy.chooseAction(actionValues); + } + //A nextAction = policy.chooseAction(actionValues); + if(currentEpisode % 2 == 1){ + state = nextState; + action = nextAction; + dispatchStepEnd(); + continue; + } // td update // target = reward + gamma * Q(nextState, nextAction) double currentQValue = stateActionTable.getActionValues(state).get(action); diff --git a/src/main/java/core/policy/EpsilonPolicy.java b/src/main/java/core/policy/EpsilonPolicy.java index 7c34006..e6da16e 100644 --- a/src/main/java/core/policy/EpsilonPolicy.java +++ b/src/main/java/core/policy/EpsilonPolicy.java @@ -1,8 +1,8 @@ package core.policy; /** - * Chooses the action with the highest values with possibility: 1-Ɛ + Ɛ/|A| - * With possibility of Ɛ, a random action is taken (highest values option included). + * Chooses the action with the highest values with possibility: 1-Epsilon + Epsilon/|A| + * With possibility of Epsilon, a random action is taken (highest values option included). * * @param Enum class of available action in specific environment */ diff --git a/src/main/java/evironment/antGame/AntStateOriginal.java b/src/main/java/evironment/antGame/AntStateOriginal.java new file mode 100644 index 0000000..6911e87 --- /dev/null +++ b/src/main/java/evironment/antGame/AntStateOriginal.java @@ -0,0 +1,46 @@ +package evironment.antGame; + +import core.State; +import lombok.AllArgsConstructor; + +import java.util.Objects; + +@AllArgsConstructor +public class AntStateOriginal implements State { + private final int currentFood; + private final int row; + private final int col; + private final CellType type; + private final int smell; + private final int food; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + AntStateOriginal that = (AntStateOriginal) o; + return currentFood == that.currentFood && + row == that.row && + col == that.col && + smell == that.smell && + type == that.type && + food == that.food; + } + + @Override + public int hashCode() { + return Objects.hash(currentFood, row, col, type, smell, food); + } + + @Override + public String toString() { + return "AntStateOriginal{" + + "currentFood=" + currentFood + + ", row=" + row + + ", col=" + col + + ", type=" + type + + ", smell=" + smell + + ", food=" + food + + '}'; + } +} diff --git a/src/main/java/evironment/antGame/AntWorld.java b/src/main/java/evironment/antGame/AntWorld.java index d7aaa94..9f35bfc 100644 --- a/src/main/java/evironment/antGame/AntWorld.java +++ b/src/main/java/evironment/antGame/AntWorld.java @@ -134,9 +134,6 @@ public class AntWorld implements Environment, Visualizable { @Override public StepResultEnvironment step(AntAction action){ - AntObservation observation; - State newState; - StepCalculation sc = processStep(action); // valid movement @@ -149,11 +146,7 @@ public class AntWorld implements Environment, Visualizable { } } - // get observation after action was computed - observation = new AntObservation(grid.getCell(myAnt.getPos()), myAnt.getPos(), myAnt.hasFood()); - // let the ant agent process the observation to create a valid markov state - newState = antAgent.feedObservation(observation); if(sc.checkCompletion) { sc.done = grid.isAllFoodCollected(); @@ -163,7 +156,15 @@ public class AntWorld implements Environment, Visualizable { sc.done = true; } - return new StepResultEnvironment(newState, sc.reward, sc.done, sc.info); + return new StepResultEnvironment(generateReturnState(), sc.reward, sc.done, sc.info); + } + + protected State generateReturnState(){ + // get observation after action was computed + AntObservation observation = new AntObservation(grid.getCell(myAnt.getPos()), myAnt.getPos(), myAnt.hasFood()); + + // let the ant agent process the observation to create a valid markov state + return antAgent.feedObservation(observation); } protected boolean isInGrid(Point pos) { diff --git a/src/main/java/evironment/antGame/AntWorldContinuous.java b/src/main/java/evironment/antGame/AntWorldContinuous.java index 0800ea6..cf30d2e 100644 --- a/src/main/java/evironment/antGame/AntWorldContinuous.java +++ b/src/main/java/evironment/antGame/AntWorldContinuous.java @@ -1,5 +1,6 @@ package evironment.antGame; +import core.State; import core.StepResultEnvironment; public class AntWorldContinuous extends AntWorld { @@ -13,7 +14,6 @@ public class AntWorldContinuous extends AntWorld { @Override public StepResultEnvironment step(AntAction action) { - AntObservation observation; Cell currentCell = grid.getCell(myAnt.getPos()); StepCalculation sc = processStep(action); @@ -27,10 +27,13 @@ public class AntWorldContinuous extends AntWorld { myAnt.getPos().setLocation(sc.potentialNextPos); } - // get observation after action was computed - observation = new AntObservation(grid.getCell(myAnt.getPos()), myAnt.getPos(), myAnt.hasFood()); + return new StepResultEnvironment(generateReturnState(), sc.reward, false, sc.info); + } - return new StepResultEnvironment(new AntState(grid.getGrid(), observation.getPos(), observation.hasFood()), sc.reward, false, sc.info); + @Override + protected State generateReturnState(){ + AntObservation observation = new AntObservation(grid.getCell(myAnt.getPos()), myAnt.getPos(), myAnt.hasFood()); + return new AntState(grid.getGrid(), observation.getPos(), observation.hasFood()); } } diff --git a/src/main/java/evironment/antGame/AntWorldContinuousOriginalState.java b/src/main/java/evironment/antGame/AntWorldContinuousOriginalState.java new file mode 100644 index 0000000..6a4c500 --- /dev/null +++ b/src/main/java/evironment/antGame/AntWorldContinuousOriginalState.java @@ -0,0 +1,36 @@ +package evironment.antGame; + +import core.State; + +public class AntWorldContinuousOriginalState extends AntWorldContinuous { + public AntWorldContinuousOriginalState(int width, int height) { + super(width, height); + } + + public AntWorldContinuousOriginalState() { + super(); + } + + @Override + protected State generateReturnState(){ + return new AntStateOriginal(myAnt.hasFood()? 1:0, myAnt.getPos().x, myAnt.getPos().y, grid.getCell(myAnt.getPos()).getType(), calculateSmell(), grid.getCell(myAnt.getPos()).getFood()); + } + + /** + * @return total smell of neighbour food cells + */ + private int calculateSmell(){ + int smell = 0; + int maxX = grid.getGrid().length -1; + int maxY = grid.getGrid()[0].length -1; + int antX = myAnt.getPos().x; + int antY = myAnt.getPos().y; + + smell += antY > 0 ? grid.getCell(antX, antY - 1).getFood() : 0; + smell += antY < maxY ? grid.getCell(antX, antY + 1).getFood() : 0; + smell += antX > 0 ? grid.getCell(antX - 1, antY).getFood() : 0; + smell += antX < maxX ? grid.getCell(antX + 1, antY).getFood() : 0; + + return smell; + } +} diff --git a/src/main/java/evironment/antGame/CellType.java b/src/main/java/evironment/antGame/CellType.java index 68dc66b..4e51d16 100644 --- a/src/main/java/evironment/antGame/CellType.java +++ b/src/main/java/evironment/antGame/CellType.java @@ -1,6 +1,7 @@ package evironment.antGame; -public enum CellType { + +public enum CellType{ START, FREE, OBSTACLE, diff --git a/src/main/java/evironment/antGame/Grid.java b/src/main/java/evironment/antGame/Grid.java index a6b9538..dd23e78 100644 --- a/src/main/java/evironment/antGame/Grid.java +++ b/src/main/java/evironment/antGame/Grid.java @@ -64,8 +64,8 @@ public class Grid { if(potFieldType != CellType.START && grid[potFood.x][potFood.y].getFood() == 0 && potFieldType != CellType.OBSTACLE) { grid[potFood.x][potFood.y].setFood(1); foodSpawned = true; - System.out.println("spawned new food at " + potFood); - System.out.println(initialGrid[potFood.x][potFood.y]); + // System.out.println("spawned new food at " + potFood); + // System.out.println(initialGrid[potFood.x][potFood.y]); } } } diff --git a/src/main/java/evironment/jumpingDino/DinoWorld.java b/src/main/java/evironment/jumpingDino/DinoWorld.java index 5b60cd7..06bb60f 100644 --- a/src/main/java/evironment/jumpingDino/DinoWorld.java +++ b/src/main/java/evironment/jumpingDino/DinoWorld.java @@ -44,7 +44,7 @@ public class DinoWorld implements Environment, Visualizable { @Override public StepResultEnvironment step(DinoAction action) { boolean done = false; - int reward = 1; + int reward = 0; if(action == DinoAction.JUMP){ dino.jump(); @@ -68,7 +68,7 @@ public class DinoWorld implements Environment, Visualizable { spawnNewObstacle(); } if(ranIntoObstacle()) { - reward = 0; + reward = -1; done = true; } diff --git a/src/main/java/example/ContinuousAnt.java b/src/main/java/example/ContinuousAnt.java index a20ae7d..0a13e70 100644 --- a/src/main/java/example/ContinuousAnt.java +++ b/src/main/java/example/ContinuousAnt.java @@ -6,12 +6,13 @@ import core.controller.RLController; import core.controller.RLControllerGUI; import evironment.antGame.AntAction; import evironment.antGame.AntWorldContinuous; +import evironment.antGame.AntWorldContinuousOriginalState; public class ContinuousAnt { public static void main(String[] args) { RNG.setSeed(56); RLController rl = new RLControllerGUI<>( - new AntWorldContinuous(8, 8), + new AntWorldContinuousOriginalState(8, 8), Method.Q_LEARNING_OFF_POLICY_CONTROL, AntAction.values()); diff --git a/src/main/java/example/DinoSampling.java b/src/main/java/example/DinoSampling.java index 3fbb8ef..12fcdbc 100644 --- a/src/main/java/example/DinoSampling.java +++ b/src/main/java/example/DinoSampling.java @@ -3,7 +3,9 @@ package example; import core.RNG; import core.algo.Method; import core.controller.RLController; +import core.controller.RLControllerGUI; import evironment.jumpingDino.DinoAction; +import evironment.jumpingDino.DinoWorld; import evironment.jumpingDino.DinoWorldAdvanced; import java.io.File; @@ -13,29 +15,35 @@ import java.nio.file.Path; import java.nio.file.StandardOpenOption; public class DinoSampling { + public static final float f =0.05f; + public static final String FILE_NAME = "converge.txt"; public static void main(String[] args) { - File file = new File("convergenceAdv.txt"); - for(float f = 0.05f; f <=1.003 ; f+=0.05f){ + File file = new File(FILE_NAME); + try { + file.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + for(float f = 0.05f; f <=1.003 ; f+=0.05f) { try { Files.writeString(Path.of(file.getPath()), f + ",", StandardOpenOption.APPEND); } catch (IOException e) { e.printStackTrace(); } - for(int i = 1; i <= 100; i++) { - System.out.println("seed: " + i *13); - RNG.setSeed(i *13); + for (int i = 1; i <= 100; i++) { + System.out.println("seed: " + i * 13); + RNG.setSeed(i * 13); RLController rl = new RLController<>( new DinoWorldAdvanced(), - Method.MC_CONTROL_FIRST_VISIT, + Method.Q_LEARNING_OFF_POLICY_CONTROL, DinoAction.values()); rl.setDelay(0); - rl.setDiscountFactor(1f); + rl.setDiscountFactor(0.99f); rl.setEpsilon(f); - rl.setLearningRate(1f); - rl.setNrOfEpisodes(50000); + rl.setLearningRate(0.9f); + rl.setNrOfEpisodes(400000); rl.start(); - } try { Files.writeString(Path.of(file.getPath()), "\n", StandardOpenOption.APPEND); diff --git a/src/main/java/example/JumpingDino.java b/src/main/java/example/JumpingDino.java index 66d2054..b738fbb 100644 --- a/src/main/java/example/JumpingDino.java +++ b/src/main/java/example/JumpingDino.java @@ -5,21 +5,22 @@ import core.algo.Method; import core.controller.RLController; import evironment.jumpingDino.DinoAction; import evironment.jumpingDino.DinoWorld; +import evironment.jumpingDino.DinoWorldAdvanced; public class JumpingDino { public static void main(String[] args) { RNG.setSeed(29); RLController rl = new RLController<>( - new DinoWorld(), + new DinoWorldAdvanced(), Method.MC_CONTROL_FIRST_VISIT, DinoAction.values()); rl.setDelay(0); rl.setDiscountFactor(1f); - rl.setEpsilon(0.15f); + rl.setEpsilon(0.05f); rl.setLearningRate(1f); - rl.setNrOfEpisodes(30000000); + rl.setNrOfEpisodes(100000); rl.start(); } }