Even though I use the train gate example in Uppaal and the code found on the internet exactly, I am getting syntax and undefined errors. Is there anyone who can share all the code of this example with me?
I tried the code at https://github.com/tiagochst/DPTCS/blob/master/inf342/lab5/uppaal-4.0.11/demo/train-gate.xml and https://youtu.be/IMHOaQyHqck?si=cxjCN4H21bK8b6jm but I am getting the errors I mentioned and I cannot fix them.
I think the reason is my lack of knowledge but I really need help. I don't know how it can be done without a drawing, but I really need it.
Project Declarations:
const int N = 6;
typedeft int [0,N-1] id_t;
chan appr,stop,go,leave;
urgent chan go;
Gate Declarations:
id_t list [N+1];
int[0,N] len;
void enqueue(id_t element)
{
list[len++] = element;
}
void dequeue()
{
int i = 0;
len -=1;
while(i < len)
{
list[i] = list[i+1];
i++;
}
list[i]=0;
}
id_t front()
{
return list [0];
}
id_t tail ()
{
return list [ len − 1];
}
Train Declarations:
clock x;
System Declarations:
Process = Template();
Train1:=Train(e1,1);
Train2:=Train(e1,2);
Train3:=Train(e1,3);
Train4:=Train(e1,4);
system Process;
Train1,Train2,Train3,Train4,Gate,Queue