예제 #1
0
    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))
예제 #2
0
파일: bng.py 프로젝트: LoLab-VU/pysb
    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))