Adapt to new bot structure

This commit is contained in:
Marco Realacci 2024-04-04 23:24:06 +02:00
parent ff7e08ada9
commit 3f84e1d831
3414 changed files with 41525 additions and 709 deletions

View file

@ -0,0 +1,25 @@
block MarkovChain
//external function myrandom() returns a random real number in [0, 1]
parameter Integer x0 = 0;
parameter Integer xmax = 100;
OutputInteger x;
algorithm
when initial() then
x := x0;
elsewhen sample(0, 1) then
if (x < xmax)
then
if (myrandom() <= 0.9)
then
if (myrandom() <= 0.8)
then
x := x + 1;
else
x := max(0, x - 1);
end if;
else
x := max(0, x - 1);
end if;
end if;
end when;
end MarkovChain;

View file

@ -0,0 +1,10 @@
Un'azienda decide di organizzare il processo di sviluppo di un grosso software in 101 phasi sequenziali, numerate da 0 a 100. La
phase 0 è quella iniziale. La phase 100 è quella finale in cui lo sviluppo è completato. Tutte le fasi hanno circa la stessa durata.
Alla fine di ogni fase viene eseguita una batteria di tests. I risultati del testing possono essere:
a) si può passare alla fase successiva;
b) bisogna ripetere la fase corrente;
c) bisogna rivedere il lavoro fatto nella fase precedente (reworking).
Dai dati storici è noto che la probabilità del caso a) è 0.72, del caso b) è 0.18 e del caso c) è 0.1.
Allo scopo di stimare attraverso una simulazione MonteCarlo il valore atteso del tempo di completamento del progetto viene
realizzato un modello Modelica del processo di sviluppo descritto sopra.
Quale dei seguenti modelli Modelica modella correttamente il processo di sviluppo descritto sopra?

View file

@ -0,0 +1,19 @@
block MarkovChain
//external function myrandom() returns a random real number in [0, 1]
parameter Integer x0 = 0;
parameter Integer xmax = 100;
OutputInteger x;
algorithm
when initial() then
x := x0;
elsewhen sample(0, 1) then
if (x < xmax)
then
if (myrandom() <= 0.8)
then
if (myrandom() <= 0.9)
then
x := x + 1;
else
x := max(0, x - 1);
end if;

View file

@ -0,0 +1,25 @@
block MarkovChain
//external function myrandom() returns a random real number in [0, 1]
parameter Integer x0 = 0;
parameter Integer xmax = 100;
OutputInteger x;
algorithm
when initial() then
x := x0;
elsewhen sample(0, 1) then
if (x < xmax)
then
if (myrandom() <= 0.9)
then
if (myrandom() <= 0.72)
then
x := x + 1;
else
x := max(0, x - 1);
end if;
else
x := max(0, x - 1);
end if;
end if;
end when;
end MarkovChain;