From 2c05f815509242de8c6fcabcedbb9d34418aa137 Mon Sep 17 00:00:00 2001
From: "Nazim@misirlou" <nazim@internet.gestell>
Date: Fri, 13 Dec 2024 12:21:39 +0100
Subject: [PATCH] nzm

---
 .../{c-ECApaths.py => c-ECAdigest.py}         | 30 ++++++++++++++-----
 n-vivace-satreach-cyber/makefile              | 13 +++++---
 2 files changed, 31 insertions(+), 12 deletions(-)
 rename n-vivace-satreach-cyber/{c-ECApaths.py => c-ECAdigest.py} (85%)

diff --git a/n-vivace-satreach-cyber/c-ECApaths.py b/n-vivace-satreach-cyber/c-ECAdigest.py
similarity index 85%
rename from n-vivace-satreach-cyber/c-ECApaths.py
rename to n-vivace-satreach-cyber/c-ECAdigest.py
index eeda8eb..5309371 100644
--- a/n-vivace-satreach-cyber/c-ECApaths.py
+++ b/n-vivace-satreach-cyber/c-ECAdigest.py
@@ -4,6 +4,7 @@ import re
 import yNaming as naming
 import random
 
+SAVESOLUTION=False
 FILE_SYNTHESIS_WRITEMODE="a" # append (overwrite)
 
 ECAminimals=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
@@ -15,8 +16,6 @@ ECAminimals=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
 		168, 170, 172, 178, 184, 200, 204, 232]
 
 
-TSTEPS=70
-N=30
 NSAMPLE=20
 #x, y = "010101001111010011011101", "101110110001110110111001"
 
@@ -76,6 +75,7 @@ def analyseRes3(res3, hashx, hashy):
     # satres= SAT / UNS
     return result
 
+##### HERE IS THE SEQUENCE OF COMMANDS
 def runOne():
     """ one search of path, random x and y"""
     x,y=randomconfig(N),randomconfig(N)
@@ -83,16 +83,22 @@ def runOne():
     basename="ECA%d-%s-%s"%(ECA,hashx,hashy)
     cmd1="python3 b-satkubernetes.py %d %d %s %s > data/%s.dat"%(ECA, TSTEPS, x, y, basename)
     cmd2="python3 x2-convertToSat.py data/%s.dat "%basename
-    cmd3="minisat data/%s.cnf data/%s-sol.cnf"%(basename,basename)
-    ncells=len(x)+2
-    cmd4="python3 w-prnCNFsolution.py %d data/%s-sol.cnf"%(ncells, basename)
-    cmdseq=[cmd1,cmd2,cmd3,cmd4]
-    for cmd in cmdseq:
-        print(cmd)
+    cmd2b="rm -f data/%s.dat "%basename
+    if SAVESOLUTION:
+        cmd3="minisat data/%s.cnf data/%s-sol.cnf"%(basename,basename)
+    else:
+        cmd3="minisat data/%s.cnf"%(basename)
+    
+    #ncells=len(x)+2
+    #cmd4="python3 w-prnCNFsolution.py %d data/%s-sol.cnf"%(ncells, basename)
+    #cmdseq=[cmd1,cmd2,cmd3,cmd4]
+    #for cmd in cmdseq:
+    #    print(cmd)
     #subprocess.run(cmd1.split())
     subprocess.getoutput(cmd1)
     #res2=subprocess.run(cmd2.split(), capture_output=True)
     subprocess.run(cmd2.split())
+    subprocess.getoutput(cmd2b)
     #print("res2::[%s]"%res2)
     #subprocess.getoutput(cmd2)
     #------------------------------
@@ -118,6 +124,14 @@ def runAllECA():
 ############################## OLD
 
 
+# N=30 ; TSTEPS=70
+if len(sys.argv) != 3:
+    print( "usage <filename> N T" )
+    sys.exit(-99)
+N=int(sys.argv[1])
+TSTEPS=int(sys.argv[2])
+
+
 runAllECA()
 
 #ECA=126 ; runECA()
diff --git a/n-vivace-satreach-cyber/makefile b/n-vivace-satreach-cyber/makefile
index 982bd69..814f1c1 100644
--- a/n-vivace-satreach-cyber/makefile
+++ b/n-vivace-satreach-cyber/makefile
@@ -1,11 +1,16 @@
+N=40 
+T=80
 run:
-	python3 c-ECApaths.py	
+	python3 c-ECAdigest.py $N $T	
 klin:
-	rm -f *cnf *dat data/* allSynth/synth*txt
-
+	rm -f *cnf *dat data/* 
 synth:
-	python3 e-sunthesis.py > z-kuberECA-N30-T70.csv
+	python3 e-sunthesis.py $N $T
 	
+
+
+#-----------------
+
 #######OLD	
 gen:
 	python3 b-satkubernetes.py > ztst.dat 
-- 
GitLab