Refactor repo structure

This commit is contained in:
Marco Realacci 2024-01-19 03:29:39 +01:00
parent 36ac339086
commit 8fc89fbc03
1732 changed files with 3812 additions and 67 deletions

View file

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

View file

@ -0,0 +1,8 @@
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.
Si decide di realizzare un approccio incrementale in cui, alla fine di ogni fase, si passa alla fase successiva solo nel caso in cui
tutti i test per la fase vengono superati. In caso contrario bisogna ripetere la phase. Dai dati storici è noto che la probabilità che
il team di sviluppo passi da una fase a quella successiva è 0.8.
Allo scopo di stimare attraverso una simulazione MonteCarlo il valore atteso del tempo di completamento del progetto viene
realizzato un modello Modelica delo processo di sviluppo descritto sopra.
Quale dei seguenti modelli Modelica modella correttamente il processo di sviluppo descritto sopra?

View file

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

View file

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