def computeHittingTimes(settings, reverse=False): myMultistrand = MergeSim() myMultistrand.setNumOfThreads(NUM_PROCESS) if settings.type == enum_yurke2: myMultistrand.setOptionsFactory1(simulationYurke2, settings.nTrials) if settings.type == enum_bonnet: myMultistrand.setOptionsFactory2(simulationHairpin, settings.nTrials, reverse) if settings.type == enum_flamm: myMultistrand.setOptionsFactory1(simulationFlamm2000, settings.nTrials) if settings.type == enum_yurke: myMultistrand.setOptionsFactory1(simulationYurke, settings.nTrials) if settings.type == enum_rickettsia: myMultistrand.setOptionsFactory1(simulationRickettsia, 12 * settings.nTrials) myMultistrand.setTerminationCriteria(terminationCount=settings.nTrials) if settings.type == enum_bonnet or settings.type == enum_yurke2: myMultistrand.setPassageMode() # using the pre-set success / fail if settings.type == enum_flamm or settings.type == enum_yurke or settings.type == enum_rickettsia: # non-first stepping mode, no need to store trajectory information myMultistrand.setPassageMode() myMultistrand.run() return myMultistrand.results
def computeRate(selector): myMultistrand = MergeSim() myMultistrand.setOptionsFactory2(genOptions, NUMOFPATHS, selector) myMultistrand.setNumOfThreads(NUMOFTHREADS) myMultistrand.setTerminationCriteria(TERMINATIONCRIT) myMultistrand.setLeakMode() # the new leak object -- faster bootstrapping. myMultistrand.printTrajectory() return 0.0, 0.0, 0.0 myMultistrand.run() myFSR = myMultistrand.results low, high = myFSR.doBootstrap() return myFSR.k1(), low, high