1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 | using HeuristicLab.Random;
|
---|
7 |
|
---|
8 | namespace HeuristicLab.Problems.Instances.DataAnalysis {
|
---|
9 | public sealed class Asadzadeh1 : ArtificialRegressionDataDescriptor {
|
---|
10 | public override string Name => "Asadzadeh1";
|
---|
11 |
|
---|
12 | public override string Description => "Asadzadeh1";
|
---|
13 |
|
---|
14 | protected override string TargetVariable => "F";
|
---|
15 | protected override string[] VariableNames => new string[] { "h", "sigma_y", "t", "Rt", "wR", "F" };
|
---|
16 | protected override string[] AllowedInputVariables => new string[] { "h", "sigma_y", "t", "Rt", "wR" };
|
---|
17 |
|
---|
18 | protected override int TrainingPartitionStart => 0;
|
---|
19 | protected override int TrainingPartitionEnd => 500;
|
---|
20 | protected override int TestPartitionStart => 500;
|
---|
21 | protected override int TestPartitionEnd => 1000;
|
---|
22 |
|
---|
23 | protected override List<List<double>> GenerateValues() {
|
---|
24 | var rand = new MersenneTwister((uint)DateTime.Now.Ticks);
|
---|
25 |
|
---|
26 | List<double> h = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.1, 5).ToList();
|
---|
27 | List<double> sigmaY = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 250, 1000).ToList();
|
---|
28 | List<double> t = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.5, 5).ToList();
|
---|
29 | List<double> Rt = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1, 100).ToList();
|
---|
30 | List<double> wR = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 0.5, 1.5).ToList();
|
---|
31 | List<double> F = new List<double>();
|
---|
32 |
|
---|
33 | for (int i = TrainingPartitionStart; i < TestPartitionEnd; ++i) {
|
---|
34 | F.Add(Calc(h[i], sigmaY[i], t[i], Rt[i], wR[i]));
|
---|
35 | }
|
---|
36 |
|
---|
37 | return new List<List<double>> { h, sigmaY, t, Rt, wR, F };
|
---|
38 | }
|
---|
39 |
|
---|
40 | private static double Calc(double h, double sigmaY, double t, double Rt, double wR) {
|
---|
41 | var E = 210000;
|
---|
42 | var R = Rt * t;
|
---|
43 | var w = wR * R;
|
---|
44 | var e = E / (E + h);
|
---|
45 | var yieldStrength = (sigmaY * (t * t)) / w;
|
---|
46 | var plasticHardening = (h * t * t * t) / (3 * R * w);
|
---|
47 | var elasticity = (4 * sigmaY * sigmaY * sigmaY * R * R) / (3 * w * E * E);
|
---|
48 | var C = 1 + 4 * (t / w);
|
---|
49 | return e * (yieldStrength + plasticHardening - elasticity) * C;
|
---|
50 | }
|
---|
51 | }
|
---|
52 | }
|
---|