//This specification is compatible with UPPAAL 4.0.6
//Author: Michael Harrison, School of Computing Science,
//Newcastle University. michael.harrison@ncl.ac.uk
//To be read in conjunction with the paper "Resources for
//Situated Actions" by Doherty, Campos and Harrison
// Place global declarations here.
const int empty = 0;
const int full = 5;
const int N = 0;
const int A = 1;
const int B = 2;
const int C = 3;
const int D = 4;
const int rate = 1;
bool pb[6];
int[0,5] xpos = 0;
chan switch;
chan download;
chan move;
chan on;
chan off;
chan up;
chan down;
chan bck;
chan fwd;
chan pon5;
chan poff5;
chan pvon[2];
chan pvoff[2];
chan pvup[2];
chan pvdown[2];
chan pdon[2];
chan pdoff[2];
chan pdbwd[2];
chan pdfwd[2];
int[empty,full] tank1v = empty;
int[empty,full] tank2v = empty;
int[empty,full] tank3v = empty;
int[N,D] tank1m = N;
int[N,D] tank2m = N;
int[N,D] tank3m = N;
bool p1b = false;
bool p2b = false;
bool p3b = false;
bool p4b = false;
bool p5b = false;dpumpchan &on, chan &off, chan &back, chan &forward, int[empty,full] &tk1, int[N,D] &tk1t, int[empty,full] &tk2, int[N,D] &tk2t, bool &pb, int[A,D] ttypeclock t;
void processtank()
{ if (tk2t==ttype) {tk2t+=2;} else
{tk2t=N;};}pollutionbckfwddondoffvpumpchan &on, chan &off, chan &volu, chan &vold, int[empty,full] &tk, int[N,D] &tkt, int[N,D] intype, bool &pbint[empty,full] limit=0;
clock t;pollutionvonvoffspumpchan &on, chan &off, int[empty,full] &tk, bool &pbclock t;sonsoffmobdevchan &move, chan &switch, chan &download, chan &pon, chan &poff, chan &pup, chan &pdown, chan &pbck, chan &pfwd, chan &pvon[2], chan &pvoff[2], chan &pvup[2], chan &pvdown[2], chan &pdoff[2], chan &pdon[2], chan &pdbwd[2], chan &pdfwd[2], chan &p5on, chan &p5off, int[0,5] &xpos, bool &pb[6]bool bkt = false;
int[0,5] valve = 0;
int[0,5] bucket = 0;
int[0,5] pos = 0;
int[0,1] indx;spdpvpspacechan &move, int[0,5] &xposbool vector[6]={false, false, false, false, false, false};
int[0,6] count=0;
void updpath (int[0,5] k)
{xpos=k;
vector[k]=true;
count+=1;}
LP5LP3LP1LP2LP4LCRcontrollerchan &switch, chan &download, chan &on, chan &off, chan &up, chan &down, chan &bck, chan &fwdrandom// Place template instantiations here.
RC= controller(switch, download, on, off, up, down, bck, fwd);
MB = mobdev(move, switch, download, on, off, up, down, bck, fwd, pvon, pvoff, pvup, pvdown, pdoff, pdon, pdbwd, pdfwd, pon5, poff5, xpos, pb);
P1= vpump(pvon[0], pvoff[0], pvup[0], pvdown[0], tank1v, tank1m, A, pb[1]);
P2= vpump(pvon[1], pvoff[1], pvup[1], pvdown[1], tank1v, tank1m, B, pb[2]);
P3= dpump(pdon[0], pdoff[0], pdbwd[0], pdfwd[0], tank1v, tank1m, tank2v, tank2m, pb[3], A);
P4= dpump(pdon[1], pdoff[1], pdbwd[1], pdfwd[1], tank1v, tank1m, tank3v, tank3m, pb[4], B);
P5= spump(pon5, poff5, tank1v, pb[5]);
R = space(move,xpos);
// List one or more processes to be composed into a system.
system RC, MB, R, P1, P2, P3, P4, P5;