if <Event> then <Reward Function Expression> else <Reward Function Expression>(ELSE clausole is not optional)
The numerical expression consist of an algebric expression with parenthesis and the following operators (the order represents the precedence too):
- - : unary minus
- ^ : power operator; is considered left associative
- 2^3^4 is evaluated as (2^3)^4, not 2^(3^4). To specified a specific evaluation order use the parenthesis.
- *, /
- +, -
Is a boolean expression with parenthesis and the following operators (the order represents the precedence too):
If the expression value is a value, the form of assignment statement is:
variable_name = expression
If the expression value is an array of values, the form of assignment statement is:
variable_array_name := expression
To view the value of one or more variables that represent a value (NOT AN ARRAY) the PRINT keyword must be used, i.e.:
print(a, b, ...)
The arrays obtained by means of CYCLE keyword are automatic visualized in the result dialog.
If an array represents a REWARD FUNCTION only the relative expected reward rate and expected accumulated reward rate can be viewed.
How to calculate and view the steady state average number of tokensin a place:
m1 = av_token[PlaceName]
print(m1)
How to calculate and view the instantaneous average number of tokens in a place:
m1 = av_token(7)[PlaceName]
or
t = 7
m1 = av_token(t)[PlaceName]print(m1)
How to calculate and view the Mean Time To Absorption (MTTA):
(mtta is calculated only for Petri Net with absorption marking)
t = mtta
print(t)
How to calculate and view the steady state probability of an event:
p = pr[#place1>0 & #place2=0 | #place3==5]
print(p)
How to calculate and view the instantaneous probability of an event:
p = pr(15)[#place1>0 & #place2=0 | #place3==5]
or
time = 15
p = pr(time)[#place1>0 & #place2=0 | #place3==5]>print(p)
How to calculate and view the steady state probability that a transition is enabled:
p = pr_enabled[TransitionName]
or
p = pr[?TransitionName]print(p)
How to calculate and view the instantaneous probability that a transition is enabled:
p = pr_enabled(20)[TransitionName]
or
time = 20
p = pr_enabled(time)[TransitionName]print(p)
How to define a reward function:
f := mark[PlaceName]
or
f := enabled[TransitionName]
or
f := if mark[PlaceName]>0 then 1 else 0
or
f := if mark[PlaceName]>0 then mark[PlaceName]*10 else mark[PlaceName]/10
How to calculate and view steady state expected reward rate of a reward function:
p = exp[f]
print(p)
How to calculate and view steady state expected accumulated reward rate of a reward function:
p = cum_exp[f]
print(p)
How to calculate and view instantaneous expected reward rate of a reward function:
p = exp(25)[f]
print(p)
How to calculate and view steady instantaneous accumulated reward rate of a reward function:
p = cum_exp(10)[f]
print(p)
How to calculate and view the value of a measure in interval [t1, t2]
v:=cycle(t1, t2 [, step]) pr[#PlaceName >=0]
or
v:=cycle(t1, t2 [, step]) av_token[PlaceName]
or
v:=cycle(t1, t2 [, step]) pr_enabled[TransitionName]
or
v:=cycle(t1, t2 [, step]) exp[RewardFunction]
or
v:=cycle(t1, t2 [, step]) cum_exp[RewardFunction]step is optional; if it is not present or is lower then delta it is set to delta
i.e.:
a = pr[ #p_0>0 & is_enabled[t_1] ]is correct, while:
a = pr[ #p_0>0 &is wrong.
is_enabled[t_1] ]