Exemplo n.º 1
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);
Exemplo n.º 2
0
    def testVisualizeLocalOrderParameterNoFailures(self):
        net = sync_network(10, ccore = False);
        output_dynamic = net.simulate_static(20, 10, solution = solve_type.FAST, collect_dynamic = True);

        sync_visualizer.show_local_order_parameter(output_dynamic, net);
        sync_visualizer.show_local_order_parameter(output_dynamic, net, 0);
        sync_visualizer.show_local_order_parameter(output_dynamic, net, 5);
        sync_visualizer.show_local_order_parameter(output_dynamic, net, 5, 20);
Exemplo n.º 3
0
    def testVisualizeLocalOrderParameterNoFailures(self):
        net = sync_network(10, ccore=False)
        output_dynamic = net.simulate_static(20,
                                             10,
                                             solution=solve_type.FAST,
                                             collect_dynamic=True)

        sync_visualizer.show_local_order_parameter(output_dynamic, net)
        sync_visualizer.show_local_order_parameter(output_dynamic, net, 0)
        sync_visualizer.show_local_order_parameter(output_dynamic, net, 5)
        sync_visualizer.show_local_order_parameter(output_dynamic, net, 5, 20)
Exemplo n.º 4
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)
Exemplo n.º 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)