From 1dbece45351be00a4e97979c080c644b331eddec Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Sat, 6 Mar 2021 09:53:09 +0100 Subject: [PATCH] Inizio setup simulatore valori in DB --- EgtBEAMWALL.StressTest/SimParams.cs | 37 ++++++++++++++++ EgtBEAMWALL.StressTest/Simulator.cs | 65 +++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 EgtBEAMWALL.StressTest/SimParams.cs create mode 100644 EgtBEAMWALL.StressTest/Simulator.cs diff --git a/EgtBEAMWALL.StressTest/SimParams.cs b/EgtBEAMWALL.StressTest/SimParams.cs new file mode 100644 index 00000000..7c927c9a --- /dev/null +++ b/EgtBEAMWALL.StressTest/SimParams.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace EgtBEAMWALL.StressTest +{ + /// + /// Configurazione simulazione + /// + public class SimParams + { + #region Public Properties + + /// + /// Numero massimo di BtlPart associate a Proj + /// + public int BtlPart2Proj { get; set; } = 20; + + /// + /// Numero massimo di istanze x BtlPart + /// + public int BtlRepeat { get; set; } = 5; + + /// + /// Numero massimo di Part associate a MachGroup + /// + public int Part2MachGroup { get; set; } = 20; + + /// + /// Numero massimo di Proj associati in un Prod + /// + public int Proj2Prod { get; set; } = 2; + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/EgtBEAMWALL.StressTest/Simulator.cs b/EgtBEAMWALL.StressTest/Simulator.cs new file mode 100644 index 00000000..82ffa7e4 --- /dev/null +++ b/EgtBEAMWALL.StressTest/Simulator.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace EgtBEAMWALL.StressTest +{ + public class Simulator + { + #region Protected Fields + + protected SimParams MaxParams = new SimParams(); + + #endregion Protected Fields + + #region Public Fields + + public List BtlPartList = new List(); + public List MachGroupList = new List(); + public List PartList = new List(); + public List ProdList = new List(); + public List ProjList = new List(); + + #endregion Public Fields + + #region Protected Properties + + /// + /// restituisce un set di parametri simulazione generando a caso dal set di base + /// + protected SimParams RandomParamSet + { + get + { + Random rndGen = new Random(); + SimParams answ = new SimParams() + { + BtlPart2Proj = rndGen.Next(MaxParams.BtlPart2Proj), + BtlRepeat = rndGen.Next(MaxParams.BtlRepeat), + Part2MachGroup = rndGen.Next(MaxParams.Part2MachGroup), + Proj2Prod = rndGen.Next(MaxParams.Proj2Prod) + }; + + return answ; + } + } + + #endregion Protected Properties + + #region Public Methods + + /// + /// Generazione set di dati + /// + /// + public bool GenerateData() + { + bool done = false; + + return done; + } + + #endregion Public Methods + } +} \ No newline at end of file