mdp_visualizer.py 文件源码

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

项目:simple_rl 作者: david-abel 项目源码 文件源码
def _draw_title_text(mdp, screen):
    '''
    Args:
        mdp (simple_rl.MDP)
        screen (pygame.Surface)

    Summary:
        Draws the name of the MDP to the top of the screen.
    '''
    scr_width, scr_height = screen.get_width(), screen.get_height()
    title_split = str(mdp).split("_")
    title = title_split[0]
    param_text = " ("
    for param in title_split[1:-1]:
        param_text += param + ", "
    param_text += title_split[-1] + ")"
    formatted_title_text = title[0].upper() + title[1:] + param_text
    title_text = title_font.render(formatted_title_text, True, (46, 49, 49))
    screen.blit(title_text, (scr_width / 2.0 - len(formatted_title_text)*6, scr_width / 20.0))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号