In[]:=
Module[{goal=50,deep=4000,cut=200,ru,life,evo,data},evo=NestList[CompoundExpression[ru=RandomRuleMutation[First[#],5],life=TestLifetime[ru,cut],If[life!=-Infinity&&Abs[life-goal]<Abs[Last[#]-goal],{ru,life},#]]&,{{0,4,1},0},deep];evo=Rest[First/@SplitBy[evo,Last]];Map[CompoundExpression[data=CellularAutomaton[First[#],{{1},0},Last[#]+2],data=ArrayPad[#,2]&/@data,Labeled[ArrayPlot[data,ColorRules->colors,ImageSize->{Automatic,26Sqrt[Length[data]+1]},Mesh->True,MeshStyle->Opacity[.1]],Last[#]]]&,evo]]
Out[]=
,
,
,
,
,
,
,
,
,
,
1 |
2 |
3 |
6 |
7 |
9 |
11 |
20 |
33 |
57 |
48 |
In[]:=
ResourceFunction["InteractiveListSelector"][ParallelTable[SeedRandom[745746+i];Module[{goal=50,deep=6000,cut=200,ru,life,evo,data},evo=NestList[CompoundExpression[ru=RandomRuleMutation[First[#],5],life=TestLifetime[ru,cut],If[life!=-Infinity&&Abs[life-goal]<=Abs[Last[#]-goal],{ru,life},#]]&,{{0,3,1},0},deep];evo=Rest[First/@SplitBy[evo,Last]];Map[CompoundExpression[data=CellularAutomaton[First[#],{{1},0},Last[#]+2],data=ArrayPad[#,2]&/@data,Labeled[ArrayPlot[data,ColorRules->colors,ImageSize->{Automatic,26Sqrt[Length[data]+1]},Mesh->True,MeshStyle->Opacity[.1]],Last[#]]]&,evo]]->i,{i,100}]]
Out[]=
{1,5,9,12,16,19,20,36,51,54,71,99}
Column[{a,v,c},Dividers->{False,Thread[{2,3}->Red]}]
Out[]=
a |
v |
c |
In[]:=
{1,5,9,12,16,19,20,36,51,54,71,99}//Length
Out[]=
12
In[]:=
Column[ParallelTable[Row[SeedRandom[745746+i];Module[{goal=50,deep=6000,cut=200,ru,life,evo,data},evo=NestList[CompoundExpression[ru=RandomRuleMutation[First[#],5],life=TestLifetime[ru,cut],If[life!=-Infinity&&Abs[life-goal]<=Abs[Last[#]-goal],{ru,life},#]]&,{{0,3,1},0},deep];evo=Rest[First/@SplitBy[evo,Last]];Map[CompoundExpression[data=CellularAutomaton[First[#],{{1},0},Last[#]+2],data=ArrayPad[#,2]&/@data,Labeled[ArrayPlot[data,ColorRules->colors,ImageSize->{Automatic,12Sqrt[Length[data]+1]},MeshStyle->Opacity[.1]],Style[Last[#],"Text",Italic,Gray,11]]]&,evo]]],{i,{1,5,9,12,16,19,20,36,51,54,71,99}}],Dividers->{False,Thread[Range[2,11]->LightGray]}]
Out[]=
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
|
Width
Width
Ratio of color 2 to other colors [maximize one color while minimizing others]
Ratio of color 2 to other colors [maximize one color while minimizing others]
Patches of a single color
Patches of a single color