Ejemplo n.º 1
0
    interactions = networks[letter]['interactions']
    edges = interactions.keys()
    thresholds = networks[letter]['thresholds']
    IG = nx.DiGraph()
    IG.add_edges_from(edges)
                
    mc = dict_to_model(interactions, thresholds=thresholds, add_morphogene=True)
    smallmc = dict_to_model(interactions, thresholds=thresholds, add_morphogene=False)

    lpss = mc._psc._localParameterSets
    print len(mc._psc), "parameter sets."

    gpss = mc._psc.get_parameterSets()
    countaccepted = 0
    countrejected = 0
    for gps in gpss:
        #print gps
        subgps = dict((combi, encode_gps_full(subparset(gps, is_m1_in=combi[0], is_m2_in=combi[1]))) for combi in combis)
        parameter_set_IG_list = [decode_gps_full(subgps[combi]) for combi in combis]
        parameter_sets = [elem[0] for elem in parameter_set_IG_list]
        accepted = all(filter_byAL(smallmc, parameter_sets[i], ALformulas[i]) for i in range(3))*1
        if accepted:
            print "accepting:", gps
            export_STG(mc, gps, filename="_nonboolean_"+letter+"_"+encode_gps(gps, base=10)+".gml", initialRules=None)
            countaccepted += 1
        else:
            print "rejecting:", gps
            countrejected += 1
    print "accepted:", countaccepted
    print "rejected:", countrejected
        
Ejemplo n.º 2
0
    
    shelvefilename = "_10_small_gps_pass_test_from_unconstrained_without_overregulated.db"
    #shelvefilename = "_10_small_gps_pass_test.db"
    d = shelve.open(shelvefilename)    

    start = 0
    setstocheck = lenallsets
    
    for i, code in enumerate(allsetslist[start:start+setstocheck]):
        if not i%100 and i!=0:
            print i, "sets done"
            tend = datetime.now()
            print "total execution time:", tend - tstart
            print "expected finishing time:", tstart + (tend - tstart) * setstocheck / i
        tmp = []
        parameterset, IG = decode_gps_full(code)
        mc = MC.ModelContainer()
        mc.set_IG(IG)
        mc.set_thresholds(dict((edge, 1) for edge in mc._IG.edges()))
        mc.set_dynamics("asynchronous")
        mc.set_initialStates()
        for CTLspec in CTLformulas:
            mccopy = mc
            accepted = filter_single_parameterSet_byCTL(mccopy, parameterset, CTLspec, search="exists")
            #if accepted: print "accepted:", code
            tmp.append(accepted*1)
        d[code] = tmp
        
    d.close()
    tend = datetime.now()
    print "total execution time:", tend-tstart