diff --git a/n-vivace-satreach-cyber/b-satkubernetes.py b/n-vivace-satreach-cyber/b-satkubernetes.py index fd4f8e3d03edaf9e11dfb8f6812379fa55da6dab..55cc96b3e34e38bae4e2dc0abb2e95064ead6f0f 100644 --- a/n-vivace-satreach-cyber/b-satkubernetes.py +++ b/n-vivace-satreach-cyber/b-satkubernetes.py @@ -2,14 +2,13 @@ import yNaming as naming RADIUS=1 CONTROLSHIFT=1 # shift for reading the initial and final configurations NTRANS=8 -T=7 # number of time steps +T=20 # number of time steps N=9 #transition table -#tabTRANSsft=[0,1,0,1,0,1,0,1]#shift -#tabTRANS=[0,1,1,1,1,0,0,0 ]# ECA30 -tabTRANS=[0,1,1,1,1,1,1,0 ]# ECA126 +ECA=126 +TABTRANS=sbin='{0:08b}'.format(ECA)[::-1] sx="*1101111*" # initial configuration sy="*0111001*" # final configuration @@ -23,7 +22,7 @@ def setConfigCondition(cond, time): if cond[i]=='*': # hack to make the variable appear print( naming.signedName('0', time, i) + " " + naming.signedName('1', time, i)) if cond[i] == '0' or cond[i] == '1': - biti=str(cond[i]) + biti=cond[i] print ( naming.signedName(biti, time, i) ) @@ -58,7 +57,7 @@ def genTransitions(t,posi): x,y,z= (i//4)%2, (i//2)%2, i%2 cond="%d%d%d"%(x,y,z) komm="tr(%d,%d)"%(t,posi) - result=str(tabTRANS[i]) # transition table output (as str) + result=TABTRANS[i] # transition table output (as str) c1= genTransitionECA(cond,t,posi,result,komm)#transition to one print(c1+cond+">"+result) @@ -83,11 +82,8 @@ def run(): genSpaceTime(T) - - run() - #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%