How to use the gillespy2.AssignmentRule function in gillespy2

To help you get started, we’ve selected a few gillespy2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github StochSS / stochss / stochss / handlers / util / run_model.py View on Github external
Attributes
        ----------
        args : dict
            A json representation of an assignment rule.
        species : list
            List of GillesPy2 species.
        parameter : list
            List of GillesPy2 parameters.
        '''
        name = args['name'].strip()
        variable = list(filter(lambda s: s.name == args['variable']['name'], species))
        if not len(variable):
            variable = list(filter(lambda p: p.name == args['variable']['name'], parameters))
        expression = args['expression'].strip()
        return AssignmentRule(name=name, variable=variable[0].name, formula=expression)