Example #1
0
def test_robustness(bowtie_network):
    net = bowtie_network
    save_network_as_fullgraph(net)
    w = net.factory.world
    low, high = w.reg_range

    print w.reg_range
    for e in w.environments:
        orig = net.stabilise(e)[2]
        i = rand.randint(low, high)
        e.flip(i)
        pert = net.stabilise(e)[2] 
        print orig, pert
Example #2
0
def test_1(three_database):
    from bricolage.dot_layout import save_network_as_fullgraph
    from bricolage.graph_maker import GraphType
    p = three_database.population
    t = three_database.targets[0]
    cats = t.calc_categories()
    n = p.get_best()[0]
    print n.fitness
    print n.identifier
    save_network_as_fullgraph(n, graph_type=GraphType.GENE)
    print cats
    print calc_mutual_info(n, cats)

    cmi = MIAnalyzer(n.factory.world, cats)
    print cmi.numpy_info_from_network(n)