How can I create a random number when I define a global declaration in an Uppaal program?
I want to have a variable that contains a random number as in a C program:
int x = rand (100);
How can I create a random number when I define a global declaration in an Uppaal program?
I want to have a variable that contains a random number as in a C program:
int x = rand (100);
According to folks at Uppaal mailing list , this code snippet select: i : int[0,3]
will non-deterministically bind i to an integer in the range 0 to 3.
So, in Your case just use select: x : int[0, 100]
.
I think the proper answer is: it is not possible when defining the global declaration.
The syntax that @Kamiccolo provided I think is misleading: there does not exist a syntactic construct like "select: ..." in Uppaal.
The only possible way, at now, is: