I have a problem in the following code:
for n in range(0,i)+range(i+1,len(XY_pos)): # excludes i==n
if distance(XY_temp,i,n)<sigma:
XY_temp[i]=XY_pos[i] # back to before the move
break
else:
XY_pos[i]=XY_temp[i] # move accepted
accepted_moves+=1
NUMBER.append(number(r))
# overlap condition
This part of code is a codition to make or not a move with my particle located in XY_temp[i]. I tried this structure with something easier and it seemed to work, but not here. I don't have any error message, but I can see in the results that the part after the else is never executed even when it should be. I someone could think of a explanation, it would be warlmy welcome
I'm really new in Python, so I hope it's not a silly question, but after hours looking in the net and by myself to find a solution, I ask here.
I tried with the break at the same level of identation as the "if", and it doesn't seems to change anything.
Thank you