This example is from the tutorial: A Petri-net for Hagen.
Download as: [PDF] [TEX] • [Open in writeLaTeX]
Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
% Author: Till Tantau
% Source: The PGF/TikZ manual
\documentclass{article}
\def\xcolorversion{2.00}
\def\xkeyvalversion{1.8}
\usepackage[version=0.96]{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,snakes,automata,backgrounds,petri}
\usepackage[latin1]{inputenc}
\begin{document}
\begin{tikzpicture}[node distance=1.3cm,>=stealth',bend angle=45,auto]
\tikzstyle{place}=[circle,thick,draw=blue!75,fill=blue!20,minimum size=6mm]
\tikzstyle{red place}=[place,draw=red!75,fill=red!20]
\tikzstyle{transition}=[rectangle,thick,draw=black!75,
fill=black!20,minimum size=4mm]
\tikzstyle{every label}=[red]
\begin{scope}
% First net
\node [place,tokens=1] (w1) {};
\node [place] (c1) [below of=w1] {};
\node [place] (s) [below of=c1,label=above:$s\le 3$] {};
\node [place] (c2) [below of=s] {};
\node [place,tokens=1] (w2) [below of=c2] {};
\node [transition] (e1) [left of=c1] {}
edge [pre,bend left] (w1)
edge [post,bend right] (s)
edge [post] (c1);
\node [transition] (e2) [left of=c2] {}
edge [pre,bend right] (w2)
edge [post,bend left] (s)
edge [post] (c2);
\node [transition] (l1) [right of=c1] {}
edge [pre] (c1)
edge [pre,bend left] (s)
edge [post,bend right] node[swap] {2} (w1);
\node [transition] (l2) [right of=c2] {}
edge [pre] (c2)
edge [pre,bend right] (s)
edge [post,bend left] node {2} (w2);
\end{scope}
\begin{scope}[xshift=6cm]
% Second net
\node [place,tokens=1]
(w1') {};
\node [place] (c1') [below of=w1'] {};
\node [red place] (s1') [below of=c1',xshift=-5mm,label=left:$s$] {};
\node [red place,tokens=3]
(s2') [below of=c1',xshift=5mm,label=right:$\bar s$] {};
\node [place] (c2') [below of=s1',xshift=5mm] {};
\node [place,tokens=1]
(w2') [below of=c2'] {};
\node [transition] (e1') [left of=c1'] {}
edge [pre,bend left] (w1')
edge [post] (s1')
edge [pre] (s2')
edge [post] (c1');
\node [transition] (e2') [left of=c2'] {}
edge [pre,bend right] (w2')
edge [post] (s1')
edge [pre] (s2')
edge [post] (c2');
\node [transition] (l1') [right of=c1'] {}
edge [pre] (c1')
edge [pre] (s1')
edge [post] (s2')
edge [post,bend right] node[swap] {2} (w1');
\node [transition] (l2') [right of=c2'] {}
edge [pre] (c2')
edge [pre] (s1')
edge [post] (s2')
edge [post,bend left] node {2} (w2');
\end{scope}
\draw [-to,thick,snake=snake,segment amplitude=.4mm,
segment length=2mm,line after snake=1mm]
([xshift=5mm]s -| l1) -- ([xshift=-5mm]s1' -| e1')
node [above=1mm,midway,text width=3cm,text centered]
{replacement of the \textcolor{red}{capacity} by
\textcolor{red}{two places}};
\begin{pgfonlayer}{background}
\filldraw [line width=4mm,join=round,black!10]
(w1.north -| l1.east) rectangle (w2.south -| e1.west)
(w1'.north -| l1'.east) rectangle (w2'.south -| e1'.west);
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
Comments
PGF is such a beautiful and accurate vector graphics tool.
Texample.com assisted me in preparing graphics for my master diploma. Thank you!
Говорю свое слово товарищи о legaltrip.org. Все пришло, давольно быстро, качество на мой взгляд хорошее, плюс очень порадовал подарок магазину огромное уважение, настоятельно рекомендую как честный и качественный магазин. Спасибо за подарок legaltrip.org!
http://www.internetica.pl
Sa to artefakty i budowle, które sugeruja, ze jezyk chinski udzial w zajeciach sportowych w tym momencie w 2000 pne. [9 - cwiczenia gimnastyczne wydaje sie byc uznany sport w starozytnej przeszlosci Chin. Pomniki faraonów wskazuja, iz czesc sportów, w tym plywania zas wedkowania, dotychczasowy dobrze rozwiniete natomiast regulowane kilka tysiecy lat temu w starozytnym Egipcie. [10 - Inne sporty zawarte egipskie rzucanie oszczepem, skoku wzwyz, tudziez zapasy. Starozytne perskie sportowych takich podczas gdy tradycyjnej iranskiej sztuki walki Zourkhaneh pyl scisly sojusz az do umiejetnosci bojowych. [11 - Posród innych sportów, które pochodza ze starozytnej Persji sa polo natomiast potyczki.
Pojawily sie zmotoryzowane sportowe od nadejsciem nowoczesnosci Szeroka arsenal sportów zostaly aktualnie ustalone z wykorzystaniem okres starozytnej Grecji zas kultury wojskowej i rozwoju sportu w Grecji wp one zasadniczo posrodku soba. Sport stal sie w gruncie rzeczy wybitnym czescia ich kultury, iz Grecy stworzyli Igrzysk Olimpijskich, które w starozytnosci odbywaly sie co cztery lata w malej wiosce w Peloponezu nazwie Olympia. [12 -
Sport w coraz wiekszym stopniu zorganizowany zas regulowane od czasów starozytnych igrzysk olimpijskich az az do obecnego stulecia. Uprzemyslowienie przyniósl postep czasu http://e-sportowiec.com.pl/ - sprzet treningowy wolnego gwoli mieszkanców krajów rozwinietych oraz rozwijajacych sie, co prowadzi do wiekszej ilosci czasu w celu obywateli do udzialu, a od tego czasu Sporty widowiskowe, wiekszego udzialu w dzialaniach sportowych natomiast postep dostepnosci. Tendencje te w przyszlosci sposród nadejsciem mediów zas komunikacji globalnej. Znajomosc rzeczy stal sie totalny, co w dodatku zwieksza wzrost popularnosci sportu, jak fani sportu zaczal po wyczyny sportowców zawodowych posrednictwem radia, telewizji i Internetu - pelnia podziwiajac szkolenie a konkurencji sprzezony z amatorskim uczestnictwa w sporcie.
Early telecommunication technologies included visual signals, such koryfeusz beacons, smoke signals, semaphore telegraphs, signal flags, and optical heliographs.[7 - Other examples of pre-modern telecommunications include fonia messages such as coded drumbeats, lung-blown horns, and loud whistles. Electrical and electromagnetic telecommunication technologies include telegraph, telephone, and teleprinter, networks, radio, microwave transmission, fiber optics, communications satellites and the Internet. A revolution in wireless telecommunications began in the first decade of the 1900s with pioneering developments in radiostacja communications aby Nikola Tesla and Guglielmo Marconi. Marconi http://www.falesia.pl/pdf/SE800.pdf - redback won the Nobel Prize in Physics in 1909 for his efforts. Other highly notable pioneering inventors and developers in the field of electrical and electronic telecommunications include Charles Wheatstone and Samuel Morse (telegraph), Alexander Graham Bell (telephone), Edwin Armstrong, and Lee de Forest (radio), koryfeusz well as John Logie Baird and Philo Farnsworth (television). The world's effective capacity to exchange information through two-way telecommunication networks grew from 281 petabytes of (optimally compressed) information in 1986, to 471 petabytes in 1993, owo 2.2 (optimally compressed) exabytes in 2000, and to 65 (optimally compressed) exabytes in 2007.[8 - This is the informational equivalent of two newspaper pages per person per day in 1986, and six entire newspapers per person per day tak aby 2007.[9 - Given this growth, telecommunications play an increasingly important role in the world economy and the global telecommunications industry was about natomiast $4.7 trillion sector in 2012.[10 - [11 - The service revenue of the global telecommunications industry was estimated owo be $1.5 trillion in 2010, corresponding to 2.4% of the world’s gross domestic product (GDP).[10 -
Post a comment