In the petrinet shown below i have a problem creating tokens with random value in place input2, since the rand() function doesn't seem to work. Is there any other way to do it?
Asked
Active
Viewed 541 times
1 Answers
0
CPN ML provides random choice of color for small color sets. You could use SmallInt.ran()
for a random integral number in the range [1,10].
REAL
is not a small color set and if you were to use REAL.ran()
you would get an exception.
I would guess that a suitable solution for your example would be to use 1.0/real(SmallInt.ran())
.
I do not have a copy of CPN Tools at hand so please take the above advice critically.

Dima Chubarov
- 16,199
- 6
- 40
- 76