More Colors
More Colors
In[]:=
TestCALifetime[ca_List]:=If[Total[Last[ca]]==0,Length[ca]-LengthWhile[Reverse[ca],Total[#]==0&],-Infinity]
In[]:=
GoFurtherTotal[{initrule_,steps_,iterations_,seed_}]:={ResourceFunction["AdaptiveCellularAutomaton"][<|"MutationFunction"->{2,"Symmetric"->True},"InitialRule"->initrule,"AdaptiveIterations"->iterations,"MaxSteps"->steps,"FitnessFunction":>(With[{ca=CellularAutomaton[#1,{{1},0},steps]},{life=TestCALifetime[ca]},If[life==-Infinity,-Infinity,Count[Sign[Take[ca,life]],1,{2}]]]&)|>,"BreakthroughStates",{"BestRule","BestFitness","Index"},RandomSeeding->seed],steps,iterations,seed}
In[]:=
ParallelMap[Function[i,Fold[Join[Most[#1],Map[Function[y,MapAt[Function[x,x+#1[[-1]]["Index"]],y,"Index"]],#2]]&,First/@Rest[NestList[GoFurtherTotal[{#[[1,-1]]["BestRule"],2#[[2]],2#[[3]],#[[4]]}]&,{{<|"BestRule"{0,3,1},"BestFitness"1,"Index"0|>},200,500,3456+i},1]]]],Range[40]];
In[]:=
Labeled[ArrayPlot[CellularAutomaton[#BestRule,{{1},0},420],ColorRules->"Colors",ImageSize->{Automatic,400}],{#BestFitness,#Index}]&/@Last/@%
Out[]=
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
{2663,130} |
{380,372} |
{906,270} |
{754,711} |
{1157,862} |
{952,584} |
{96,340} |
{662,699} |
{484,802} |
{59,550} |
{7898,387} |
{754,210} |
{302,960} |
{1424,65} |
{1200,545} |
{513,449} |
{5183,582} |
{266,827} |
{1786,349} |
{1719,626} |
{528,493} |
{310,536} |
{73,230} |
{144,866} |
{395,994} |
{1116,777} |
{197,376} |
{1974,822} |
{341,197} |
{237,816} |
{208,364} |
{172,818} |
{77,807} |
{5183,973} |
{6516,823} |
{31,826} |
{145,907} |
{654,294} |
{287,960} |
{1291,735} |
In[]:=
ParallelMap[Function[i,Fold[Join[Most[#1],Map[Function[y,MapAt[Function[x,x+#1[[-1]]["Index"]],y,"Index"]],#2]]&,First/@Rest[NestList[GoFurtherTotal[{#[[1,-1]]["BestRule"],2#[[2]],2#[[3]],#[[4]]}]&,{{<|"BestRule"{0,4,1},"BestFitness"1,"Index"0|>},200,500,3456+i},1]]]],Range[40]];
In[]:=
Labeled[ArrayPlot[CellularAutomaton[#BestRule,{{1},0},420],ColorRules->"Colors",ImageSize->{Automatic,400}],{#BestFitness,#Index}]&/@Last/@%
Out[]=
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
{4489,871} |
{3673,985} |
{10589,741} |
{7862,627} |
{5893,358} |
{6165,329} |
{1629,943} |
{1145,335} |
{7293,840} |
{6810,626} |
{7283,518} |
{9025,224} |
{2219,749} |
{10678,561} |
{9353,212} |
{8119,701} |
{609,988} |
{3623,923} |
{191,719} |
{8605,528} |
{6330,854} |
{2175,682} |
{5103,561} |
{6531,470} |
{54,988} |
{10430,436} |
{1912,669} |
{4983,976} |
{1149,910} |
{6326,368} |
{6038,461} |
{6086,778} |
{7711,981} |
{1444,609} |
{2632,504} |
{4161,897} |
{7963,128} |
{3446,168} |
{6162,392} |
{2246,953} |
Lifetime Only
Lifetime Only
Triangular Shape Fitness
Triangular Shape Fitness