#NEWLINE# def parameter( self , name , value , factor = 1 , prior = None ) : #NEWLINE# #INDENT# "Adds a parameter to the Builder's model instance.\n\n        Examines the params_dict attribute of the Builder instance (which is\n        set in the constructor,\n        :py:meth:`pysb.builder.Builder.__init__`).  If the\n        parameter with the given name is in the ``params_dict``, then the value\n        in the ``params_dict`` is used to construct the parameter, and the\n        argument ``value`` is ignored. If the parameter is not in\n        ``params_dict``, then the parameter is assigned ``value``.\n\n        Furthermore, in all cases the parameter value is multiplied by a\n        scaling factor specified by the argument ``factor``. This allows rate\n        scaling factor that are dependent on model implementations or on units\n        (deterministic vs. stochastic) to be handled by keeping the same\n        parameter value but passing in the appropriate value for ``factor``.\n\n        Parameters\n        ----------\n        name : string\n            The name of the parameter to add\n        value : number\n            The value of the parameter\n        factor : number\n            A scaling factor to be applied to the parameter value.\n        prior : instance of prior class from bayessb.priors\n            The prior object describing the prior probability of different\n            values for this parameter, if the parameter should be included among\n            the parameters to estimate (contained in the set\n            ``Builder.estimate_params``).\n        " #NEWLINE# if ( self . params_dict is None ) : #NEWLINE# #INDENT# param_val = ( value * factor ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( name in self . params_dict ) : #NEWLINE# #INDENT# param_val = ( self . params_dict [ name ] * factor ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# param_val = ( param_val * factor ) #NEWLINE# #UNINDENT# #UNINDENT# p = Parameter ( name , param_val , _export = False ) #NEWLINE# self . model . add_component ( p ) #NEWLINE# if ( prior is not None ) : #NEWLINE# #INDENT# self . estimate_params . append ( p ) #NEWLINE# self . priors . append ( prior ) #NEWLINE# #UNINDENT# return p