mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-03-14 17:06:14 +01:00
14 lines
436 B
Text
14 lines
436 B
Text
|
model System
|
||
|
Integer y;
|
||
|
Real r1024;
|
||
|
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||
|
equation
|
||
|
y = if (r1024 <= 0.3) then 1 else 0;
|
||
|
algorithm
|
||
|
when initial() then
|
||
|
state1024 := Modelica.Math.Random.Generators.Xorshift1024star.initialState(614657, 30020);
|
||
|
r1024 := 0;
|
||
|
elsewhen sample(0,1) then
|
||
|
(r1024,state1024) := Modelica.Math.Random.Generators.Xorshift1024star.random(pre(state1024));
|
||
|
end when;
|
||
|
end System;
|