diff --git a/p-endogamousDiploid/enumerateEndo.py b/p-endogamousDiploid/enumerateEndo.py new file mode 100644 index 0000000000000000000000000000000000000000..06d082f63f4dbc627261f8c4368f9ce477a0851a --- /dev/null +++ b/p-endogamousDiploid/enumerateEndo.py @@ -0,0 +1,55 @@ +import sys + + +NRULE=256 + +REFLECTION=[0,4,2,6,1,5,3,7] + +CLIST=[] +seen= [[False]* NRULE]*NRULE + +def mark(f,g): + if not seen[f][g] and f != g: + seen[f][g]= True + seen[g][f]= True + CLIST.append( (f,g)) + +def scanSpace(): + for f in range(NRULE): + fft=transECA(f) + fr,fc,frc=fft[1], fft[2], fft[3] + print ("%d,%d %d,%d %d,%d"%(f, fr, f, fc, f, frc)) + mark(f,fr) ; mark(f, fc) ; mark(f, frc) + +def reflect(tab): + reflectedTab=[ tab[REFLECTION[i]] for i in range(8)] + return ''.join(reflectedTab) + +def wcode(tab): + return int(tab[::-1],2) + +def transECA(eca): + ftab= '{0:08b}'.format(eca)[::-1] # from decimal to binary, inverting order + rtab= reflect(ftab) + ctab= ''.join( [str(1-int(ftab[7-i])) for i in range(8)] ) + rctab= reflect(ctab) + wr, wc, wrc = wcode(rtab), wcode(ctab), wcode(rctab) + #print(eca, wr, wc, wrc, ftab, rtab, ctab) + return (eca, wr, wc, wrc) + + +def exportList(): + print("writing list") + filenameout= "list-endogamous.txt" + f=open(filenameout,"w") + for couple in CLIST: + f.write("%3d %3d\n"%(couple[0],couple[1])) + +#transECA(213) + +print('-'*20) +scanSpace() +print(CLIST) +print('-'*20) +print(len(CLIST)) +exportList() \ No newline at end of file diff --git a/p-endogamousDiploid/list-endogamous.txt b/p-endogamousDiploid/list-endogamous.txt new file mode 100644 index 0000000000000000000000000000000000000000..8abebe931c39e4097166a1cbb52bbe97e209c3ec --- /dev/null +++ b/p-endogamousDiploid/list-endogamous.txt @@ -0,0 +1,168 @@ + 0 255 + 1 127 + 2 16 + 2 191 + 2 247 + 3 17 + 3 63 + 3 119 + 4 223 + 5 95 + 6 20 + 6 159 + 6 215 + 7 21 + 7 31 + 7 87 + 8 64 + 8 239 + 8 253 + 9 65 + 9 111 + 9 125 + 10 80 + 10 175 + 10 245 + 11 81 + 11 47 + 11 117 + 12 68 + 12 207 + 12 221 + 13 69 + 13 79 + 13 93 + 14 84 + 14 143 + 14 213 + 15 85 + 18 183 + 19 55 + 22 151 + 24 66 + 24 231 + 24 189 + 25 67 + 25 103 + 25 61 + 26 82 + 26 167 + 26 181 + 27 83 + 27 39 + 27 53 + 28 70 + 28 199 + 28 157 + 29 71 + 30 86 + 30 135 + 30 149 + 32 251 + 33 123 + 34 48 + 34 187 + 34 243 + 35 49 + 35 59 + 35 115 + 36 219 + 37 91 + 38 52 + 38 155 + 38 211 + 40 96 + 40 235 + 40 249 + 41 97 + 41 107 + 41 121 + 42 112 + 42 171 + 42 241 + 43 113 + 44 100 + 44 203 + 44 217 + 45 101 + 45 75 + 45 89 + 46 116 + 46 139 + 46 209 + 50 179 + 54 147 + 56 98 + 56 227 + 56 185 + 57 99 + 58 114 + 58 163 + 58 177 + 60 102 + 60 195 + 60 153 + 62 118 + 62 131 + 62 145 + 72 237 + 73 109 + 74 88 + 74 173 + 74 229 + 76 205 + 78 92 + 78 141 + 78 197 + 90 165 + 94 133 +104 233 +106 120 +106 169 +106 225 +108 201 +110 124 +110 137 +110 193 +122 161 +126 129 +128 254 +130 144 +130 190 +130 246 +132 222 +134 148 +134 158 +134 214 +136 192 +136 238 +136 252 +138 208 +138 174 +138 244 +140 196 +140 206 +140 220 +142 212 +146 182 +152 194 +152 230 +152 188 +154 210 +154 166 +154 180 +156 198 +160 250 +162 176 +162 186 +162 242 +164 218 +168 224 +168 234 +168 248 +170 240 +172 228 +172 202 +172 216 +184 226 +200 236