コード例 #1
0
import rrPython
import timeit
import cmd

print rrPython.getCopyright()
modelPath = 'R:\\roadrunnerwork\\Models\\BorisEJB.xml'
rrPython.setTempFolder('R:\\rrTemp')
rrPython.enableLogging()
print 'Temp folder is:' + rrPython.getTempFolder()

rrPython.setLogLevel('Info')
level = rrPython.getLogLevel()
print 'Log level is ' + str(level)
rrPython.loadSBMLFromFile(modelPath)

simulations = 10
start_Time = 0
end_Time = 2
number_of_points = 1000

rrPython.setTimeStart(start_Time)
rrPython.setTimeEnd(end_Time)
rrPython.setNumPoints(number_of_points)

t = timeit.Timer('rrPython.simulate()','import rrPython')
totalTime = t.timeit(number = simulations)
meanTime = totalTime/simulations

print 'Average simulation time: ' + str(meanTime) + ' seconds'
コード例 #2
0
import rrPython
import timeit
import cmd

print rrPython.getCopyright()
modelPath = 'R:\\roadrunnerwork\\Models\\BorisEJB.xml'
rrPython.setTempFolder('R:\\rrTemp')
rrPython.enableLogging()
print 'Temp folder is:' + rrPython.getTempFolder()

rrPython.setLogLevel('Info')
level = rrPython.getLogLevel()
print 'Log level is ' + str(level)
rrPython.loadSBMLFromFile(modelPath)

simulations = 10
start_Time = 0
end_Time = 2
number_of_points = 1000

rrPython.setTimeStart(start_Time)
rrPython.setTimeEnd(end_Time)
rrPython.setNumPoints(number_of_points)

t = timeit.Timer('rrPython.simulate()','import rrPython')
totalTime = t.timeit(number = simulations)
meanTime = totalTime/simulations

print 'Average simulation time: ' + str(meanTime) + ' seconds'
コード例 #3
0
import os
import rrPython

print 'RoadRunner Build Date: ' + rrPython.getCopyright()

startTime = 0
endTime = 5
numPoints = 50
selList="time,S1,S2"


result = rrPython.loadSBMLFromFile("..\\Models\\test_1.xml")

rrPython.setTimeStart(startTime)
rrPython.setTimeEnd(endTime)
rrPython.setNumPoints(numPoints)
rrPython.setTimeCourseSelectionList(selList)
k = rrPython.simulate()
print k

print "done"
コード例 #4
0
import rrPython
import os
import csv
os.chdir('C:\\RoadRunner\\bin')

function = 'getCopyright'

try:
    copyright = rrPython.getCopyright()
    if str(copyright) is not False:
        result = 'True'
    else:
        result = 'False'
except:
    result = 'False'


PythonTestResults = open('C:\\RoadRunner\\PythonTestResults.csv','a')
writer = csv.writer(PythonTestResults)
writevar = function + '=' + result
writer.writerow([writevar])
PythonTestResults.close()