mirror of
https://github.com/MartinThoma/LaTeX-examples.git
synced 2025-04-19 11:38:05 +02:00
Add flowchart for network design
This commit is contained in:
parent
f7259460fe
commit
fd7b16baa3
3 changed files with 82 additions and 0 deletions
33
tikz/flowchart-network-design/Makefile
Normal file
33
tikz/flowchart-network-design/Makefile
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
SOURCE = flowchart-network-design
|
||||||
|
DELAY = 80
|
||||||
|
DENSITY = 300
|
||||||
|
WIDTH = 512
|
||||||
|
|
||||||
|
make:
|
||||||
|
pdflatex $(SOURCE).tex -output-format=pdf
|
||||||
|
make clean
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot
|
||||||
|
|
||||||
|
gif:
|
||||||
|
pdfcrop $(SOURCE).pdf
|
||||||
|
convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
|
||||||
|
make clean
|
||||||
|
|
||||||
|
png:
|
||||||
|
make
|
||||||
|
make svg
|
||||||
|
inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
|
||||||
|
|
||||||
|
transparentGif:
|
||||||
|
convert $(SOURCE).pdf -transparent white result.gif
|
||||||
|
make clean
|
||||||
|
|
||||||
|
svg:
|
||||||
|
#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
|
||||||
|
pdf2svg $(SOURCE).pdf $(SOURCE).svg
|
||||||
|
# Necessary, as pdf2svg does not always create valid svgs:
|
||||||
|
inkscape $(SOURCE).svg --export-width=$(WIDTH) --export-plain-svg=$(SOURCE)1.svg
|
||||||
|
rsvg-convert -a -w 720 -f svg $(SOURCE)1.svg -o $(SOURCE).svg
|
||||||
|
rm $(SOURCE)1.svg
|
3
tikz/flowchart-network-design/README.md
Normal file
3
tikz/flowchart-network-design/README.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Compiled example
|
||||||
|
----------------
|
||||||
|

|
46
tikz/flowchart-network-design/flowchart-network-design.tex
Normal file
46
tikz/flowchart-network-design/flowchart-network-design.tex
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
\documentclass[varwidth=true, border=2pt]{standalone}
|
||||||
|
|
||||||
|
\usepackage{tikz}
|
||||||
|
\usetikzlibrary{shapes,arrows}
|
||||||
|
\begin{document}
|
||||||
|
\pagestyle{empty}
|
||||||
|
|
||||||
|
|
||||||
|
% Define block styles
|
||||||
|
\tikzstyle{decision} = [diamond, draw, fill=blue!20,
|
||||||
|
text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
|
||||||
|
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
|
||||||
|
text width=5em, text centered, rounded corners, minimum height=4em]
|
||||||
|
\tikzstyle{line} = [draw, -latex']
|
||||||
|
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
|
||||||
|
minimum height=2em]
|
||||||
|
|
||||||
|
\begin{tikzpicture}[node distance = 2cm, auto]
|
||||||
|
% Place nodes
|
||||||
|
\node [block] (init) {initialize model};
|
||||||
|
% \node [cloud, left of=init] (expert) {expert};
|
||||||
|
% \node [cloud, right of=init] (system) {system};
|
||||||
|
\node [block, below of=init] (qualitycheck) {calculate $q$};
|
||||||
|
\node [decision, below of=qualitycheck] (decide) {is $q$ reasonable};
|
||||||
|
\node [block, left of=decide, node distance=3cm] (investigate) {investigate};
|
||||||
|
\node [block, below of=decide, node distance=3cm] (train) {train};
|
||||||
|
\node [decision, below of=train] (decide2) {is $q$ good enough};
|
||||||
|
\node [block, left of=investigate, node distance=3cm] (update) {update model};
|
||||||
|
\node [block, below of=decide2, node distance=3cm] (stop) {stop};
|
||||||
|
% Draw edges
|
||||||
|
\path [line] (init) -- (qualitycheck);
|
||||||
|
\path [line] (qualitycheck) -- (decide);
|
||||||
|
\path [line] (decide) -- node {yes} (train);
|
||||||
|
\path [line] (decide) -- node {no} (investigate);
|
||||||
|
\path [line] (investigate) -- (update);
|
||||||
|
\path [line] (train) -- (decide2);
|
||||||
|
% \path [line] (decide) -| node [near start] {yes} (update);
|
||||||
|
% \path [line] (update) |- (init);
|
||||||
|
\path [line] (decide2) -- node {yes}(stop);
|
||||||
|
\path [line] (decide2) -| node {no}(update);
|
||||||
|
\path [line] (update) |- (init);
|
||||||
|
% \path [line,dashed] (expert) -- (init);
|
||||||
|
% \path [line,dashed] (system) -- (init);
|
||||||
|
% \path [line,dashed] (system) |- (evaluate);
|
||||||
|
\end{tikzpicture}
|
||||||
|
\end{document}
|
Loading…
Add table
Add a link
Reference in a new issue