コード例 #1
0
def template_clustering(file,
                        radius,
                        order,
                        show_dyn=False,
                        show_conn=False,
                        show_clusters=True,
                        ena_conn_weight=False,
                        ccore_flag=True,
                        tolerance=0.1):
    sample = read_sample(file)
    network = syncnet(sample,
                      radius,
                      enable_conn_weight=ena_conn_weight,
                      ccore=ccore_flag)

    (ticks, analyser) = timedcall(network.process, order, solve_type.FAST,
                                  show_dyn)
    print("Sample: ", file, "\t\tExecution time: ", ticks, "\n")

    if (show_dyn == True):
        sync_visualizer.show_output_dynamic(analyser)
        sync_visualizer.animate(analyser)
        #sync_visualizer.animate_output_dynamic(analyser);
        #sync_visualizer.animate_correlation_matrix(analyser, colormap = 'hsv');

    if ((show_conn == True) and (ccore_flag == False)):
        network.show_network()

    if (show_clusters == True):
        clusters = analyser.allocate_clusters(tolerance)
        print("amout of clusters: ", len(clusters))
        draw_clusters(sample, clusters)
コード例 #2
0
    def templateVisualizerNoFailures(self, size, velocity, ccore_flag):
        net = sync_network(size, ccore=ccore_flag)
        output_dynamic = net.simulate_dynamic(solution=solve_type.FAST,
                                              collect_dynamic=True)

        sync_visualizer.animate(output_dynamic)
        sync_visualizer.animate_correlation_matrix(output_dynamic, velocity)
        sync_visualizer.animate_output_dynamic(output_dynamic, velocity)
        sync_visualizer.show_correlation_matrix(output_dynamic)
        sync_visualizer.show_output_dynamic(output_dynamic)
コード例 #3
0
def template_animate_output_dynamic(title, amount_oscillators,
                                    coupling_stregth, frequency, order):
    network = sync_network(amount_oscillators,
                           coupling_stregth,
                           frequency,
                           ccore=True)
    sync_output_dynamic = network.simulate_dynamic(order,
                                                   solution=solve_type.RK4,
                                                   collect_dynamic=True)

    sync_visualizer.animate(sync_output_dynamic, title)
コード例 #4
0
 def templateVisualizerNoFailures(size, velocity, ccore_flag):
     net = sync_network(size, ccore = ccore_flag);
     output_dynamic = net.simulate_dynamic(solution = solve_type.FAST, collect_dynamic = True);
     
     sync_visualizer.animate(output_dynamic);
     sync_visualizer.animate_correlation_matrix(output_dynamic, velocity);
     sync_visualizer.animate_output_dynamic(output_dynamic, velocity);
     sync_visualizer.animate_phase_matrix(output_dynamic, 1, size, velocity);
     sync_visualizer.show_correlation_matrix(output_dynamic);
     sync_visualizer.show_output_dynamic(output_dynamic);
     sync_visualizer.show_phase_matrix(output_dynamic, 1, size);
     sync_visualizer.show_order_parameter(output_dynamic);
     sync_visualizer.show_local_order_parameter(output_dynamic, net);
コード例 #5
0
def template_clustering(file, radius, order, show_dyn = False, show_conn = False, show_clusters = True, ena_conn_weight = False, ccore_flag = True, tolerance = 0.1):
    sample = read_sample(file)
    syncnet_instance = syncnet(sample, radius, enable_conn_weight = ena_conn_weight, ccore = ccore_flag)

    (ticks, analyser) = timedcall(syncnet_instance.process, order, solve_type.FAST, show_dyn)
    print("Sample: ", file, "\t\tExecution time: ", ticks)

    if show_dyn == True:
        sync_visualizer.show_output_dynamic(analyser)
        sync_visualizer.animate(analyser)
        sync_visualizer.show_local_order_parameter(analyser, syncnet_instance)
        #sync_visualizer.animate_output_dynamic(analyser);
        #sync_visualizer.animate_correlation_matrix(analyser, colormap = 'hsv')
     
    if show_conn == True:
        syncnet_instance.show_network()
     
    if show_clusters == True:
        clusters = analyser.allocate_clusters(tolerance)
        print("Amount of allocated clusters: ", len(clusters))
        draw_clusters(sample, clusters)
    
    print("----------------------------\n")
    return (sample, clusters)
コード例 #6
0
def template_clustering(file, radius, order, show_dyn = False, show_conn = False, show_clusters = True, ena_conn_weight = False, ccore_flag = True, tolerance = 0.1):
    sample = read_sample(file)
    syncnet_instance = syncnet(sample, radius, enable_conn_weight = ena_conn_weight, ccore = ccore_flag)

    (ticks, analyser) = timedcall(syncnet_instance.process, order, solve_type.FAST, show_dyn)
    print("Sample: ", file, "\t\tExecution time: ", ticks)

    if show_dyn == True:
        sync_visualizer.show_output_dynamic(analyser)
        sync_visualizer.animate(analyser)
        sync_visualizer.show_local_order_parameter(analyser, syncnet_instance)
        #sync_visualizer.animate_output_dynamic(analyser);
        #sync_visualizer.animate_correlation_matrix(analyser, colormap = 'hsv')
     
    if show_conn == True:
        syncnet_instance.show_network()
     
    if show_clusters == True:
        clusters = analyser.allocate_clusters(tolerance)
        print("Amount of allocated clusters: ", len(clusters))
        draw_clusters(sample, clusters)
    
    print("----------------------------\n")
    return (sample, clusters)
コード例 #7
0
def template_animate_output_dynamic(title, amount_oscillators, coupling_stregth, frequency, order):
    network = sync_network(amount_oscillators, coupling_stregth, frequency, ccore = True);
    sync_output_dynamic = network.simulate_dynamic(order, solution = solve_type.RK4, collect_dynamic = True);
    
    sync_visualizer.animate(sync_output_dynamic, title);