def test_attack_ordered():
    ugraph_network = load_graph('computer_network.txt')
    ugraph_ER = ugraph_probability(NODES, P)
    attack_ordered((ugraph_network, ugraph_ER))
    data_file = open('data_resilience_ordered.p', 'rb') 
    
    cc_set = pickle.load(data_file)
    data_file.close()
    print('test attack:')     
    print("cc_network length: %d, cc_er length: %d" %(len(cc_set[0]), len(cc_set[1])))
    print("cc_network: %s\n%s" %(cc_set[0][-6:], cc_set[0][:6]))    
    print("cc_er: %s\n%s" %(cc_set[1][-6:], cc_set[1][:6])) 
def test_attack_ordered():
    ugraph_network = load_graph('computer_network.txt')
    ugraph_ER = ugraph_probability(NODES, P)
    attack_ordered((ugraph_network, ugraph_ER))
    data_file = open('data_resilience_ordered.p', 'rb')

    cc_set = pickle.load(data_file)
    data_file.close()
    print('test attack:')
    print("cc_network length: %d, cc_er length: %d" %
          (len(cc_set[0]), len(cc_set[1])))
    print("cc_network: %s\n%s" % (cc_set[0][-6:], cc_set[0][:6]))
    print("cc_er: %s\n%s" % (cc_set[1][-6:], cc_set[1][:6]))
def test_ro():
    ugraph = ugraph_probability(10, 0.3)
    print random_order(ugraph)
Пример #4
0
def test_to_ER():
    #test targeted_order with ugraph_ER
    from ER_ugraph import ugraph_probability
    ugraph = ugraph_probability(10, 0.4)
    print("test targeted graph: %s" % targeted_order(ugraph))
def test_to_ER():
    #test targeted_order with ugraph_ER
    from ER_ugraph import ugraph_probability
    ugraph = ugraph_probability(10, 0.4)
    print("test targeted graph: %s" %targeted_order(ugraph))
Пример #6
0
def test_ro():
    ugraph = ugraph_probability(10, 0.3)
    print random_order(ugraph)