Example #1
0
File: gui.py Project: sybila/BCSgen
    def compute(self):
        myNet, state = Implicit.generateReactions(self.model)
        myNet.printReactions(self.reactions)
        self.len_reactions.config(text="Reactions: " + str(myNet.getNumOfReactions()))
        states, edges, orderedAgents = Gen.generateStateSpace(myNet, state, int(self.bound.get()))
        self.len_states.config(text="States: " + str(len(states)))
        self.len_edges.config(text="Edges: " + str(len(edges)))
        Gen.printStateSpace(states, edges, orderedAgents, self.vertices, self.edges)

        self.compute.config(text="Finish")
        self.compute.config(command=root.destroy)
Example #2
0
print
print "Processing..."
starttime = time()
print 

################################################

print "Example 1:"
bound = 1
sys.stdout.write("Reaction network ... ")
sys.stdout.flush()
myNet, state = Implicit.generateReactions("inputs/model1.bcs")
print "DONE"
sys.stdout.write("State space ... ")
sys.stdout.flush()
states, edges, orderedAgents = Gen.generateStateSpace(myNet, state, bound)
Gen.printStateSpace(states, edges, orderedAgents, "outputs/vertices1.txt", "outputs/edges1.txt")
print "DONE"
print "---------------------------"

################################################

print "Example 2"
bound = 2
sys.stdout.write("Reaction network ... ")
sys.stdout.flush()
myNet, state = Implicit.generateReactions("inputs/model2.bcs")
print "DONE"
sys.stdout.write("State space ... ")
sys.stdout.flush()
states, edges, orderedAgents = Gen.generateStateSpace(myNet, state, bound)
Example #3
0
import os
import sys
sys.path.append(os.path.abspath('../Core/'))
import State_space_generator as Gen
import Implicit_reaction_network_generator as Implicit

inputFile = sys.argv[-4]
bound = sys.argv[-3]
statesFile = sys.argv[-2]
edgesFile = sys.argv[-1]

myNet, state = Implicit.generateReactions(inputFile)

states, edges, orderedAgents = Gen.generateStateSpace(myNet, state, bound)

Gen.printStateSpace(states, edges, orderedAgents, statesFile, edgesFile)