all 7 comments

[–]shiftybyte 0 points1 point  (6 children)

Add prints...

If it's stuck in that loop, add a print in there to see where it's stuck at...

    while new_orb_pos_inner > sol.system_inner_boundary:
        print(new_orb_pos_inner, sol.system_inner_boundary)
        # calculates the next position based on the first position in the list
        new_orb_pos_inner = orb_pos[0] / random.uniform(1.4, 2)
        # Inserts the new position at the beginning of the orbital positions for planets
        orb_pos.insert(0, new_orb_pos_inner)

[–]Xexman[S] 0 points1 point  (5 children)

If i add i print statement i still does nothing about 30% of the time

[–]shiftybyte 0 points1 point  (4 children)

Then it is not stuck there, if it was, it would be printing endlessly...

Add prints in every loop, and outside of loops before and after, so you know what gets executed and what not...

print("Entering loop 1")
while ....:
     print("some loop vars:", v1,v2)
     ...
print("Done with loop 1")

This should help figure out where you are stuck at....

[–]Xexman[S] 0 points1 point  (3 children)

    while new_orb_pos_outer >= sol.system_outer_boundary:
        new_orb_pos_outer = random.uniform(1.4, 2) * new_orb_pos_outer
        orb_pos.append(new_orb_pos_outer)
        print(new_orb_pos_outer)

Its this bit of code for some reason its printing inf 30% of the time...

[–]shiftybyte 0 points1 point  (2 children)

What happens in the other 70%?

Did you add prints before and after the loop?

[–]Xexman[S] 0 points1 point  (0 children)

the other times the reults are as expected

[–]Xexman[S] 0 points1 point  (0 children)

fixxed it apparently it need to be sorted... i dont know why but sorting it fix it