gui.py
def openProbRealActions():
    """Opens window for generating problem realization."""
    global prob, states
    numOfSim, T = prUi.leNumOfSim.text(), prUi.leEndTime.text(),
    n, X0 = prUi.leNumOfSamp.text(), prUi.leX0.text()

    nFine = prUi.leNFine.text()
    printTrue = prUi.checkPrint.checkState()
    logging.debug("T: %s",T)
    logging.debug("n: %s",n)
    logging.debug("numOfSim: %s",numOfSim)
    try:
        t = np.linspace(0,float(T),float(n)+1)
        nFine = int(nFine)
        X0 = np.fromstring(X0,sep=",")
        # print("X0: ",X0)
        X0 = np.reshape(X0,(len(X0),))
        # print("reshaped X0: ",X0)
        numOfSim = int(numOfSim)
    except ValueError:
        openMessageBox(("T, n and number of simulations must be numbers."
            +" X0 is a vector of d values seperated by comma."))
        return
    try:
        prob = SDEprob.SDEprob(spec=spec,t=t,m=spec.m,X0=X0,
            totSimNum=numOfSim,nFine=nFine,printTrue=printTrue)
    except MemoryError:
        print("Memory-error raised, SDEprob not created.")
        return
    if prob.completed == False:
        return
    states[1]= (
        "Size of Wiener matrix (time x Wiener x simulation) = "
        + str(prob.W.shape) + ", T = " + T + ", n = " + n + ".")
    print("Problem realization state: ",states[1])
    updateObjectStates()
    pr.close()
    pra.show()
Opens window for generating problem realization.
Opens window for generating problem realization.
Opens window for generating problem realization .
def openProbRealActions():
    global prob, states
    numOfSim, T = prUi.leNumOfSim.text(), prUi.leEndTime.text(),
    n, X0 = prUi.leNumOfSamp.text(), prUi.leX0.text()
    nFine = prUi.leNFine.text()
    printTrue = prUi.checkPrint.checkState()
    logging.debug("T: %s",T)
    logging.debug("n: %s",n)
    logging.debug("numOfSim: %s",numOfSim)
    try:
        t = np.linspace(0,float(T),float(n)+1)
        nFine = int(nFine)
        X0 = np.fromstring(X0,sep=",")
        X0 = np.reshape(X0,(len(X0),))
        numOfSim = int(numOfSim)
    except ValueError:
        openMessageBox(("T, n and number of simulations must be numbers."
            +" X0 is a vector of d values seperated by comma."))
        return
    try:
        prob = SDEprob.SDEprob(spec=spec,t=t,m=spec.m,X0=X0,
            totSimNum=numOfSim,nFine=nFine,printTrue=printTrue)
    except MemoryError:
        print("Memory-error raised, SDEprob not created.")
        return
    if prob.completed == False:
        return
    states[1]= (
        "Size of Wiener matrix (time x Wiener x simulation) = "
        + str(prob.W.shape) + ", T = " + T + ", n = " + n + ".")
    print("Problem realization state: ",states[1])
    updateObjectStates()
    pr.close()
    pra.show()
def openProbRealActions ( ) : global prob , states numOfSim , T = prUi . leNumOfSim . text ( ) , prUi . leEndTime . text ( ) , n , X0 = prUi . leNumOfSamp . text ( ) , prUi . leX0 . text ( ) nFine = prUi . leNFine . text ( ) printTrue = prUi . checkPrint . checkState ( ) logging . debug ( "T: %s" , T ) logging . debug ( "n: %s" , n ) logging . debug ( "numOfSim: %s" , numOfSim ) try : t = np . linspace ( 0 , float ( T ) , float ( n ) + 1 ) nFine = int ( nFine ) X0 = np . fromstring ( X0 , sep = "," ) X0 = np . reshape ( X0 , ( len ( X0 ) , ) ) numOfSim = int ( numOfSim ) except ValueError : openMessageBox ( ( "T, n and number of simulations must be numbers." + " X0 is a vector of d values seperated by comma." ) ) return try : prob = SDEprob . SDEprob ( spec = spec , t = t , m = spec . m , X0 = X0 , totSimNum = numOfSim , nFine = nFine , printTrue = printTrue ) except MemoryError : print ( "Memory-error raised, SDEprob not created." ) return if prob . completed == False : return states [ 1 ] = ( "Size of Wiener matrix (time x Wiener x simulation) = " + str ( prob . W . shape ) + ", T = " + T + ", n = " + n + "." ) print ( "Problem realization state: " , states [ 1 ] ) updateObjectStates ( ) pr . close ( ) pra . show ( )
Opens window for generating problem realization.
Opens window for generating problem realization .
"""Opens window for generating problem realization.""" # print("X0: ",X0)
 # print("reshaped X0: ",X0)
