Skip to content

Commit

Permalink
Sensitivity Analysis -- Modelling Change
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaikAsifullah committed Jul 13, 2017
1 parent 4bd4ee7 commit 5c459ce
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 11 deletions.
49 changes: 38 additions & 11 deletions tellurium/analysis/sensitivityanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ def __init__(self,model=None,sbml=False,conservedMoietyAnalysis=True):
self._model = model
self._sbml = sbml
self._conservedMoietyAnalysis = conservedMoietyAnalysis
self._preprocessingFunc = None
self._presimulation = None
self._simulation = None
self._bounds = None
self._args = None
self._allowLog = False


@property
Expand Down Expand Up @@ -46,16 +48,28 @@ def conservedMoietyAnalysis(self):


@property
def preprocessingFunc(self):
return self._preprocessingFunc
def simulation(self):
return self._simulation

@preprocessingFunc.setter
def preprocessingFunc(self, value):
self._preprocessingFunc = value
@simulation.setter
def simulation(self, value):
self._simulation = value

@preprocessingFunc.deleter
def preprocessingFunc(self):
del self._preprocessingFunc
@simulation.deleter
def simulation(self):
del self._simulation

@property
def presimulation(self):
return self._presimulation

@presimulation.setter
def presimulation(self, value):
self._presimulation = value

@presimulation.deleter
def presimulation(self):
del self._presimulation


@property
Expand All @@ -82,8 +96,21 @@ def args(self, value):
def args(self):
del self._args

@property
def allowLog(self):
return self._allowLog

def setPreProcessingFunction(self,func,*args):
self._preprocessingFunc = func
@allowLog.setter
def allowLog(self, value):
self._allowLog = value

@allowLog.deleter
def allowLog(self):
del self._allowLog


def setsimulationtion(self,func,*args):
self._simulation = func
self._args = args


18 changes: 18 additions & 0 deletions tellurium/analysis/simulator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class Simulator:
def __init__(self):
self.computed_vales = {}

def pre_simulation(self,model_roadrunner):
model_roadrunner.simulate(0,1000,5000)

def simulate_sensitivity(self, model_roadrunner):
self.push("r1b_k2",model_roadrunner.getCC('PP_K', 'r1b_k2'))
self.push("r8_a8",model_roadrunner.getCC('PP_K', 'r8a_a8'))
self.push("r10a_a10",model_roadrunner.getCC('PP_K', 'r10a_a10'))

def push(self, key, value):
self.computed_vales[key] = value

def get_computed_values(self):
return(self.computed_vales)

0 comments on commit 5c459ce

Please sign in to comment.