/* Eggs problem * stop_criteria=generations, num_gens=1800 gen = 1158 (time: 123.444s) results_best = [[41196.695623875988531,(Year - 9) * sqrt(8)]] gen = 759 (time: 82.469s) results_best = [[41188.276321077151806,(pow3(-2.112341463618139) + Year) * sqrt(8)]] */ import util. data(eggs,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- eggs(Eggs), Data = [[[Year,Chic],Egg] : [Year,Chic,Egg] in Eggs], Ops = [+,/,-,*,pow2,pow3,pow4,pow5,exp,log,sqrt,if_then_else,<], Constants = 1..10 ++ [frand(-10,10) : _ in 1..10], Vars = ['Year','Chic'], Unknown = [2004,454165], MaxSize = 21, Params = new_map([approx=300, init_size=500, total_approx=10, num_gens=1800, stop_criteria=generations, show_instances=false ]). % "year","chic","egg" eggs(Data) => Data = chunks_of([ 1930,468491,3581, 1931,449743,3532, 1932,436815,3327, 1933,444523,3255, 1934,433937,3156, 1935,389958,3081, 1936,403446,3166, 1937,423921,3443, 1938,389624,3424, 1939,418591,3561, 1940,438288,3640, 1941,422841,3840, 1942,476935,4456, 1943,542047,5000, 1944,582197,5366, 1945,516497,5154, 1946,523227,5130, 1947,467217,5077, 1948,499644,5032, 1949,430876,5148, 1950,456549,5404, 1951,430988,5322, 1952,426555,5323, 1953,398156,5307, 1954,396776,5402, 1955,390708,5407, 1956,383690,5500, 1957,391363,5442, 1958,374281,5442, 1959,387002,5542, 1960,369484,5339, 1961,366082,5358, 1962,377392,5403, 1963,375575,5345, 1964,382262,5435, 1965,394118,5474, 1966,393019,5540, 1967,428746,5836, 1968,425158,5777, 1969,422096,5629, 1970,433280,5704, 1971,421763,5806, 1972,404191,5742, 1973,408769,5502, 1974,394101,5461, 1975,379754,5382, 1976,378361,5377, 1977,386518,5408, 1978,396933,5608, 1979,400585,5777, 1980,392110,5825, 1981,384838,5625, 1982,378609,5800, 1983,364584,5656, 1984,374000,5685, 1985,370000,5704, 1986,373000,5759, 1987,380000,5863, 1988,356808,5823, 1989,357241,5625, 1990,353179,5678, 1991,363594,5789, 1992,371483,5896, 1993,379640,5995, 1994,383779,6159, 1995,384241,6230, 1996,386418,6365, 1997,410030,6462, 1998,424094,6648, 1999,436326,6912, 2000,434687,7060, 2001,441089,7174, 2002,438948,7271, 2003,448748,7289, 2004,454165,7428],3).