def start(self):

        # iterating over all cells in simulation
        for cell in self.cellList:
            # you can access/manipulate cell properties here
            cell.targetVolume = 25
            cell.lambdaVolume = 2.0

        #bionet section
        modelName = "OSCLI"
        modelNickname = "OSC"  # this is usually shorter version version of model name

        fileDir = os.path.dirname(os.path.abspath(__file__))

        modelPath = os.path.join(fileDir, "oscli.sbml")
        print "Path=", modelPath

        integrationStep = 0.02
        bionetAPI.loadSBMLModel(modelName, modelPath, modelNickname,
                                integrationStep)

        bionetAPI.addSBMLModelToTemplateLibrary("OSCLI", "NonCondensing")

        bionetAPI.initializeBionetworks()

        # iterating over all cells in simulation
        state = {}
        for cell in self.cellList:
            if cell.type == self.NONCONDENSING:
                state['S1'] = 0.0
                state['S2'] = 1.0
                bionetAPI.setBionetworkState(cell.id, 'OSCLI', state)
    def start(self):
        
        # iterating over all cells in simulation        
        for cell in self.cellList:
            # you can access/manipulate cell properties here
            cell.targetVolume=25
            cell.lambdaVolume=2.0

        #bionet section        
        modelName = "OSCLI"
        modelNickname  = "OSC" # this is usually shorter version version of model name
        
        fileDir=os.path.dirname (os.path.abspath( __file__ ))
        
        modelPath=os.path.join(fileDir,"oscli.sbml") 
        print "Path=",modelPath        
        
        integrationStep = 0.02
        bionetAPI.loadSBMLModel(modelName , modelPath, modelNickname, integrationStep)
        
        bionetAPI.addSBMLModelToTemplateLibrary("OSCLI","NonCondensing")
        
        bionetAPI.initializeBionetworks()
        
        
        # iterating over all cells in simulation        
        state={}
        for cell in self.cellList:         
            if cell.type==self.NONCONDENSING:
                state['S1']=0.0
                state['S2']=1.0
                bionetAPI.setBionetworkState(cell.id,'OSCLI',state) 
 def start(self):
   #Loading model
   Name = 'DeltaNotch'
   Key  = 'DN'
   
   simulationDir=os.path.dirname (os.path.abspath( __file__ ))
   Path= os.path.join(simulationDir,'DN_Collier.sbml')
   Path=os.path.abspath(Path) # normalizing path
   
   IntegrationStep = 0.2
   bionetAPI.loadSBMLModel(Name, Path, Key, IntegrationStep)
   
   bionetAPI.addSBMLModelToTemplateLibrary(Name,'TypeA')
   bionetAPI.initializeBionetworks()
   
   #Initial conditions
   import random 
   
   state={} #dictionary to store state veriables of the SBML model
   
   for cell in self.cellList:
     if (cell):
       state['D'] = random.uniform(0.9,1.0)
       state['N'] = random.uniform(0.9,1.0)        
       bionetAPI.setBionetworkState(cell.id,'DeltaNotch',state) 
       
       
       cell.dict['D']=state['D']
       cell.dict['N']=state['N']
 def step(self,mcs):
   for cell in self.cellList:
     if (cell): 
       D=0.0; nn=0
       cellNeighborList=self.getCellNeighbors(cell)
       for neighbor in cellNeighborList:
         if (neighbor.neighborAddress):
           nn+=1
           state=bionetAPI.getBionetworkState(neighbor.neighborAddress.id,'DeltaNotch')
           D+=state['D']   
       if (nn>0):
         D=D/nn
         
       state={}  
       state['Davg']=D        
       bionetAPI.setBionetworkState(cell.id,'DeltaNotch',state) 
       
       state=bionetAPI.getBionetworkState(cell.id,'DeltaNotch')
       
       cell.dict['D']=D
       cell.dict['N']=state['N']        
   bionetAPI.timestepBionetworks()