figure-cache.tex 3.84 KB
Newer Older
孟霞 committed
1 2

\begin{tikzpicture}
孟霞 committed
3
%\tikzstyle{every node}=[scale=0.8]
孟霞 committed
4 5
	\tikzstyle{prob}=[minimum width=0.4em, fill=blue!20,inner sep=0pt]
\node[draw,fill=yellow!30,inner sep=0pt,minimum width=3em,minimum height=5em](key) at (0,0){};
孟霞 committed
6 7 8 9
\draw[] ([yshift=0.5em]key.180) -- ([yshift=0.5em]key.0);
\draw[] ([yshift=1.5em]key.180) -- ([yshift=1.5em]key.0);
\draw[] ([yshift=-0.5em]key.180) -- ([yshift=-0.5em]key.0);
\draw[] ([yshift=-1.5em]key.180) -- ([yshift=-1.5em]key.0);
孟霞 committed
10
\node[draw,fill=green!30!white,inner sep=0pt,minimum width=3em,minimum height=5em](value) at (3em,0){};
孟霞 committed
11 12 13 14 15
\draw[] ([yshift=0.5em]value.180) -- ([yshift=0.5em]value.0);
\draw[] ([yshift=1.5em]value.180) -- ([yshift=1.5em]value.0);
\draw[] ([yshift=-0.5em]value.180) -- ([yshift=-0.5em]value.0);
\draw[] ([yshift=-1.5em]value.180) -- ([yshift=-1.5em]value.0);

孟霞 committed
16 17
\node[anchor=south,font=\footnotesize,inner sep=0pt] at ([yshift=0.1em]key.north){};
\node[anchor=south,font=\footnotesize,inner sep=0pt] at ([yshift=0.1em]value.north){};
xiaotong committed
18
\node[anchor=south,font=\footnotesize,inner sep=0pt] (cache)at ([yshift=2em,xshift=1.5em]key.north){\small\bfnew{缓存}};
孟霞 committed
19

孟霞 committed
20
\node[draw,anchor=east,thick,minimum size=1.8em,fill=orange!30] (dt) at ([yshift=2.1em,xshift=-4em]key.west){${\mathbi{d}}_{t}$};
孟霞 committed
21
\node[anchor=north,font=\footnotesize] (readlab) at ([xshift=2.8em,yshift=0.3em]dt.north){\red{读取}};
孟霞 committed
22 23
\node[draw,anchor=east,thick,minimum size=1.8em,fill=green!30!white] (st) at ([xshift=-3.7em]dt.west){${\mathbi{s}}_{t}$};
\node[draw,anchor=east,thick,minimum size=1.8em,fill=red!30] (st2) at ([xshift=-0.85em,yshift=3.5em]dt.west){$ \widetilde{\mathbi{s}}_{t}$};
孟霞 committed
24

孟霞 committed
25 26 27 28
%\node[draw,anchor=north,circle,inner sep=0pt, minimum size=1.2em,fill=yellow] (add) at ([yshift=-1em]st2.south){+};
\node[draw,thick,inner sep=0pt, minimum size=1.1em, circle] (add) at ([yshift=-1.5em]st2.south){};
\draw[-,thick] (add.0) -- (add.180);
\draw[-,thick] (add.90) -- (add.-90);
孟霞 committed
29

孟霞 committed
30
\node[anchor=north,inner sep=0pt,font=\footnotesize,text=red] at ([xshift=-0em,yshift=-0.5em]add.south){融合};
孟霞 committed
31

孟霞 committed
32
\node[draw,anchor=east,thick,minimum size=1.8em,fill=yellow!30] (ct) at ([xshift=-2em,yshift=-3.5em]st.west){$ {\mathbi{C}}_{t}$};
孟霞 committed
33
\node[anchor=north,font=\footnotesize] (matchlab) at ([xshift=6.7em,yshift=-0.1em]ct.north){\red{匹配}};
孟霞 committed
34

孟霞 committed
35
\node[anchor=east] (y) at ([xshift=-6em,yshift=1em]st.west){$\mathbi{y}_{t-1}$};
孟霞 committed
36

孟霞 committed
37
\node[draw,anchor=east,minimum width=7em,minimum height=1.4em,fill=blue!30] (output) at ([xshift=-2.6em,yshift=2.6em]st2.west){};
孟霞 committed
38

孟霞 committed
39 40 41 42 43
\node[anchor=south] (yt) at ([yshift=4.2em]output.north){$\mathbi{y}_{t}$};
\draw[] ([xshift=-0.7em]output.90) -- ([xshift=-0.7em]output.-90);
\draw[] ([xshift=-2.1em]output.90) -- ([xshift=-2.1em]output.-90);
\draw[] ([xshift=0.7em]output.90) -- ([xshift=0.7em]output.-90);
\draw[] ([xshift=2.1em]output.90) -- ([xshift=2.1em]output.-90);
孟霞 committed
44

孟霞 committed
45 46
\foreach \x/\y in {1/2,2/1,3/5,4/1,5/1,6/1,7/3,8/4,9/2,10/3,11/5,12/10,13/2,14/5,15/5,16/5,17/5}
	\node[draw=blue!25,anchor=south,prob,minimum height=0.2em*\y] at ([yshift=1em,xshift=-3.65em+0.4em*\x]output.north){};
孟霞 committed
47 48 49 50 51
	
\begin{pgfonlayer}{background}
\node[inner sep=3pt,draw,dotted,rounded corners=2pt,very thick][fit=(key)(value)(cache)](box){};
\end{pgfonlayer}

孟霞 committed
52 53 54 55
\draw[-latex,dashed,very thick,out=-145,in=10] ([yshift=1em]box.180) to (dt.0);
%node[above,font=\footnotesize,text=red,rotate=25]{reading}
\draw[-latex,dashed,very thick,out=-5,in=-170] (ct.0) to ([yshift=-2.5em]box.180);
%node[above,font=\footnotesize,text=red,pos=0.7,rotate=8]{matching}
56 57 58 59 60 61 62 63
\draw[-,thick,out=0,in=-135](st.0) to (add.-135);
\draw[-,thick,out=180,in=-45](dt.180) to (add.-45);
\draw[-latex,thick] (add.90) -- (st2.-90);
\draw[-latex,thick,out=100,in=-100] (ct.90) to (output.-90);
\draw[-latex,thick,out=180,in=-100] (st2.180) to (output.-90);
\draw[-latex,thick,out=80,in=-100] (y.90) to (output.-90);
\draw[-latex,thick] (output.90) -- ([yshift=1em]output.90);
\draw[-latex,thick] ([yshift=-1.2em]yt.-90) -- (yt.-90);
孟霞 committed
64
\end{tikzpicture}