using System; using System.Collections.Generic; namespace HeuristicLab.Algorithms.DataAnalysis.FastFunctionExtraction { internal struct Approach { public bool AllowInteractions { get; set; } public bool AllowDenominators { get; set; } public bool AllowExp { get; set; } public bool AllowNonLinearFunctions { get; set; } public bool AllowHinge { get; set; } public HashSet Exponents { get; set; } public HashSet NonLinearFunctions { get; set; } public double MinHingeThreshold { get; set; } public double MaxHingeThreshold { get; set; } public int NumHingeThresholds { get; set; } public double ElasticNetPenalty { get; set; } public int MaxNumBases { get; set; } public override string ToString() { return $"Interactions{AllowInteractions} Denominator{AllowDenominators} Exponential{AllowExp} NonLinearFunctions{AllowNonLinearFunctions} HingeFunctions{AllowHinge}"; } public Approach(bool allowInteractions, bool allowDenominators, bool allowExp, bool allowNonLinearFunctions, bool allowHingeFunctions, HashSet exponents, HashSet nonLinearFunctions, int maxNumBases, double elasticNetPenality, double minHingeThreshold, double maxHingeThreshold, int numHingeThresholds) { this.AllowInteractions = allowInteractions; this.AllowDenominators = allowDenominators; this.AllowExp = allowExp; this.AllowNonLinearFunctions = allowNonLinearFunctions; this.AllowHinge = allowHingeFunctions; if (AllowExp && exponents == null) throw new ArgumentNullException(nameof(exponents)); Exponents = exponents; if (AllowNonLinearFunctions && nonLinearFunctions == null) throw new ArgumentNullException(nameof(nonLinearFunctions)); NonLinearFunctions = nonLinearFunctions; MinHingeThreshold = minHingeThreshold; MaxHingeThreshold = maxHingeThreshold; NumHingeThresholds = numHingeThresholds; ElasticNetPenalty = elasticNetPenality; MaxNumBases = maxNumBases; } } }