flowchart-network-design.tex 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. \documentclass[varwidth=true, border=2pt]{standalone}
  2. \usepackage{tikz}
  3. \usetikzlibrary{shapes,arrows}
  4. \begin{document}
  5. \pagestyle{empty}
  6. % Define block styles
  7. \tikzstyle{decision} = [diamond, draw, fill=blue!20,
  8. text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
  9. \tikzstyle{block} = [rectangle, draw, fill=blue!20,
  10. text width=5em, text centered, rounded corners, minimum height=4em]
  11. \tikzstyle{line} = [draw, -latex']
  12. \tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
  13. minimum height=2em]
  14. \begin{tikzpicture}[node distance = 2cm, auto]
  15. % Place nodes
  16. \node [block] (init) {initialize model};
  17. % \node [cloud, left of=init] (expert) {expert};
  18. % \node [cloud, right of=init] (system) {system};
  19. \node [block, below of=init] (qualitycheck) {calculate $q$};
  20. \node [decision, below of=qualitycheck] (decide) {is $q$ reasonable};
  21. \node [block, left of=decide, node distance=3cm] (investigate) {investigate};
  22. \node [block, below of=decide, node distance=3cm] (train) {train};
  23. \node [decision, below of=train] (decide2) {is $q$ good enough};
  24. \node [block, left of=investigate, node distance=3cm] (update) {update model};
  25. \node [block, below of=decide2, node distance=3cm] (stop) {stop};
  26. % Draw edges
  27. \path [line] (init) -- (qualitycheck);
  28. \path [line] (qualitycheck) -- (decide);
  29. \path [line] (decide) -- node {yes} (train);
  30. \path [line] (decide) -- node {no} (investigate);
  31. \path [line] (investigate) -- (update);
  32. \path [line] (train) -- (decide2);
  33. % \path [line] (decide) -| node [near start] {yes} (update);
  34. % \path [line] (update) |- (init);
  35. \path [line] (decide2) -- node {yes}(stop);
  36. \path [line] (decide2) -| node {no}(update);
  37. \path [line] (update) |- (init);
  38. % \path [line,dashed] (expert) -- (init);
  39. % \path [line,dashed] (system) -- (init);
  40. % \path [line,dashed] (system) |- (evaluate);
  41. \end{tikzpicture}
  42. \end{document}