<s> from __future__ import print_function <EOL> from numpy import pi <EOL> from numpy . random import random <EOL> from modules . growth import spawn_curl <EOL> from modules . growth import spawn <EOL> from numpy import zeros <EOL> NMAX = <NUM_LIT:10> ** <NUM_LIT:6> <EOL> SIZE = <NUM_LIT> <EOL> ONE = <NUM_LIT:1.> / SIZE <EOL> PROCS = <NUM_LIT:2> <EOL> INIT_RAD = <NUM_LIT> * ONE <EOL> INIT_NUM = <NUM_LIT> <EOL> STP = ONE * <NUM_LIT> <EOL> NEARL = <NUM_LIT:3> * ONE <EOL> FARL = <NUM_LIT> * ONE <EOL> MID = <NUM_LIT:0.5> <EOL> LINEWIDTH = <NUM_LIT> * ONE <EOL> BACK = [ <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> ] <EOL> FRONT = [ <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:5> ] <EOL> RED = [ <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> ] <EOL> TWOPI = pi * <NUM_LIT> <EOL> i = <NUM_LIT:0> <EOL> def steps ( df ) : <EOL> from time import time <EOL> from modules . helpers import print_stats <EOL> global i <EOL> t1 = time ( ) <EOL> df . optimize_position ( STP ) <EOL> spawn_curl ( df , NEARL ) <EOL> if df . safe_vertex_positions ( <NUM_LIT:3> * STP ) < <NUM_LIT:0> : <EOL> print ( '<STR_LIT>' ) <EOL> return False <EOL> t2 = time ( ) <EOL> print_stats ( i , t2 - t1 , df ) <EOL> return True <EOL> np_edges = zeros ( shape = ( NMAX , <NUM_LIT:4> ) , dtype = '<STR_LIT:float>' ) <EOL> np_verts = zeros ( shape = ( NMAX , <NUM_LIT:2> ) , dtype = '<STR_LIT:float>' ) <EOL> def main ( ) : <EOL> import gtk <EOL> from render . render import Animate <EOL> from differentialLine import DifferentialLine <EOL> from modules . show import show_closed <EOL> from modules . show import show_detail <EOL> from modules . show import show <EOL> DF = DifferentialLine ( NMAX , FARL * <NUM_LIT:2> , NEARL , FARL , PROCS ) <EOL> angles = sorted ( random ( INIT_NUM ) * TWOPI ) <EOL> DF . init_circle_segment ( MID , MID , INIT_RAD , angles ) <EOL> def wrap ( render ) : <EOL> global i <EOL> res = steps ( DF ) <EOL> fn = None <EOL> num = DF . np_get_edges_coordinates ( np_edges ) <EOL> show ( render , np_edges [ : num , : ] , fn , r = <NUM_LIT> * ONE ) <EOL> i += <NUM_LIT:1> <EOL> return res <EOL> render = Animate ( SIZE , BACK , FRONT , wrap ) <EOL> gtk . main ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
