def set_concentration(self, cplx_pat, value): """ Generates a BNG action command and adds it to the command queue Parameters ---------- cplx_pat: pysb.ComplexPattern or string Species ComplexPattern, or a BNG format string representation value: float-like Initial concentration """ if isinstance(cplx_pat, basestring): formatted_name = cplx_pat else: formatted_name = format_complexpattern( pysb.core.as_complex_pattern(cplx_pat)) self.command_queue.write('\tsetConcentration("%s", %g)\n' % (formatted_name, value))
def set_concentration(self, cplx_pat, value): """ Generates a BNG action command and adds it to the command queue Parameters ---------- cplx_pat: pysb.ComplexPattern or string Species ComplexPattern, or a BNG format string representation value: float-like Initial concentration """ if isinstance(cplx_pat, basestring): formatted_name = cplx_pat else: formatted_name = format_complexpattern( pysb.core.as_complex_pattern(cplx_pat) ) self.command_queue.write('\tsetConcentration("%s", %g)\n' % ( formatted_name, value))