mirror of
https://github.com/appinfosapienza/so-un-bot.git
synced 2025-05-06 16:39:38 +02:00
move legacy code to separate branch
This commit is contained in:
parent
68a30c8ee6
commit
11b4c48c3a
3528 changed files with 14477 additions and 53258 deletions
27
Data/ingsw/0321_37/correct.txt
Normal file
27
Data/ingsw/0321_37/correct.txt
Normal file
|
@ -0,0 +1,27 @@
|
|||
<pre>
|
||||
model System
|
||||
|
||||
Integer y; Real r1024;
|
||||
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
|
||||
equation
|
||||
|
||||
y = if (r1024 <= 0.2) then -1 else if (r1024 <= 0.7) then 0 else 1;
|
||||
|
||||
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;
|
||||
</pre>
|
1
Data/ingsw/0321_37/quest.txt
Normal file
1
Data/ingsw/0321_37/quest.txt
Normal file
|
@ -0,0 +1 @@
|
|||
Si consideri l'ambiente (use case) consistente di un utente che ad ogni unità di tempo (ad esempio, un secondo) invia al nostro sistema input -1 con probabilità 0.2, input 0 con probabilità 0.5 ed input 1 con probabilità 0.3. Quale dei seguenti modelli Modelica rappresenta correttamente tale ambiente.
|
28
Data/ingsw/0321_37/wrong 1.txt
Normal file
28
Data/ingsw/0321_37/wrong 1.txt
Normal file
|
@ -0,0 +1,28 @@
|
|||
<pre>
|
||||
model System
|
||||
|
||||
Integer y; Real r1024;
|
||||
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
|
||||
equation
|
||||
|
||||
y = if (r1024 <= 0.3) then -1 else if (r1024 <= 0.7) then 0 else 1;
|
||||
|
||||
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;
|
||||
|
||||
</pre>
|
27
Data/ingsw/0321_37/wrong 2.txt
Normal file
27
Data/ingsw/0321_37/wrong 2.txt
Normal file
|
@ -0,0 +1,27 @@
|
|||
<pre>
|
||||
model System
|
||||
|
||||
Integer y; Real r1024;
|
||||
|
||||
Integer state1024[Modelica.Math.Random.Generators.Xorshift1024star.nState];
|
||||
|
||||
equation
|
||||
|
||||
y = if (r1024 <= 0.2) then -1 else if (r1024 <= 0.5) then 0 else 1;
|
||||
|
||||
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;
|
||||
</pre>
|
Loading…
Add table
Add a link
Reference in a new issue