Skip to content

Instantly share code, notes, and snippets.

@mattmils
Created June 26, 2011 17:27
Show Gist options
  • Save mattmils/1047778 to your computer and use it in GitHub Desktop.
Save mattmils/1047778 to your computer and use it in GitHub Desktop.
LTSA Pupazzi
const NPD = 2
const NPS = 2
const NA = 2
const C = 4
const DX = 0
const SX = 1
range ID_A = 1..NA
range ID_D = 1..NPD
range ID_S = 1..NPS
PROD(T=DX) = (
produci[ T ] -> deposita[ T ] -> PROD
).
SERBATOIO = S[0][0],
S[dx:0..C][sx:0..C] = (
when (dx > 0) a[ID_A].preleva[DX] -> S[dx-1][sx] |
when (sx > 0) a[ID_A].prevela[SX] -> S[dx][sx-1] |
when ((dx+sx) < C && dx < C-1) d[ID_D].deposita[DX] -> S[dx+1][sx] |
when ((dx+sx) < C && sx < C-1) s[ID_S].deposita[SX] -> S[dx][sx+1]
).
ASSEMBLER = (
preleva[DX] -> preleva[SX] -> assembla -> ASSEMBLER
| preleva[SX] -> preleva[DX] -> assembla -> ASSEMBLER
).
||FABBRICA = (d[ID_D]:PROD(DX) || s[ID_S]:PROD(SX) || a[ID_A]:ASSEMBLER || SERBATOIO ).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment