当前位置: 首页>>代码示例>>Python>>正文


Python Messages.calculate_at_equilibrium方法代码示例

本文整理汇总了Python中messages.Messages.calculate_at_equilibrium方法的典型用法代码示例。如果您正苦于以下问题:Python Messages.calculate_at_equilibrium方法的具体用法?Python Messages.calculate_at_equilibrium怎么用?Python Messages.calculate_at_equilibrium使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在messages.Messages的用法示例。


在下文中一共展示了Messages.calculate_at_equilibrium方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _code_fitness

# 需要导入模块: from messages import Messages [as 别名]
# 或者: from messages.Messages import calculate_at_equilibrium [as 别名]
    def _code_fitness(self, code, codon_usage = None):
        """ Gets the overall fitness of a code at the given codon usage,
            if no codon usage is given the codon usage of the 
            currently fixed code at equilibrium is used. """
        
        fitness_contributions = None

        if codon_usage is None:
            if self._last_messages is None:
                if code == self._current_code:
                    msgs = Messages(self._current_code.effective_code_matrix,
                                    self._fitness_matrix,
                                    self._message_mutation_matrix)
                    msgs.calculate_at_equilibrium()
                    self._last_messages = msgs
                    fitness_contributions = msgs.fitness_contributions
                else:
                    self._code_fitness(self._current_code)

        if fitness_contributions is None:
            msgs = Messages(code.effective_code_matrix,
                            self._fitness_matrix,
                            self._message_mutation_matrix)
            msgs.calculate_at_codon_usage(self._last_messages.codon_usage)
            fitness_contributions = msgs.fitness_contributions

        overall_fitness = self._overall_fitness(fitness_contributions)

        if codon_usage is None and code == self._current_code:
            self._current_code_fitness = overall_fitness

        return overall_fitness
开发者ID:kkauffman,项目名称:tRNAModel,代码行数:34,代码来源:evolver.py


注:本文中的messages.Messages.calculate_at_equilibrium方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。