# jumping out of the loop when running single simulation. Will stay in the loop for e.g. parameter scan 
        if singleSimulation:
            break
        else:
            consecutiveRunCounter += 1
            if consecutiveRunCounter >= maxNumberOfConsecutiveRuns:
                relaunch = True
                break

                #     print 'allowRelaunch=',allowRelaunch,' relaunch=',relaunch

    if allowRelaunch and relaunch:
        from ParameterScanUtils import getParameterScanCommandLineArgList
        from SystemUtils import getCC3DRunScriptPath

        popenArgs = [getCC3DRunScriptPath()] + getParameterScanCommandLineArgList(fileName)
        # print 'popenArgs=',popenArgs

        #         print 'WILL RESTART RUN SCRIPT FOR PARAMETER SCAN'
        #         import time
        #         time.sleep(5)

        from subprocess import Popen

        cc3dProcess = Popen(popenArgs)



except (IndentationError, SyntaxError, IOError, ImportError, NameError) as e:
    if CompuCellSetup.simulationObjectsCreated:
        sim.finish()
        if singleSimulation:
            break
        else:
            consecutiveRunCounter += 1
            if consecutiveRunCounter >= maxNumberOfConsecutiveRuns:
                relaunch = True
                break

#     print 'allowRelaunch=',allowRelaunch,' relaunch=',relaunch

    if allowRelaunch and relaunch:

        from ParameterScanUtils import getParameterScanCommandLineArgList
        from SystemUtils import getCC3DRunScriptPath

        popenArgs = [getCC3DRunScriptPath()
                     ] + getParameterScanCommandLineArgList(fileName)
        # print 'popenArgs=',popenArgs

        #         print 'WILL RESTART RUN SCRIPT FOR PARAMETER SCAN'
        #         import time
        #         time.sleep(5)

        from subprocess import Popen
        cc3dProcess = Popen(popenArgs)

except IndentationError, e:
    if CompuCellSetup.simulationObjectsCreated:
        sim.finish()
    traceback_message = traceback.format_exc()
    print traceback_message
        # jumping out of the loop when running single simulation. Will stay in the loop for e.g. parameter scan 
        if singleSimulation:
            break
        else:
            consecutiveRunCounter += 1
            if consecutiveRunCounter >= maxNumberOfConsecutiveRuns:
                relaunch = True
                break

                #     print 'allowRelaunch=',allowRelaunch,' relaunch=',relaunch

    if allowRelaunch and relaunch:
        from ParameterScanUtils import getParameterScanCommandLineArgList
        from SystemUtils import getCC3DRunScriptPath

        popenArgs = [getCC3DRunScriptPath()] + getParameterScanCommandLineArgList(fileName)
        # print 'popenArgs=',popenArgs

        #         print 'WILL RESTART RUN SCRIPT FOR PARAMETER SCAN'
        #         import time
        #         time.sleep(5)

        from subprocess import Popen

        cc3dProcess = Popen(popenArgs)



except (IndentationError, SyntaxError, IOError, ImportError, NameError) as e:
    if CompuCellSetup.simulationObjectsCreated:
        sim.finish()
if not appended:
    sys.path.append(swig_lib_install_path)


from ParameterScanUtils import getParameterScanCommandLineArgList   
import ParameterScanEnums
from SystemUtils import getCC3DRunScriptPath,getCC3DPlayerRunScriptPath,getCommandLineArgList

maxNumberOfRuns=-1 # if negative we use infinite while loop to run parameter scan

# For a gui-less run example command could look like 
# ./psrun.sh -i <SIMUNLATION_FILE> 
# this in turn would call ./runScript.sh -i <SIMUNLATION_FILE>
commandLineArgs=getCommandLineArgList()
print 'commandLineArgs=',commandLineArgs
cc3dScriptPath=getCC3DRunScriptPath()

# check if user requests parameter scan to be run from the GUI
usingGui=False
for arg in commandLineArgs:
    if arg=='--guiScan':
        # in a run with gui the example command could look like 
        # ./psrun.sh -i <SIMUNLATION_FILE> --guiScan
        # this in turn would call ./compucell3d.sh -i <SIMUNLATION_FILE> --guiScan
        cc3dScriptPath=getCC3DPlayerRunScriptPath()
        usingGui=True
        
popenArgs =[cc3dScriptPath] + getCommandLineArgList()

# when not using gui we pass --exitWhenDone to the run script to let it know that after each run it is supposed to exit rather than
# keep executing parameter scan. This way the consecutive parameter scan runs willbe managed entirely in this script rasther than using legacy 
示例#5
0
appended = sys.path.count(swig_lib_install_path)
if not appended:
    sys.path.append(swig_lib_install_path)

from ParameterScanUtils import getParameterScanCommandLineArgList
import ParameterScanEnums
from SystemUtils import getCC3DRunScriptPath, getCC3DPlayerRunScriptPath, getCommandLineArgList

maxNumberOfRuns = -1  # if negative we use infinite while loop to run parameter scan

# For a gui-less run example command could look like
# ./psrun.sh -i <SIMUNLATION_FILE>
# this in turn would call ./runScript.sh -i <SIMUNLATION_FILE>
commandLineArgs = getCommandLineArgList()
print 'commandLineArgs=', commandLineArgs
cc3dScriptPath = getCC3DRunScriptPath()

# check if user requests parameter scan to be run from the GUI
usingGui = False
for arg in commandLineArgs:
    if arg == '--guiScan':
        # in a run with gui the example command could look like
        # ./psrun.sh -i <SIMUNLATION_FILE> --guiScan
        # this in turn would call ./compucell3d.sh -i <SIMUNLATION_FILE> --guiScan
        cc3dScriptPath = getCC3DPlayerRunScriptPath()
        usingGui = True

popenArgs = [cc3dScriptPath] + getCommandLineArgList()

# when not using gui we pass --exitWhenDone to the run script to let it know that after each run it is supposed to exit rather than
# keep executing parameter scan. This way the consecutive parameter scan runs willbe managed entirely in this script rasther than using legacy