<<"MultiwaySystems/Universe.m"
mkrule[rule_]:=ToCharsX[(#1/.({a_,b_}{c_,d_}){a,-1,-1,b}{-1,c,d,-1}&)/@rule]
ToCharsX[rule_]:=rule/.x:{___Integer}StringJoin@@(x/.{0"A",1"B",-1"-"})
mwcrule=mkrule[{{1,1}{0,0},{1,0}{1,1},{0,1}{1,1},{0,0}{0,0}}]
{B--B-AA-,B--A-BB-,A--B-BB-,A--A-AA-}
mwcinit=ToCharsX[ReplacePart[Flatten[Table[{0,0,-1,-1},{5}]],1,{{9},{10}}]]
AA--AA--BB--AA--AA--
mwpixx[{rr_,init_},t_]:=Surround[MWEvolGraphic[FromCharsX[CMWEvolveListT[rr,{init},t]]]]
mwpixxy[{rr_,init_},t_]:=Surround[MWEvolGraphic[FromCharsX[CMWEvolveListT[rr,{init},t]/.s_StringStringReplace[s,"-"""]]]]
FromCharsX[rule_]:=rule/.x_StringCharacters[x]/."B"1,"A"0,"-"
1
3
Show[mwpixxy[{mwcrule,"AA--BB--AA--"},8]];
PSWrite["mwca.eps",%,{3,3}];
Show[mwpixx[{mwcrule,"AA--BB--AA--"},8]];
arhead[{x_,y_},d_]:=With[{c=.03},If[d>0,Line[{{x-c,y+c},{x+c,y},{x-c,y-c}}],Line[{{x+c,y+c},{x-c,y},{x+c,y-c}}]]]
unit[pos:{x_,y_},a_,d_]:=AbsoluteThickness[.3],Linex-,y+,x+,y+,Linex-,y-,x+,y-,arheadx-.35,y+,1,arheadx+.35,y+,If[d>0,-1,1],arheadx-.35,y-,If[d>0,-1,1],arheadx+.35,y-,-1,AbsolutePointSize[2],Pointx+,y+&/@{{1,1},{1,-1},{-1,1},{-1,-1}},AbsoluteThickness[.25],GrayLevel[If[a==0,.8,.2]],Disk{x,y},,Circle{x,y},
1
2
1
8
1
2
1
8
1
2
1
8
1
2
1
8
1
8
1
8
1
8
1
8
#1〚1〛
2
#1〚2〛
8
1
4
1
4
BCAEvolveList[{n_Integer,rule_},init_,t_]:=FoldList[BCAStep[{n,rule},#1,#2]&,init,Range[t]]/;Mod[Length[init],n]==0BCAStep[{n_,rule_},a_,d_]:=RotateRight[Flatten[(Replace[#1,rule]&)/@Partition[RotateLeft[a,d],n]],d]
evol=BCAEvolveList[{2,{{1,1}{0,0},{1,0}{1,1},{0,1}{1,1},{0,0}{0,0}}},CenterList[10,{1,1}],4]
{{0,0,0,0,1,1,0,0,0,0},{0,0,0,1,1,1,1,0,0,0},{0,0,1,1,0,0,1,1,0,0},{0,1,1,1,1,1,1,1,1,0},{1,1,0,0,0,0,0,0,1,1}}
ShowGraphicsTableunit{x,-t},evolt,x,,{x,1,Length[First[evol]]},{t,1,Length[evol]},AspectRatioAutomatic,PlotRangeAll;
Mod[t+x,2]
(-1)
PSWrite["netca.eps",%,FullColumn];
<<"Phred/MSource/Network.m"
Show[NetworkGraphics[Network[{Node[1,NodePosition{-31.,156.},NodeLabelAngle1.1781],Node[2,NodePosition{406.0000000000001,149.},NodeLabelAngle1.1781],Node[3,NodePosition{246.8640590000001,151.059418},NodeLabelAngle1.255194],Node[4,NodePosition{137.589767,152.380356},NodeLabelAngle1.255194],Node[5,NodePosition{249.201096,340.3327030000001},NodeLabelAngle1.255194],Node[6,NodePosition{84.12673200000002,247.69397},NodeLabelAngle1.255194],Node[7,NodePosition{139.925476,341.6547240000001},NodeLabelAngle1.255194],Node[8,NodePosition{302.6637270000001,245.019257},NodeLabelAngle1.255194],Node[9,NodePosition{-30.,249.},NodeLabelAngle1.1781],Node[10,NodePosition{405.,243.},NodeLabelAngle1.1781],Arc[{2,3},ArcBezierPath{{-0.3333330000000001,0.},{0.3333330000000001,0.}},ArcCircleHeight0.,ArcStyleLine],Arc[{1,4},ArcBezierPath{{-0.3333330000000001,0.},{0.3333330000000001,0.}},ArcCircleHeight0.,ArcStyleLine],Arc[{4,3},ArcBezierPath{{-0.3803040000000001,-0.357016},{0.3803040000000001,-0.357016}},ArcCircleHeight-0.267762,ArcStyleCircle],Arc[{6,4},ArcBezierPath{{-0.3803040000000001,-0.357016},{0.3803040000000001,-0.357016}},ArcCircleHeight-0.267762,ArcStyleCircle],Arc[{5,7},ArcBezierPath{{-0.374486,0.333817},{0.374486,0.333817}},ArcCircleHeight0.6458880000000002,ArcStyleCircle],Arc[{5,7},ArcBezierPath{{-0.3803040000000001,-0.357016},{0.3803040000000001,-0.357016}},ArcCircleHeight-0.267762,ArcStyleCircle],Arc[{7,6},ArcBezierPath{{-0.3803040000000001,-0.357016},{0.3803040000000001,-0.357016}},ArcCircleHeight-0.267762,ArcStyleCircle],Arc[{3,8},ArcBezierPath{{-0.3803040000000001,-0.357016},{0.3803040000000001,-0.357016}},ArcCircleHeight-0.267762,ArcStyleCircle],Arc[{8,5},ArcBezierPath{{-0.3803040000000001,-0.357016},{0.3803040000000001,-0.357016}},ArcCircleHeight-0.267762,ArcStyleCircle],Arc[{6,9},ArcBezierPath{{-0.3333330000000001,0.},{0.3333330000000001,0.}},ArcCircleHeight0.,ArcStyleLine],Arc[{10,8},ArcBezierPath{{-0.3333330000000001,0.},{0.3333330000000001,0.}},ArcCircleHeight0.,ArcStyleLine]},ArcArrowTrue,ArcArrowAngle0.3926990000000001,ArcArrowColorGrayLevel[0.],ArcArrowFlare0.3,ArcArrowPosition0.5,ArcArrowSize10.,ArcColorGrayLevel[0.],ArcFlippedFalse,ArcLabel"",ArcLabelColorGrayLevel[0],ArcLabelDistance3.,ArcLabelPosition0.5,ArcLabelSideLeft,ArcLoopAngle2.65358979278929*^-6,ArcLoopClockwiseTrue,ArcLoopSize20.,ArcThickness0.5,NodeAnnulusRatio0.2,NodeColorGrayLevel[0.],NodeLabelNone,NodeLabelColorGrayLevel[0],NodeLabelDistance4.,NodeSize1.4,NodeStyleDisk,PlotRangeAutomatic,ArcLabelFont$DefaultFont,NodeLabelFont$DefaultFont]]];
Use the network with the inner loop going the other way to represent 0; can make one loop hang down much more than the other, so in main picture can see difference.....