Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/Feynman74.cs @ 17640

Last change on this file since 17640 was 17640, checked in by chaider, 4 years ago

#3075 Added equations of part II

File size: 1.4 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using HeuristicLab.Random;
5
6namespace HeuristicLab.Problems.Instances.DataAnalysis {
7  public class Feynman74 : FeynmanDescriptor {
8    public override string Name { get { return "Feynman II.27.18 epsilon*Ef**2"; } }
9
10    protected override string TargetVariable { get { return "E_den"; } }
11    protected override string[] VariableNames { get { return new[] {"epsilon", "Ef", "E_den"}; } }
12    protected override string[] AllowedInputVariables { get { return new[] {"epsilon", "Ef"}; } }
13
14    public int Seed { get; private set; }
15
16    public Feynman74() : this((int) DateTime.Now.Ticks) { }
17
18    public Feynman74(int seed) {
19      Seed = seed;
20    }
21
22    protected override List<List<double>> GenerateValues() {
23      var rand = new MersenneTwister((uint) Seed);
24
25      var data    = new List<List<double>>();
26      var epsilon = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1, 5).ToList();
27      var Ef      = ValueGenerator.GenerateUniformDistributedValues(rand.Next(), TestPartitionEnd, 1, 5).ToList();
28
29      var E_den = new List<double>();
30
31      data.Add(epsilon);
32      data.Add(Ef);
33      data.Add(E_den);
34
35      for (var i = 0; i < epsilon.Count; i++) {
36        var res = epsilon[i] * Math.Pow(Ef[i], 2);
37        E_den.Add(res);
38      }
39
40      return data;
41    }
42  }
43}
Note: See TracBrowser for help on using the repository browser.