我用graphviz画了一张照片。请参阅FSM。 我觉得这很难看,因为自循环边缘很短。 边缘的属性“minlen”对我不起作用。 我尝试了节点的几个端口,但除了我当前的实现之外,它都显示出一团糟。你对我有一个聪明的主意吗? 代码在这里:
digraph finite_state_machine {
rankdir=LR;
size="8,2"
fontname="Verdana"
node [shape = doublecircle]; Idle;
node [shape = circle,nodesep = "2.0"];
Working:s -> Working:s [ label = "response[j]?" ,minlen = 50000];
Idle -> Working [ label = "boot" ];
Working:n -> Working:n [ label = "sendtx[i]!",minlen = 50000 ];
Working:e -> Working:e [ label = "qry!" ,minlen = 50000];
}
答案 0 :(得分:0)
添加nodesep=1;
会使循环更大,但不会更好。所以这会有所帮助:
digraph finite_state_machine {
rankdir=LR;
size="8,2"
fontname="Verdana"
node [shape = doublecircle]; Idle;
node [shape = circle,nodesep = "2.0"];
Working:s -> Working:s [ label = "response[j]?" ,minlen = 50000];
Idle -> Working [ label = "boot" ];
Working:n -> Working:n [ label = "sendtx[i]!" ];
Working:e -> Working:e [ label = "qry!"];
nodesep=1;
}
会产生类似的东西: