def boolean_1_iter(coef, set, sol, check='out'):  #2
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol)  #2.1
    else:
        start1 = timer()
        #             Solving X1,X2,X3,X4 continuously
        sol = c_f_T(coef, set, sol)  #2.3
        start2 = timer()

        #             Movement of X4
        sol = hybrid_tech_c(coef, set, sol)  #2.2
        start3 = timer()
        '''                            
        if len(sol['matrix_tip']) == 0: 
            sol['stop_iter'] = 100000 
            print 'all is absorbed'
            check == 'in'
        else:
            start1 = timer() 
#             Solving X1,X2,X3,X4 continuously
            sol = c_f_T(coef, set, sol) #2.3
            start2 = timer()      
            
#             Movement of X4
            sol = hybrid_tech(coef, set, sol) #2.2
            start3 = timer()
        '''
        if not check == 'in':
            print 'Hybrid for X4 time', start2 - start1
            print 'Solve X1,X2,X3 time', start3 - start2

    return sol
Exemple #2
0
def boolean_1_iter(coef, set, sol, check = 'out'):                       
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol)  
    else:                             
        if len(sol['sp_stop']) == len(sol['matrix_tip']):
            sol['stop_iter'] = 100000 #sp_stop harus dicek di setiap movement and branching. karena sudah tidak bergerak lagi yang ada di list ini.
            print 'all looping itself or anastomosis'
            check = 'in'
        else:
            '''2. Branching and Movement''' 
            start1 = timer()  
            if set['layout'] == '2D':
                sol, n_o = hybrid_tech_c(coef, set, sol)
            if set['layout'] == '3D':
                sol = hybrid_tech_c_3d(coef, set, sol)
            start2 = timer()
            '''1. Anastomosis & Tip Cell'''
            #sol = check_anastomosis(sol)
            start3 = timer()
            '''Solving c,f,T'''
            if set['layout'] == '2D':
                sol = c_f_T(coef, set, sol)
#                 sol = system_2d(coef, set, sol, n_o) #2.3
            if set['layout'] == '3D':
                sol = c_f_T_3d(coef, set, sol)
            start4 = timer()            
        if not check == 'in':
            print 'Check Anastomosis Time', start3-start2
            print 'Hybrid for n time', start2-start1
            print 'Solve c,f,T time', start4-start3
                    
    return sol
Exemple #3
0
def boolean_1_iter(coef, set, sol, check = 'out'): #2                      
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol) #2.1
    else: 
        start1 = timer() 
#             Solving X1,X2,X3,X4 continuously
        sol = c_f_T(coef, set, sol) #2.3
        start2 = timer()      
        
#             Movement of X4
        sol = hybrid_tech_c(coef, set, sol) #2.2
        start3 = timer()
        '''                            
        if len(sol['matrix_tip']) == 0: 
            sol['stop_iter'] = 100000 
            print 'all is absorbed'
            check == 'in'
        else:
            start1 = timer() 
#             Solving X1,X2,X3,X4 continuously
            sol = c_f_T(coef, set, sol) #2.3
            start2 = timer()      
            
#             Movement of X4
            sol = hybrid_tech(coef, set, sol) #2.2
            start3 = timer()
        '''
        if not check == 'in':
            print 'Hybrid for X4 time', start2-start1
            print 'Solve X1,X2,X3 time', start3-start2
                    
    return sol
Exemple #4
0
def boolean_1_iter(coef, set, sol, check='out'):  #2
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol)  #2.1
    else:
        if len(sol['sp_stop']) == len(sol['matrix_tip']):
            sol['stop_iter'] = 100000  #sp_stop harus dicek di setiap movement and branching. karena sudah tidak bergerak lagi yang ada di list ini.
            print 'all looping itself or anastomosis'
            check = 'in'
        else:
            '''2. Branching and Movement'''
            start1 = timer()
            if set['layout'] == '2D':
                sol = hybrid_tech_c(coef, set, sol)  #2.2
            if set['layout'] == '3D':
                sol = hybrid_tech_c_3d(coef, set, sol)
            start2 = timer()
            '''1. Anastomosis & Tip Cell'''
            #sol = check_anastomosis(sol)
            start3 = timer()
            '''Solving c,f,T'''
            if set['layout'] == '2D':
                sol = c_f_T(coef, set, sol)  #2.3
            if set['layout'] == '3D':
                sol = c_f_T_3d(coef, set, sol)
            start4 = timer()
        if not check == 'in':
            print 'Check Anastomosis Time', start3 - start2
            print 'Hybrid for n time', start2 - start1
            print 'Solve c,f,T time', start4 - start3

    return sol
def continuous_iter(coef, set, sol):
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol)  #2.1
    else:
        '''Solving X1,X2,X3,X4'''
        start1 = timer()
        sol = c_f_T(coef, set, sol)  #2.3
        start2 = timer()
        print 'Solve X1,X2,X3,X4 time', start2 - start1
    return sol
Exemple #6
0
def continuous_iter(coef, set, sol):
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol) #2.1
    else:
        '''Solving X1,X2,X3,X4'''
        start1 = timer()
        sol = c_f_T(coef, set, sol) #2.3
        start2 = timer()
        print 'Solve X1,X2,X3,X4 time', start2-start1
    return sol
Exemple #7
0
def continuous_iter(coef, set, sol):
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol) #2.1
    else:
        '''Solving c,b,n'''
        n_o = 0
        if set['layout'] == '2D':
            start1 = timer()
            sol = c_f_T(coef, set, sol, n_o) #2.3
            start2 = timer()
        print 'Solve c,f,T time', start2-start1
    return sol
def continuous_iter(coef, set, sol):
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol)  #2.1
    else:
        '''Solving c,b,n'''
        n_o = 0
        if set['layout'] == '2D':
            start1 = timer()
            sol = c_f_T(coef, set, sol, n_o)  #2.3
            start2 = timer()
        print 'Solve c,f,T time', start2 - start1
    return sol
def con_(coef, set, sol, check = 'out'):                       
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol)  
    else:
        '''Solving n'''
        sol = continuous_n_(coef, set, sol)
              
        '''Solving c,f,T'''
        if set['layout'] == '2D':
            sol = c_f_T(coef, set, sol)
        if set['layout'] == '3D':
            sol = c_f_T_3d(coef, set, sol)
                    
    return sol
def boolean_1_iter(coef, set, sol):  #2
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol)  #2.1
    else:
        '''2. Branching and Movement'''
        start1 = timer()
        sol, n_o = hybrid_tech(coef, set, sol)  #2.2
        start2 = timer()
        '''Solving c,f,T'''
        sol = c_f_T(coef, set, sol, n_o)  #2.3
        start3 = timer()
        print 'Hybrid for n time', start2 - start1
        print 'Solve c,f,T time', start3 - start2

    return sol
def boolean_1_iter(coef, set, sol, check = 'out'):                       
    if set['k'] == 0:
        '''Initial Profile'''
        sol = initial_prof(coef, set, sol)  
        sol = init_m(coef,set,sol)
    else:                             
        if len(sol['sp_stop']) == len(sol['matrix_tip']):
            sol['stop_iter'] = 100000 #sp_stop harus dicek di setiap movement and branching. karena sudah tidak bergerak lagi yang ada di list ini.
            print 'all looping itself or anastomosis'
            check = 'in'
        else:
            '''2. Branching and Movement''' 
            start1 = timer()  
            sol = hybrid_tech_c(coef, set, sol)
            start2 = timer()
            '''1. Anastomosis & Tip Cell'''
            sol = check_anastomosis(sol)
            start3 = timer()
            if not coef['Mic'] == 0 or not coef['Kappa'] == 0:
                #print set['tm'], set['t']
                if set['t'] >= set['tm']:
                    #print sol['kk']
                    if sol['kk'] == 1:
                        #sol = init_m(coef,set,sol)
                        sol['kk']+= 1
                    else:
                        sol['kk'] = 10
                        #print 'enter here'
                        sol = hybrid_tech_m(coef, set, sol)
                        start4 = timer()
                '''Solving c,f,T'''
                sol = c_f_T(coef, set, sol)
                start5 = timer()            
        if not check == 'in':
            print 'Check Anastomosis Time', start3-start2
            print 'Hybrid for n time', start2-start1
            if not coef['Mic'] == 0 or not coef['Kappa'] == 0:
                if sol['kk'] > 2:
                    print 'Hybrid for m time', start4-start3
                    print 'Solve c,f,T time', start5-start4
                else:
                    print 'Solve c,f,T time', start5-start3
            else:
                print 'Solve c,f,T time', start5-start3
                    
    return sol