state_machine.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:vivarium 作者: ihmeuw 项目源码 文件源码
def to_dot(self):
        """Produces a ball and stick graph of this state machine.

        Returns
        -------
        `graphviz.Digraph`
            A ball and stick visualization of this state machine.
        """
        from graphviz import Digraph
        dot = Digraph(format='png')
        for state in self.states:
            if isinstance(state, TransientState):
                dot.node(state.name(), style='dashed')
            else:
                dot.node(state.name())
            for transition in state.transition_set:
                dot.edge(state.name(), transition.output.name(), transition.label())
        return dot
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号