Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3022-FastFunctionExtraction/FFX/Approach.cs @ 18140

Last change on this file since 18140 was 17779, checked in by gkronber, 4 years ago

#3022: made a few changes while reviewing the code.

File size: 2.2 KB
Line 
1using System;
2using System.Collections.Generic;
3
4namespace HeuristicLab.Algorithms.DataAnalysis.FastFunctionExtraction {
5    internal struct Approach {
6        public bool AllowInteractions { get; set; }
7        public bool AllowDenominators { get; set; }
8        public bool AllowExp { get; set; }
9        public bool AllowNonLinearFunctions { get; set; }
10        public bool AllowHinge { get; set; }
11        public HashSet<double> Exponents { get; set; }
12        public HashSet<NonlinearOperator> NonLinearFunctions { get; set; }
13        public double MinHingeThreshold { get; set; }
14        public double MaxHingeThreshold { get; set; }
15        public int NumHingeThresholds { get; set; }
16        public double ElasticNetPenalty { get; set; }
17        public int MaxNumBases { get; set; }
18
19        public override string ToString() {
20            return $"Interactions{AllowInteractions} Denominator{AllowDenominators} Exponential{AllowExp} NonLinearFunctions{AllowNonLinearFunctions} HingeFunctions{AllowHinge}";
21        }
22
23        public Approach(bool allowInteractions, bool allowDenominators, bool allowExp, bool allowNonLinearFunctions, bool allowHingeFunctions, HashSet<double> exponents, HashSet<NonlinearOperator> nonLinearFunctions, int maxNumBases, double elasticNetPenality, double minHingeThreshold, double maxHingeThreshold, int numHingeThresholds) {
24            this.AllowInteractions = allowInteractions;
25            this.AllowDenominators = allowDenominators;
26            this.AllowExp = allowExp;
27            this.AllowNonLinearFunctions = allowNonLinearFunctions;
28            this.AllowHinge = allowHingeFunctions;
29            if (AllowExp && exponents == null) throw new ArgumentNullException(nameof(exponents));
30            Exponents = exponents;
31            if (AllowNonLinearFunctions && nonLinearFunctions == null) throw new ArgumentNullException(nameof(nonLinearFunctions));
32            NonLinearFunctions = nonLinearFunctions;
33            MinHingeThreshold = minHingeThreshold;
34            MaxHingeThreshold = maxHingeThreshold;
35            NumHingeThresholds = numHingeThresholds;
36            ElasticNetPenalty = elasticNetPenality;
37            MaxNumBases = maxNumBases;
38        }
39    }
40}
Note: See TracBrowser for help on using the repository browser.