Inizio setup simulatore valori in DB
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace EgtBEAMWALL.StressTest
|
||||
{
|
||||
/// <summary>
|
||||
/// Configurazione simulazione
|
||||
/// </summary>
|
||||
public class SimParams
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Numero massimo di BtlPart associate a Proj
|
||||
/// </summary>
|
||||
public int BtlPart2Proj { get; set; } = 20;
|
||||
|
||||
/// <summary>
|
||||
/// Numero massimo di istanze x BtlPart
|
||||
/// </summary>
|
||||
public int BtlRepeat { get; set; } = 5;
|
||||
|
||||
/// <summary>
|
||||
/// Numero massimo di Part associate a MachGroup
|
||||
/// </summary>
|
||||
public int Part2MachGroup { get; set; } = 20;
|
||||
|
||||
/// <summary>
|
||||
/// Numero massimo di Proj associati in un Prod
|
||||
/// </summary>
|
||||
public int Proj2Prod { get; set; } = 2;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
}
|
||||
@@ -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<Core.BTLPart> BtlPartList = new List<Core.BTLPart>();
|
||||
public List<Core.MyMachGroup> MachGroupList = new List<Core.MyMachGroup>();
|
||||
public List<Core.Part> PartList = new List<Core.Part>();
|
||||
public List<Core.ProjectFile> ProdList = new List<Core.ProjectFile>();
|
||||
public List<Core.ProjectFile> ProjList = new List<Core.ProjectFile>();
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// restituisce un set di parametri simulazione generando a caso dal set di base
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
/// <summary>
|
||||
/// Generazione set di dati
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool GenerateData()
|
||||
{
|
||||
bool done = false;
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user