Holarch
Capitoli del corso

Formazione · Percorso 3. Comportamento e architettura · Capitolo 3.5 di 6

3.5 Simulazione 2:39

Dare durate ai passi, riprodurre un’esecuzione, poi cento, e verificare il risultato rispetto a un limite.

Mostra Holarch 1.27.

← 3.4 Interfacce · Tutti i capitoli · 3.6 Budget e TPM →

Che cosa si impara

  • Impostare la durata di un’azione come valore fisso o come distribuzione
  • Eseguire una simulazione a Eventi discreti e leggere la sequenza temporale
  • Eseguire uno studio Monte Carlo e leggere la media, la dispersione e il 95° percentile
  • Verificare il tempo totale rispetto al limite di un requisito con una probabilità richiesta

Dare durate ai passi di Rent a Bike, compresa una distribuzione normale, eseguire una simulazione a eventi discreti su una sequenza temporale, eseguire Monte Carlo, leggere la dispersione dei tempi di noleggio e verificare quanto è probabile che un noleggio finisca entro un limite di tempo.

File di progetto

  • Progetto iniziale (.holarch.json; Gestisci progetti → File di progetto ▾ → Importa progetto (.json)…)
  • Progetto completato (.holarch.json; Gestisci progetti → File di progetto ▾ → Importa progetto (.json)…)

Il video viene riprodotto da holarch.app; vedere l’Informativa sulla privacy.

Esercitazione

Provare in prima persona in Holarch, sul progetto demo CubeSat EO-1.

  1. Aprire il proprio progetto demo EO-1, oppure crearlo: Gestisci progetti → File di progetto ▾ → Nuovo progetto demo → CubeSat (ingegneria dei sistemi guidata).
  2. Nel Database, selezionare OPS.11 Receive Downlink (9 minuti) e impostarne la Durata su =triang.dist(8, 15, 9) Minuti, per i passaggi che a volte durano di più.
  3. Aprire Comportamento → Simulatore, scegliere OPS Run Nominal Imaging Pass come Action radice, mantenere Eventi discreti e premere ⏩ Esegui fino alla fine. Leggere Tempo totale e la sequenza temporale.
  4. Passare a Monte Carlo e premere ▶ Esegui Monte Carlo. Nella scheda Distribuzione, leggere la media e la dispersione del tempo totale.
  5. Fare clic su Verifica rispetto a un requisito…, mantenere Tempo totale, impostare ≤ al massimo 100 Minuti, il requisito 6.5 Planning Cycle Time e Probabilità richiesta (%) 95. Leggere P5 / P50 / P95, P(conforme) e il Risultato.
  6. Per una procedura guidata con verifica, eseguire il tutorial 8 Simulare il flusso funzionale (Guida → Tutorial).

L’esercizio è completato quando il controllo mostra P(meet) e un risultato Superato o Fallito per 6.5 Planning Cycle Time al 95%.

Verifica

  1. Perché dare a un passo una distribuzione invece di una durata fissa?
  2. Che cosa dice una singola esecuzione a Eventi discreti che Monte Carlo non dice?
  3. Perché verificare rispetto al 95° percentile e non alla media?
  4. Che cosa cambia nel modello Registra risultato?
Mostra le risposte
  1. Perché dare a un passo una distribuzione invece di una durata fissa?

    Le durate reali variano. Una distribuzione viene campionata a ogni esecuzione, quindi Monte Carlo mostra la dispersione del tempo totale, non un singolo numero.

  2. Che cosa dice una singola esecuzione a Eventi discreti che Monte Carlo non dice?

    Riproduce una singola esecuzione su una sequenza temporale, così si vedono l’ordine dei passi, i rami paralleli e quale ramo ha preso una decisione. Monte Carlo ripete l’esecuzione molte volte per le statistiche.

  3. Perché verificare rispetto al 95° percentile e non alla media?

    Metà delle esecuzioni dura più della media. Un limite che deve valere in 95 esecuzioni su 100 si giudica dal tempo entro cui restano quelle 95, che P(meet) e P95 riportano.

  4. Che cosa cambia nel modello Registra risultato?

    Imposta il Valore previsto (o Valore) della Measure sulla media e imposta su Superato o Fallito un Test Case che verifica il requisito. Le modifiche si esaminano prima, e vengono applicate come un unico passo di annullamento.

Per saperne di più

Trascrizione

Mostra la trascrizione (narrazione e contenuto dello schermo)

Introduction

Welcome back. The action diagram of Rent a Bike says what happens. With durations, Holarch can tell you how long it takes.

In this chapter you put numbers on the steps and simulate them.

Durations

Open Rent a Bike as an action diagram again. Select Identify Rider and set its duration. Riders take different times to find their card, so use a distribution: equals norm dot dist, four, one: a normal distribution with a mean of four seconds and a standard deviation of one.

On screen: Database → F.1 → Open in ▾ → Action Diagram; Identify Rider → Duration.

Check Account depends on the network: a normal distribution around two seconds. Unlocking the bay and showing its number take one second each.

On screen: Check Account, Unlock Bay, Show Bay Number.

Starting the rental takes half a second, and relocking the bay, on the rare branch, one and a half.

On screen: Start Rental, Relock Bay.

One run

Open Behavior, then Simulator, and choose Rent a Bike as the root action. Discrete event mode plays one run on a timeline.

On screen: Behavior → Simulator → root F.1 → Discrete Event → Run to End.

Each step appears when it runs, the two parallel branches side by side, and the decision takes one of its branches with the probability you gave it.

On screen: The timeline.

A hundred runs

One run is one sample. Switch to Monte Carlo and run it: a hundred runs, each drawing every duration from its distribution and every decision from its probabilities.

On screen: Monte Carlo → Run.

The statistics give the mean rental time and its spread, and the 95th percentile: the time that ninety-five rentals in a hundred stay under. A commitment to riders needs that number, not the average.

On screen: Statistics and the time chart.

Check against a limit

Is that fast enough? Choose Check Against Requirement. Compare the total time with a limit: at most ten seconds for the whole rental at the kiosk, met in at least ninety-five runs in a hundred.

On screen: Check Against Requirement → ≤ 10 Seconds, 95 %.

The dialog reports the probability of meeting the limit from the hundred runs, and whether it clears the ninety-five percent you asked for. Record Result can save the check on the model.

On screen: The result.

Recap

Let's recap. You gave the steps durations, played one run on a timeline, ran Monte Carlo, read the spread of rental times, and checked the chance of meeting a limit.

Next, the dock's mass: a budget, and a technical performance measure to track it.