欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Graphviz

程序员文章站 2022-04-26 22:10:48
...

Graphviz

Graphviz 是一个由AT&T实验室启动的开源工具包,用于绘制DOT语言脚本描述的图形。

Graphviz 下载安装(Windows)

Graphviz 官网
Graphviz
Graphviz
Graphviz
命令行界面,输入dot -version,安装成功
Graphviz

配置环境变量

路径"C:\Program Files (x86)\Graphviz2.38\bin",加入到系统变量Path中,结束。

教程

使用Graphviz画状态机转移图太爽了,强力推荐。简单易学,通俗易懂
Graphviz

digraph FSM {
    label = "Gluttonous Snake FSM State Transition Diagram"
    
    S0_FD[label = "S0->FD" shape = ellipse style=filled]
    S1_TL[label = "S1->TL" shape = ellipse]
    S2_TR_FD[label = "S2->TR&FD" shape = ellipse]
    S3_TL_FD[label = "S3->TL&FD" shape = ellipse]
    S4_OVER[label = "S4->OVER" shape = ellipse]
   
    S0_FD -> S1_TL [label = "(SL|SR|SF)&(~FOOD)" ]
    S0_FD -> S0_FD [label = "(~SL)&(~SR)&(~SF)&(~FOOD)" color=blue]
    S0_FD -> S4_OVER [label = "FOOD" shape = circle]

    S1_TL -> S1_TL [label = "(SL|SR|SF)&(~FOOD)"]
    S1_TL -> S2_TR_FD [label = "(~SL)&(~SR)&(~SF)&(~FOOD)"]
    S1_TL -> S4_OVER [label = "FOOD"]

    S2_TR_FD -> S2_TR_FD [label = "(~SR)&(~FOOD)"]    
    S2_TR_FD -> S3_TL_FD [label = "(SR)&(~FOOD)"]
    S2_TR_FD -> S4_OVER [label = "FOOD"]

    S3_TL_FD -> S3_TL_FD [label = "(~SL)&(SR|SF)&(~FOOD)"]
    S3_TL_FD -> S2_TR_FD [label = "(~SL)&(~SR)&(~SF)&(~FOOD)"]
    S3_TL_FD -> S4_OVER [label = "FOOD"]
}
相关标签: Graphviz