kidney_env.py 文件源码

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

项目:gym-kidney 作者: camoy 项目源码 文件源码
def _render(self, mode = "human", close = False):
        if close:
            return

        import matplotlib.pyplot as plt

        if self.tick == 0:
            plt.ion()

        G = self.G
        attrs = nx.get_node_attributes(G, "ndd")
        values = ["red" if attrs[v] else "blue" for v in G.nodes()]

        plt.clf()
        nx.draw(G,
            pos = nx.circular_layout(G),
            node_color = values)
        plt.pause(0.01)

        return []
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号