Commit 3569286d by Nicolas Fressengeas

Major Bug correction of incorrect calculation of cells

Field was pointing to non existing cells,
owing to an incorrect reduction of the cell number.
Reduction has been commentend out
parent e7f5aa31
......@@ -343,16 +343,18 @@ class Escapade():
#Pickle and compress the rule before listing for memory saving
rule=zlib.compress(dumps(rule))
#Skip, or NOT, the lengthy test to limit the number of rules
inlist=False
for i in range(self.rulenumber):
if rule==self.rulelist[i]:
inlist=True
self.ruledict[self.field[tuple(point)]]=i
break;
if not inlist:
self.rulelist.append(rule)
self.ruledict[self.field[tuple(point)]]=self.rulenumber
self.rulenumber+=1
#BUG : only one point is set to the new rule, leaving rule numbers in field which do not mean anything
#First work around : do not limit the number of rules
#inlist=False
#for i in range(self.rulenumber):
# if rule==self.rulelist[i]:
# inlist=True
# self.ruledict[self.field[tuple(point)]]=i #<---BUG
# break;
#if not inlist:
self.rulelist.append(rule)
self.ruledict[self.field[tuple(point)]]=self.rulenumber
self.rulenumber+=1
#end of list adding
self.points_computed_so_far+=1
f=open("rulelist.escapade.dump","w")
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment