| 1 |
import markers; |
| 2 |
|
| 3 |
unitsize(10mm); |
| 4 |
|
| 5 |
real Apos = 6; |
| 6 |
real Bpos = 2; |
| 7 |
|
| 8 |
real Alag = 1.5; |
| 9 |
real Blag = 0.0; |
| 10 |
|
| 11 |
real Aticks[] ={3, 5, 7, 9, 11, 13}; |
| 12 |
real Bticks[] ={3, 7, 11}; |
| 13 |
|
| 14 |
label(scale(2)*"A", (0, Apos), W); |
| 15 |
label(scale(2)*"B", (0, Bpos), W); |
| 16 |
|
| 17 |
// Application A ticks |
| 18 |
for (int i=0; i<Aticks.length; ++i) |
| 19 |
fill(box((Aticks[i]-0.2, Apos-1), (Aticks[i]+0.2, Apos+1)), gray(0.8)); |
| 20 |
|
| 21 |
// Application B ticks |
| 22 |
for (int i=0; i<Bticks.length; ++i) |
| 23 |
fill(box((Bticks[i]-0.2, Bpos-1), (Bticks[i]+0.2, Bpos+1)), gray(0.8)); |
| 24 |
|
| 25 |
void transfer(int a, int b) { |
| 26 |
draw("delay", (Bticks[b],Bpos+0.8)--(Bticks[b]-2.5,Bpos+0.8), |
| 27 |
S, marker(scale(2)*dotframe)); |
| 28 |
draw((Aticks[a],Apos-1){down}..{down}(Bticks[b],Bpos+1), Arrow); |
| 29 |
draw((Bticks[b]-2.5+1.5,Apos-1){down}..{down}(Bticks[b]-2.5,Bpos+0.8), |
| 30 |
blue+dashed, Arrow); |
| 31 |
} |
| 32 |
|
| 33 |
transfer(0, 0); |
| 34 |
transfer(2, 1); |
| 35 |
transfer(4, 2); |
| 36 |
|
| 37 |
|
| 38 |
draw(box((Alag,Apos-1), (Alag+13,Apos+1))); |
| 39 |
draw(box((Blag,Bpos-1), (Blag+13,Bpos+1))); |
| 40 |
|
| 41 |
draw("Wallclock Time", (0,0)--(15,0), Arrow); |