Changeset 17573
- Timestamp:
- 05/29/20 12:48:39 (4 years ago)
- Location:
- branches/3040_VectorBasedGP
- Files:
-
- 4 edited
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
r17475 r17573 47 47 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 48 48 <Prefer32Bit>false</Prefer32Bit> 49 <LangVersion>latest</LangVersion> 49 50 </PropertyGroup> 50 51 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 57 58 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 58 59 <Prefer32Bit>false</Prefer32Bit> 60 <LangVersion>latest</LangVersion> 59 61 </PropertyGroup> 60 62 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' "> … … 67 69 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 68 70 <Prefer32Bit>false</Prefer32Bit> 71 <LangVersion>latest</LangVersion> 69 72 </PropertyGroup> 70 73 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' "> … … 77 80 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 78 81 <Prefer32Bit>false</Prefer32Bit> 82 <LangVersion>latest</LangVersion> 79 83 </PropertyGroup> 80 84 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> … … 87 91 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 88 92 <Prefer32Bit>false</Prefer32Bit> 93 <LangVersion>latest</LangVersion> 89 94 </PropertyGroup> 90 95 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> … … 97 102 <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> 98 103 <Prefer32Bit>false</Prefer32Bit> 104 <LangVersion>latest</LangVersion> 99 105 </PropertyGroup> 100 106 <ItemGroup> … … 128 134 </Compile> 129 135 <Compile Include="Plugin.cs" /> 136 <Compile Include="Symbols\WindowedSymbolView.cs"> 137 <SubType>UserControl</SubType> 138 </Compile> 139 <Compile Include="Symbols\WindowedSymbolView.Designer.cs"> 140 <DependentUpon>WindowedSymbolView.cs</DependentUpon> 141 </Compile> 130 142 <Compile Include="TextualSymbolicDataAnalysisModelView.cs"> 131 143 <SubType>UserControl</SubType> -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/WindowedSymbolView.Designer.cs
r17551 r17573 21 21 22 22 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { 23 partial class ConstantView {23 partial class WindowedSymbolView { 24 24 /// <summary> 25 25 /// Required designer variable. … … 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this. weightNuLabel = new System.Windows.Forms.Label();48 this. minValueTextBox = new System.Windows.Forms.TextBox();47 this.initOffsetLabel = new System.Windows.Forms.Label(); 48 this.initOffsetSigTextBox = new System.Windows.Forms.TextBox(); 49 49 this.initializationGroupBox = new System.Windows.Forms.GroupBox(); 50 this.weightSigmaLabel = new System.Windows.Forms.Label(); 51 this.maxValueTextBox = new System.Windows.Forms.TextBox(); 50 this.initLengthMuTextBox = new System.Windows.Forms.TextBox(); 51 this.initOffsetMuTextBox = new System.Windows.Forms.TextBox(); 52 this.initLengthLabel = new System.Windows.Forms.Label(); 53 this.initLengthSigTextBox = new System.Windows.Forms.TextBox(); 52 54 this.mutationGroupBox = new System.Windows.Forms.GroupBox(); 53 this.multiplicativeChangeLabel = new System.Windows.Forms.Label(); 54 this.multiplicativeChangeSigmaTextBox = new System.Windows.Forms.TextBox(); 55 this.additiveChangeLabel = new System.Windows.Forms.Label(); 56 this.additiveChangeSigmaTextBox = new System.Windows.Forms.TextBox(); 55 this.mutLengthMuTextBox = new System.Windows.Forms.TextBox(); 56 this.mutOffsetMuTextBox = new System.Windows.Forms.TextBox(); 57 this.mutLengthLabel = new System.Windows.Forms.Label(); 58 this.mutLengthSigTextBox = new System.Windows.Forms.TextBox(); 59 this.mutOffsetLabel = new System.Windows.Forms.Label(); 60 this.mutOffsetSigTextBox = new System.Windows.Forms.TextBox(); 61 this.enableWindowedCheckBox = new System.Windows.Forms.CheckBox(); 57 62 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit(); 58 63 this.initializationGroupBox.SuspendLayout(); … … 67 72 // 68 73 this.errorProvider.SetIconAlignment(this.initialFrequencyTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 69 this.initialFrequencyTextBox.Size = new System.Drawing.Size(280, 20); 74 this.initialFrequencyTextBox.Size = new System.Drawing.Size(280, 26); 75 // 76 // minimumArityLabel 77 // 78 this.toolTip.SetToolTip(this.minimumArityLabel, "The minimum arity of the symbol"); 79 // 80 // maximumArityLabel 81 // 82 this.toolTip.SetToolTip(this.maximumArityLabel, "The maximum arity of the symbol"); 70 83 // 71 84 // minimumArityTextBox 72 85 // 73 86 this.errorProvider.SetIconAlignment(this.minimumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 74 this.minimumArityTextBox.Size = new System.Drawing.Size(280, 2 0);87 this.minimumArityTextBox.Size = new System.Drawing.Size(280, 26); 75 88 // 76 89 // maximumArityTextBox 77 90 // 78 91 this.errorProvider.SetIconAlignment(this.maximumArityTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 79 this.maximumArityTextBox.Size = new System.Drawing.Size(280, 2 0);92 this.maximumArityTextBox.Size = new System.Drawing.Size(280, 26); 80 93 // 81 94 // nameTextBox … … 83 96 this.errorProvider.SetIconAlignment(this.nameTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 84 97 this.errorProvider.SetIconPadding(this.nameTextBox, 2); 85 this.nameTextBox.Size = new System.Drawing.Size(280, 2 0);98 this.nameTextBox.Size = new System.Drawing.Size(280, 26); 86 99 // 87 100 // infoLabel … … 89 102 this.infoLabel.Location = new System.Drawing.Point(379, 3); 90 103 // 91 // weightNuLabel 92 // 93 this.weightNuLabel.AutoSize = true; 94 this.weightNuLabel.Location = new System.Drawing.Point(6, 22); 95 this.weightNuLabel.Name = "weightNuLabel"; 96 this.weightNuLabel.Size = new System.Drawing.Size(56, 13); 97 this.weightNuLabel.TabIndex = 0; 98 this.weightNuLabel.Text = "Min value:"; 99 this.toolTip.SetToolTip(this.weightNuLabel, "The minimal value to use for random initialization of constants."); 100 // 101 // minValueTextBox 102 // 103 this.minValueTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 104 // initOffsetLabel 105 // 106 this.initOffsetLabel.AutoSize = true; 107 this.initOffsetLabel.Location = new System.Drawing.Point(6, 22); 108 this.initOffsetLabel.Name = "initOffsetLabel"; 109 this.initOffsetLabel.Size = new System.Drawing.Size(121, 20); 110 this.initOffsetLabel.TabIndex = 0; 111 this.initOffsetLabel.Text = "Offset (mu, sig):"; 112 this.toolTip.SetToolTip(this.initOffsetLabel, "The minimal value to use for random initialization of constants."); 113 // 114 // initOffsetSigTextBox 115 // 116 this.errorProvider.SetIconAlignment(this.initOffsetSigTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 117 this.initOffsetSigTextBox.Location = new System.Drawing.Point(268, 19); 118 this.initOffsetSigTextBox.Name = "initOffsetSigTextBox"; 119 this.initOffsetSigTextBox.Size = new System.Drawing.Size(124, 26); 120 this.initOffsetSigTextBox.TabIndex = 1; 121 this.toolTip.SetToolTip(this.initOffsetSigTextBox, "The minimal value to use for random initialization of constants."); 122 this.initOffsetSigTextBox.TextChanged += new System.EventHandler(this.initOffsetSigTextBox_TextChanged); 123 // 124 // initializationGroupBox 125 // 126 this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 104 127 | System.Windows.Forms.AnchorStyles.Right))); 105 this.errorProvider.SetIconAlignment(this.minValueTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 106 this.minValueTextBox.Location = new System.Drawing.Point(92, 19); 107 this.minValueTextBox.Name = "minValueTextBox"; 108 this.minValueTextBox.Size = new System.Drawing.Size(300, 20); 109 this.minValueTextBox.TabIndex = 1; 110 this.toolTip.SetToolTip(this.minValueTextBox, "The minimal value to use for random initialization of constants."); 111 this.minValueTextBox.TextChanged += new System.EventHandler(this.minValueTextBox_TextChanged); 112 // 113 // initializationGroupBox 114 // 115 this.initializationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 116 | System.Windows.Forms.AnchorStyles.Right))); 117 this.initializationGroupBox.Controls.Add(this.weightSigmaLabel); 118 this.initializationGroupBox.Controls.Add(this.maxValueTextBox); 119 this.initializationGroupBox.Controls.Add(this.weightNuLabel); 120 this.initializationGroupBox.Controls.Add(this.minValueTextBox); 121 this.initializationGroupBox.Location = new System.Drawing.Point(0, 127); 128 this.initializationGroupBox.Controls.Add(this.initLengthMuTextBox); 129 this.initializationGroupBox.Controls.Add(this.initOffsetMuTextBox); 130 this.initializationGroupBox.Controls.Add(this.initLengthLabel); 131 this.initializationGroupBox.Controls.Add(this.initLengthSigTextBox); 132 this.initializationGroupBox.Controls.Add(this.initOffsetLabel); 133 this.initializationGroupBox.Controls.Add(this.initOffsetSigTextBox); 134 this.initializationGroupBox.Location = new System.Drawing.Point(0, 164); 122 135 this.initializationGroupBox.Name = "initializationGroupBox"; 123 this.initializationGroupBox.Size = new System.Drawing.Size(398, 73);136 this.initializationGroupBox.Size = new System.Drawing.Size(398, 84); 124 137 this.initializationGroupBox.TabIndex = 5; 125 138 this.initializationGroupBox.TabStop = false; 126 139 this.initializationGroupBox.Text = "Initialization"; 127 140 // 128 // weightSigmaLabel 129 // 130 this.weightSigmaLabel.AutoSize = true; 131 this.weightSigmaLabel.Location = new System.Drawing.Point(6, 48); 132 this.weightSigmaLabel.Name = "weightSigmaLabel"; 133 this.weightSigmaLabel.Size = new System.Drawing.Size(59, 13); 134 this.weightSigmaLabel.TabIndex = 2; 135 this.weightSigmaLabel.Text = "Max value:"; 136 this.toolTip.SetToolTip(this.weightSigmaLabel, "The maximal value to use for random initialization of constants."); 137 // 138 // maxValueTextBox 139 // 140 this.maxValueTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 141 // initLengthMuTextBox 142 // 143 this.errorProvider.SetIconAlignment(this.initLengthMuTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 144 this.initLengthMuTextBox.Location = new System.Drawing.Point(138, 45); 145 this.initLengthMuTextBox.Name = "initLengthMuTextBox"; 146 this.initLengthMuTextBox.Size = new System.Drawing.Size(124, 26); 147 this.initLengthMuTextBox.TabIndex = 5; 148 this.toolTip.SetToolTip(this.initLengthMuTextBox, "The maximal value to use for random initialization of constants."); 149 this.initLengthMuTextBox.TextChanged += new System.EventHandler(this.initLengthMuTextBox_TextChanged); 150 // 151 // initOffsetMuTextBox 152 // 153 this.errorProvider.SetIconAlignment(this.initOffsetMuTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 154 this.initOffsetMuTextBox.Location = new System.Drawing.Point(138, 19); 155 this.initOffsetMuTextBox.Name = "initOffsetMuTextBox"; 156 this.initOffsetMuTextBox.Size = new System.Drawing.Size(124, 26); 157 this.initOffsetMuTextBox.TabIndex = 4; 158 this.toolTip.SetToolTip(this.initOffsetMuTextBox, "The minimal value to use for random initialization of constants."); 159 this.initOffsetMuTextBox.TextChanged += new System.EventHandler(this.initOffsetMuTextBox_TextChanged); 160 // 161 // initLengthLabel 162 // 163 this.initLengthLabel.AutoSize = true; 164 this.initLengthLabel.Location = new System.Drawing.Point(6, 48); 165 this.initLengthLabel.Name = "initLengthLabel"; 166 this.initLengthLabel.Size = new System.Drawing.Size(127, 20); 167 this.initLengthLabel.TabIndex = 2; 168 this.initLengthLabel.Text = "Length (mu, sig):"; 169 this.toolTip.SetToolTip(this.initLengthLabel, "The maximal value to use for random initialization of constants."); 170 // 171 // initLengthSigTextBox 172 // 173 this.errorProvider.SetIconAlignment(this.initLengthSigTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 174 this.initLengthSigTextBox.Location = new System.Drawing.Point(268, 45); 175 this.initLengthSigTextBox.Name = "initLengthSigTextBox"; 176 this.initLengthSigTextBox.Size = new System.Drawing.Size(124, 26); 177 this.initLengthSigTextBox.TabIndex = 3; 178 this.toolTip.SetToolTip(this.initLengthSigTextBox, "The maximal value to use for random initialization of constants."); 179 this.initLengthSigTextBox.TextChanged += new System.EventHandler(this.initLengthSigTextBox_TextChanged); 180 // 181 // mutationGroupBox 182 // 183 this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 141 184 | System.Windows.Forms.AnchorStyles.Right))); 142 this.errorProvider.SetIconAlignment(this.maxValueTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 143 this.maxValueTextBox.Location = new System.Drawing.Point(92, 45); 144 this.maxValueTextBox.Name = "maxValueTextBox"; 145 this.maxValueTextBox.Size = new System.Drawing.Size(300, 20); 146 this.maxValueTextBox.TabIndex = 3; 147 this.toolTip.SetToolTip(this.maxValueTextBox, "The maximal value to use for random initialization of constants."); 148 this.maxValueTextBox.TextChanged += new System.EventHandler(this.maxValueTextBox_TextChanged); 149 // 150 // mutationGroupBox 151 // 152 this.mutationGroupBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 153 | System.Windows.Forms.AnchorStyles.Right))); 154 this.mutationGroupBox.Controls.Add(this.multiplicativeChangeLabel); 155 this.mutationGroupBox.Controls.Add(this.multiplicativeChangeSigmaTextBox); 156 this.mutationGroupBox.Controls.Add(this.additiveChangeLabel); 157 this.mutationGroupBox.Controls.Add(this.additiveChangeSigmaTextBox); 158 this.mutationGroupBox.Location = new System.Drawing.Point(0, 206); 185 this.mutationGroupBox.Controls.Add(this.mutLengthMuTextBox); 186 this.mutationGroupBox.Controls.Add(this.mutOffsetMuTextBox); 187 this.mutationGroupBox.Controls.Add(this.mutLengthLabel); 188 this.mutationGroupBox.Controls.Add(this.mutLengthSigTextBox); 189 this.mutationGroupBox.Controls.Add(this.mutOffsetLabel); 190 this.mutationGroupBox.Controls.Add(this.mutOffsetSigTextBox); 191 this.mutationGroupBox.Location = new System.Drawing.Point(0, 254); 159 192 this.mutationGroupBox.Name = "mutationGroupBox"; 160 this.mutationGroupBox.Size = new System.Drawing.Size(398, 73);193 this.mutationGroupBox.Size = new System.Drawing.Size(398, 82); 161 194 this.mutationGroupBox.TabIndex = 6; 162 195 this.mutationGroupBox.TabStop = false; 163 196 this.mutationGroupBox.Text = "Mutation"; 164 197 // 165 // multiplicativeChangeLabel 166 // 167 this.multiplicativeChangeLabel.AutoSize = true; 168 this.multiplicativeChangeLabel.Location = new System.Drawing.Point(6, 48); 169 this.multiplicativeChangeLabel.Name = "multiplicativeChangeLabel"; 170 this.multiplicativeChangeLabel.Size = new System.Drawing.Size(146, 13); 171 this.multiplicativeChangeLabel.TabIndex = 2; 172 this.multiplicativeChangeLabel.Text = "Multiplicative change (sigma):"; 173 this.toolTip.SetToolTip(this.multiplicativeChangeLabel, "The sigma (std. dev.) parameter for the normal distribution to use to sample the " + 198 // mutLengthMuTextBox 199 // 200 this.errorProvider.SetIconAlignment(this.mutLengthMuTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 201 this.mutLengthMuTextBox.Location = new System.Drawing.Point(138, 45); 202 this.mutLengthMuTextBox.Name = "mutLengthMuTextBox"; 203 this.mutLengthMuTextBox.Size = new System.Drawing.Size(124, 26); 204 this.mutLengthMuTextBox.TabIndex = 5; 205 this.toolTip.SetToolTip(this.mutLengthMuTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample a mu" + 206 "ltiplicative change."); 207 this.mutLengthMuTextBox.TextChanged += new System.EventHandler(this.mutLengthMuTextBox_TextChanged); 208 // 209 // mutOffsetMuTextBox 210 // 211 this.errorProvider.SetIconAlignment(this.mutOffsetMuTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 212 this.mutOffsetMuTextBox.Location = new System.Drawing.Point(138, 19); 213 this.mutOffsetMuTextBox.Name = "mutOffsetMuTextBox"; 214 this.mutOffsetMuTextBox.Size = new System.Drawing.Size(124, 26); 215 this.mutOffsetMuTextBox.TabIndex = 4; 216 this.toolTip.SetToolTip(this.mutOffsetMuTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample an a" + 217 "dditive change."); 218 this.mutOffsetMuTextBox.TextChanged += new System.EventHandler(this.mutOffsetMuTextBox_TextChanged); 219 // 220 // mutLengthLabel 221 // 222 this.mutLengthLabel.AutoSize = true; 223 this.mutLengthLabel.Location = new System.Drawing.Point(6, 48); 224 this.mutLengthLabel.Name = "mutLengthLabel"; 225 this.mutLengthLabel.Size = new System.Drawing.Size(127, 20); 226 this.mutLengthLabel.TabIndex = 2; 227 this.mutLengthLabel.Text = "Length (mu, sig):"; 228 this.toolTip.SetToolTip(this.mutLengthLabel, "The sigma (std. dev.) parameter for the normal distribution to use to sample the " + 174 229 "multiplicative change."); 175 230 // 176 // multiplicativeChangeSigmaTextBox 177 // 178 this.multiplicativeChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 179 | System.Windows.Forms.AnchorStyles.Right))); 180 this.errorProvider.SetIconAlignment(this.multiplicativeChangeSigmaTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 181 this.multiplicativeChangeSigmaTextBox.Location = new System.Drawing.Point(168, 45); 182 this.multiplicativeChangeSigmaTextBox.Name = "multiplicativeChangeSigmaTextBox"; 183 this.multiplicativeChangeSigmaTextBox.Size = new System.Drawing.Size(224, 20); 184 this.multiplicativeChangeSigmaTextBox.TabIndex = 3; 185 this.toolTip.SetToolTip(this.multiplicativeChangeSigmaTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample a mu" + 231 // mutLengthSigTextBox 232 // 233 this.errorProvider.SetIconAlignment(this.mutLengthSigTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 234 this.mutLengthSigTextBox.Location = new System.Drawing.Point(268, 45); 235 this.mutLengthSigTextBox.Name = "mutLengthSigTextBox"; 236 this.mutLengthSigTextBox.Size = new System.Drawing.Size(124, 26); 237 this.mutLengthSigTextBox.TabIndex = 3; 238 this.toolTip.SetToolTip(this.mutLengthSigTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample a mu" + 186 239 "ltiplicative change."); 187 this.mu ltiplicativeChangeSigmaTextBox.TextChanged += new System.EventHandler(this.multiplicativeChangeSigmaTextBox_TextChanged);188 // 189 // additiveChangeLabel190 // 191 this. additiveChangeLabel.AutoSize = true;192 this. additiveChangeLabel.Location = new System.Drawing.Point(6, 22);193 this. additiveChangeLabel.Name = "additiveChangeLabel";194 this. additiveChangeLabel.Size = new System.Drawing.Size(123, 13);195 this. additiveChangeLabel.TabIndex = 0;196 this. additiveChangeLabel.Text = "Additive change (sigma):";197 this.toolTip.SetToolTip(this. additiveChangeLabel, "The sigma (std. dev.) parameter for the normal distribution to sample the additiv" +240 this.mutLengthSigTextBox.TextChanged += new System.EventHandler(this.mutLengthSigTextBox_TextChanged); 241 // 242 // mutOffsetLabel 243 // 244 this.mutOffsetLabel.AutoSize = true; 245 this.mutOffsetLabel.Location = new System.Drawing.Point(6, 22); 246 this.mutOffsetLabel.Name = "mutOffsetLabel"; 247 this.mutOffsetLabel.Size = new System.Drawing.Size(121, 20); 248 this.mutOffsetLabel.TabIndex = 0; 249 this.mutOffsetLabel.Text = "Offset (mu, sig):"; 250 this.toolTip.SetToolTip(this.mutOffsetLabel, "The sigma (std. dev.) parameter for the normal distribution to sample the additiv" + 198 251 "e change."); 199 252 // 200 // additiveChangeSigmaTextBox 201 // 202 this.additiveChangeSigmaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 203 | System.Windows.Forms.AnchorStyles.Right))); 204 this.errorProvider.SetIconAlignment(this.additiveChangeSigmaTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 205 this.additiveChangeSigmaTextBox.Location = new System.Drawing.Point(168, 19); 206 this.additiveChangeSigmaTextBox.Name = "additiveChangeSigmaTextBox"; 207 this.additiveChangeSigmaTextBox.Size = new System.Drawing.Size(224, 20); 208 this.additiveChangeSigmaTextBox.TabIndex = 1; 209 this.toolTip.SetToolTip(this.additiveChangeSigmaTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample an a" + 253 // mutOffsetSigTextBox 254 // 255 this.errorProvider.SetIconAlignment(this.mutOffsetSigTextBox, System.Windows.Forms.ErrorIconAlignment.MiddleLeft); 256 this.mutOffsetSigTextBox.Location = new System.Drawing.Point(268, 19); 257 this.mutOffsetSigTextBox.Name = "mutOffsetSigTextBox"; 258 this.mutOffsetSigTextBox.Size = new System.Drawing.Size(124, 26); 259 this.mutOffsetSigTextBox.TabIndex = 1; 260 this.toolTip.SetToolTip(this.mutOffsetSigTextBox, "The sigma (std. dev.) parameter for the normal distribution to use to sample an a" + 210 261 "dditive change."); 211 this.additiveChangeSigmaTextBox.TextChanged += new System.EventHandler(this.additiveChangeSigmaTextBox_TextChanged); 212 // 213 // ConstantView 214 // 215 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 262 this.mutOffsetSigTextBox.TextChanged += new System.EventHandler(this.mutOffsetSigTextBox_TextChanged); 263 // 264 // enableWindowedCheckBox 265 // 266 this.enableWindowedCheckBox.AutoSize = true; 267 this.enableWindowedCheckBox.Location = new System.Drawing.Point(3, 134); 268 this.enableWindowedCheckBox.Name = "enableWindowedCheckBox"; 269 this.enableWindowedCheckBox.Size = new System.Drawing.Size(175, 24); 270 this.enableWindowedCheckBox.TabIndex = 10; 271 this.enableWindowedCheckBox.Text = "Windowing Enabled"; 272 this.enableWindowedCheckBox.UseVisualStyleBackColor = true; 273 this.enableWindowedCheckBox.CheckedChanged += new System.EventHandler(this.enableWindowedCheckBox_CheckedChanged); 274 // 275 // WindowedSymbolView 276 // 216 277 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 278 this.Controls.Add(this.enableWindowedCheckBox); 217 279 this.Controls.Add(this.mutationGroupBox); 218 280 this.Controls.Add(this.initializationGroupBox); 219 this.Name = "ConstantView"; 220 this.Size = new System.Drawing.Size(398, 284); 281 this.Name = "WindowedSymbolView"; 282 this.Size = new System.Drawing.Size(398, 340); 283 this.Controls.SetChildIndex(this.enabledCheckBox, 0); 221 284 this.Controls.SetChildIndex(this.maximumArityLabel, 0); 222 285 this.Controls.SetChildIndex(this.maximumArityTextBox, 0); … … 230 293 this.Controls.SetChildIndex(this.nameTextBox, 0); 231 294 this.Controls.SetChildIndex(this.mutationGroupBox, 0); 295 this.Controls.SetChildIndex(this.enableWindowedCheckBox, 0); 232 296 ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit(); 233 297 this.initializationGroupBox.ResumeLayout(false); … … 242 306 #endregion 243 307 244 private System.Windows.Forms.Label weightNuLabel;245 private System.Windows.Forms.TextBox minValueTextBox;308 private System.Windows.Forms.Label initOffsetLabel; 309 private System.Windows.Forms.TextBox initOffsetSigTextBox; 246 310 protected System.Windows.Forms.GroupBox initializationGroupBox; 247 private System.Windows.Forms.Label weightSigmaLabel;248 private System.Windows.Forms.TextBox maxValueTextBox;311 private System.Windows.Forms.Label initLengthLabel; 312 private System.Windows.Forms.TextBox initLengthSigTextBox; 249 313 protected System.Windows.Forms.GroupBox mutationGroupBox; 250 private System.Windows.Forms.Label multiplicativeChangeLabel; 251 private System.Windows.Forms.TextBox multiplicativeChangeSigmaTextBox; 252 private System.Windows.Forms.Label additiveChangeLabel; 253 private System.Windows.Forms.TextBox additiveChangeSigmaTextBox; 254 314 private System.Windows.Forms.Label mutLengthLabel; 315 private System.Windows.Forms.TextBox mutLengthSigTextBox; 316 private System.Windows.Forms.Label mutOffsetLabel; 317 private System.Windows.Forms.TextBox mutOffsetSigTextBox; 318 private System.Windows.Forms.TextBox initLengthMuTextBox; 319 private System.Windows.Forms.TextBox initOffsetMuTextBox; 320 private System.Windows.Forms.TextBox mutLengthMuTextBox; 321 private System.Windows.Forms.TextBox mutOffsetMuTextBox; 322 private System.Windows.Forms.CheckBox enableWindowedCheckBox; 255 323 } 256 324 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Symbols/WindowedSymbolView.cs
r17551 r17573 27 27 28 28 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { 29 [View(" ConstantView")]30 [Content(typeof( Constant), true)]31 public partial class ConstantView : SymbolView {32 public new ConstantContent {33 get { return ( Constant)base.Content; }29 [View("WindowedSymbol View")] 30 [Content(typeof(WindowedSymbol), true)] 31 public partial class WindowedSymbolView : SymbolView { 32 public new WindowedSymbol Content { 33 get { return (WindowedSymbol)base.Content; } 34 34 set { base.Content = value; } 35 35 } 36 36 37 public ConstantView() {37 public WindowedSymbolView() { 38 38 InitializeComponent(); 39 39 } … … 56 56 protected override void SetEnabledStateOfControls() { 57 57 base.SetEnabledStateOfControls(); 58 minValueTextBox.Enabled = Content != null; 59 minValueTextBox.ReadOnly = ReadOnly; 60 maxValueTextBox.Enabled = Content != null; 61 maxValueTextBox.ReadOnly = ReadOnly; 62 additiveChangeSigmaTextBox.Enabled = Content != null; 63 additiveChangeSigmaTextBox.ReadOnly = ReadOnly; 64 multiplicativeChangeSigmaTextBox.Enabled = Content != null; 65 multiplicativeChangeSigmaTextBox.ReadOnly = ReadOnly; 58 59 initializationGroupBox.Enabled = Content != null && Content.EnableWindowing; 60 mutationGroupBox.Enabled = Content != null && Content.EnableWindowing; 61 62 initOffsetMuTextBox.ReadOnly = ReadOnly; 63 initOffsetSigTextBox.ReadOnly = ReadOnly; 64 initLengthMuTextBox.ReadOnly = ReadOnly; 65 initLengthSigTextBox.ReadOnly = ReadOnly; 66 mutOffsetMuTextBox.ReadOnly = ReadOnly; 67 mutOffsetSigTextBox.ReadOnly = ReadOnly; 68 mutLengthMuTextBox.ReadOnly = ReadOnly; 69 mutLengthSigTextBox.ReadOnly = ReadOnly; 66 70 } 67 71 … … 73 77 74 78 #region control event handlers 75 private void minValueTextBox_TextChanged(object sender, EventArgs e) { 76 double min; 77 if (double.TryParse(minValueTextBox.Text, out min)) { 78 Content.MinValue = min; 79 errorProvider.SetError(minValueTextBox, string.Empty); 79 private void enableWindowedCheckBox_CheckedChanged(object sender, EventArgs e) { 80 if (Content == null) return; 81 Content.EnableWindowing = enableWindowedCheckBox.Checked; 82 } 83 84 private void initOffsetMuTextBox_TextChanged(object sender, EventArgs e) { 85 if (Content == null) return; 86 if (double.TryParse(initOffsetMuTextBox.Text, out double initOffsetMu)) { 87 Content.OffsetMu = initOffsetMu; 88 errorProvider.SetError(initOffsetMuTextBox, string.Empty); 80 89 } else { 81 errorProvider.SetError( minValueTextBox, "Invalid value");90 errorProvider.SetError(initOffsetMuTextBox, "Invalid value"); 82 91 } 83 92 } 84 private void maxValueTextBox_TextChanged(object sender, EventArgs e) {85 double max;86 if (double.TryParse( maxValueTextBox.Text, out max)) {87 Content. MaxValue = max;88 errorProvider.SetError( maxValueTextBox, string.Empty);93 private void initOffsetSigTextBox_TextChanged(object sender, EventArgs e) { 94 if (Content == null) return; 95 if (double.TryParse(initOffsetSigTextBox.Text, out double initOffsetSig)) { 96 Content.OffsetSigma = initOffsetSig; 97 errorProvider.SetError(initOffsetSigTextBox, string.Empty); 89 98 } else { 90 errorProvider.SetError(maxValueTextBox, "Invalid value"); 99 errorProvider.SetError(initOffsetSigTextBox, "Invalid value"); 100 } 101 } 102 private void initLengthMuTextBox_TextChanged(object sender, EventArgs e) { 103 if (Content == null) return; 104 if (double.TryParse(initLengthMuTextBox.Text, out double initLengthMu)) { 105 Content.LengthMu = initLengthMu; 106 errorProvider.SetError(initLengthMuTextBox, string.Empty); 107 } else { 108 errorProvider.SetError(initLengthMuTextBox, "Invalid value"); 109 } 110 } 111 private void initLengthSigTextBox_TextChanged(object sender, EventArgs e) { 112 if (Content == null) return; 113 if (double.TryParse(initLengthSigTextBox.Text, out double initLengthSig)) { 114 Content.LengthSigma = initLengthSig; 115 errorProvider.SetError(initLengthSigTextBox, string.Empty); 116 } else { 117 errorProvider.SetError(initLengthSigTextBox, "Invalid value"); 91 118 } 92 119 } 93 120 94 private void additiveChangeSigmaTextBox_TextChanged(object sender, EventArgs e) {95 double sigma;96 if (double.TryParse( additiveChangeSigmaTextBox.Text, out sigma) && sigma >= 0.0) {97 Content.Manipulator Sigma = sigma;98 errorProvider.SetError( additiveChangeSigmaTextBox, string.Empty);121 private void mutOffsetMuTextBox_TextChanged(object sender, EventArgs e) { 122 if (Content == null) return; 123 if (double.TryParse(mutOffsetMuTextBox.Text, out double mutOffsetMu)) { 124 Content.ManipulatorOffsetMu = mutOffsetMu; 125 errorProvider.SetError(mutOffsetMuTextBox, string.Empty); 99 126 } else { 100 errorProvider.SetError( additiveChangeSigmaTextBox, "Invalid value");127 errorProvider.SetError(mutOffsetMuTextBox, "Invalid value"); 101 128 } 102 129 } 103 104 private void multiplicativeChangeSigmaTextBox_TextChanged(object sender, EventArgs e) { 105 double sigma; 106 if (double.TryParse(multiplicativeChangeSigmaTextBox.Text, out sigma) && sigma >= 0.0) { 107 Content.MultiplicativeManipulatorSigma = sigma; 108 errorProvider.SetError(multiplicativeChangeSigmaTextBox, string.Empty); 130 private void mutOffsetSigTextBox_TextChanged(object sender, EventArgs e) { 131 if (Content == null) return; 132 if (double.TryParse(mutOffsetSigTextBox.Text, out double mutOffsetSig)) { 133 Content.ManipulatorOffsetSigma = mutOffsetSig; 134 errorProvider.SetError(mutOffsetSigTextBox, string.Empty); 109 135 } else { 110 errorProvider.SetError(multiplicativeChangeSigmaTextBox, "Invalid value"); 136 errorProvider.SetError(mutOffsetSigTextBox, "Invalid value"); 137 } 138 } 139 private void mutLengthMuTextBox_TextChanged(object sender, EventArgs e) { 140 if (Content == null) return; 141 if (double.TryParse(mutLengthMuTextBox.Text, out double mutLengthMu)) { 142 Content.ManipulatorLengthMu = mutLengthMu; 143 errorProvider.SetError(mutLengthMuTextBox, string.Empty); 144 } else { 145 errorProvider.SetError(mutLengthMuTextBox, "Invalid value"); 146 } 147 } 148 private void mutLengthSigTextBox_TextChanged(object sender, EventArgs e) { 149 if (Content == null) return; 150 if (double.TryParse(mutLengthSigTextBox.Text, out double mutLengthSig)) { 151 Content.ManipulatorLengthSigma = mutLengthSig; 152 errorProvider.SetError(mutLengthSigTextBox, string.Empty); 153 } else { 154 errorProvider.SetError(mutLengthSigTextBox, "Invalid value"); 111 155 } 112 156 } … … 115 159 #region helpers 116 160 private void UpdateControl() { 117 if (Content == null) {118 minValueTextBox.Text = string.Empty; 119 maxValueTextBox.Text =string.Empty;120 minValueTextBox.Text =string.Empty;121 multiplicativeChangeSigmaTextBox.Text =string.Empty;122 additiveChangeSigmaTextBox.Text =string.Empty;123 } else { 124 minValueTextBox.Text = Content.MinValue.ToString();125 maxValueTextBox.Text = Content.MaxValue.ToString();126 additiveChangeSigmaTextBox.Text = Content.ManipulatorSigma.ToString();127 multiplicativeChangeSigmaTextBox.Text = Content.MultiplicativeManipulatorSigma.ToString();128 }161 enableWindowedCheckBox.Checked = Content?.EnableWindowing ?? false; 162 163 initOffsetMuTextBox.Text = Content?.OffsetMu.ToString() ?? string.Empty; 164 initOffsetSigTextBox.Text = Content?.OffsetSigma.ToString() ?? string.Empty; 165 initLengthMuTextBox.Text = Content?.LengthMu.ToString() ?? string.Empty; 166 initLengthSigTextBox.Text = Content?.LengthSigma.ToString() ?? string.Empty; 167 168 mutOffsetMuTextBox.Text = Content?.ManipulatorOffsetMu.ToString() ?? string.Empty; 169 mutOffsetSigTextBox.Text = Content?.ManipulatorOffsetSigma.ToString() ?? string.Empty; 170 mutLengthMuTextBox.Text = Content?.ManipulatorLengthMu.ToString() ?? string.Empty; 171 mutLengthSigTextBox.Text = Content?.ManipulatorLengthSigma.ToString() ?? string.Empty; 172 129 173 SetEnabledStateOfControls(); 130 174 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
r17554 r17573 181 181 <Compile Include="Importer\Token.cs" /> 182 182 <Compile Include="Interfaces\IModelBacktransformator.cs" /> 183 <Compile Include="Interfaces\IWindowedSymbolTreeNode.cs" /> 184 <Compile Include="Interfaces\IWindowedSymbol.cs" /> 183 185 <Compile Include="Interfaces\IVariableTreeNode.cs" /> 184 186 <Compile Include="Interfaces\IVariableSymbol.cs" /> … … 250 252 <Compile Include="Symbols\Kurtosis.cs" /> 251 253 <Compile Include="Symbols\Skewness.cs" /> 254 <Compile Include="Symbols\WindowedSymbolTreeNode.cs" /> 255 <Compile Include="Symbols\WindowedSymbol.cs" /> 252 256 <Compile Include="Symbols\Variance.cs" /> 253 257 <Compile Include="Symbols\StandardDeviation.cs" /> -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IWindowedSymbol.cs
r17551 r17573 24 24 25 25 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 26 [StorableType(" 3b28c671-df09-4f2c-9292-b3510b593c5f")]26 [StorableType("BB96C8EF-4DB8-4892-B3A3-358F34C06AD6")] 27 27 /// <summary> 28 /// Any symbol that references a variable (includes terminal as well as non-terminal symbols)28 /// Any symbol that can use a window (e.g. partial aggregation of a vector) 29 29 /// </summary> 30 public interface I VariableSymbol : ISymbol {30 public interface IWindowedSymbol : ISymbol { 31 31 } 32 32 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interfaces/IWindowedSymbolTreeNode.cs
r17551 r17573 24 24 25 25 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 26 [StorableType(" cc5c792d-09a8-4351-8438-bd8482d8aa03")]26 [StorableType("7EF181F5-6595-41D4-8D40-94B1DA0BC28A")] 27 27 /// <summary> 28 /// Any tree node that references a variable28 /// Any tree node that references a windowed function 29 29 /// </summary> 30 public interface IVariableTreeNode : ISymbolicExpressionTreeNode { 31 string VariableName { get; } 30 public interface IWindowedSymbolTreeNode : ISymbolicExpressionTreeNode { 31 double Offset { get; } 32 double Length { get; } 32 33 } 33 34 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeVectorInterpreter.cs
r17556 r17573 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; … … 41 42 Median, 42 43 Sum, 44 First, 43 45 NaN, 44 46 Exception … … 127 129 else if (FinalAggregation == Aggregation.Median) yield return Statistics.Median(result.Vector); 128 130 else if (FinalAggregation == Aggregation.Sum) yield return result.Vector.Sum(); 131 else if (FinalAggregation == Aggregation.First) yield return result.Vector.First(); 129 132 else if (FinalAggregation == Aggregation.Exception) throw new InvalidOperationException("Result of the tree is not a scalar."); 130 133 else yield return double.NaN; … … 221 224 return EvaluationResult.NaN; 222 225 } 226 227 private static EvaluationResult AggregateApply(EvaluationResult val, WindowedSymbolTreeNode node, 228 Func<double, double> sFunc = null, 229 Func<DoubleVector, double> vFunc = null) { 230 231 var offset = node.Offset; 232 var length = node.Length; 233 234 DoubleVector SubVector(DoubleVector v) { 235 int index = (int)(offset * v.Count); 236 int count = (int)(length * (v.Count - index)); 237 return v.SubVector(index, count); 238 }; 239 240 if (val.IsScalar && sFunc != null) return new EvaluationResult(sFunc(val.Scalar)); 241 if (val.IsVector && vFunc != null) return new EvaluationResult(vFunc(SubVector(val.Vector))); 242 return EvaluationResult.NaN; 243 } 223 244 private static EvaluationResult AggregateMultipleApply(EvaluationResult lhs, EvaluationResult rhs, 224 245 Func<double, double, double> ssFunc = null, … … 360 381 case OpCodes.Sum: { 361 382 var cur = Evaluate(dataset, ref row, state); 362 return AggregateApply(cur, 383 return AggregateApply(cur, (WindowedSymbolTreeNode)currentInstr.dynamicNode, 363 384 s => s, 364 385 v => v.Sum()); -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/Sum.cs
r17466 r17573 28 28 [StorableType("C6C245BF-C44A-4207-A268-55641483F27F")] 29 29 [Item("Sum", "Symbol that represents the sum function.")] 30 public sealed class Sum : Symbol {30 public sealed class Sum : WindowedSymbol { 31 31 private const int minimumArity = 1; 32 32 private const int maximumArity = 1; -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/WindowedSymbol.cs
r17551 r17573 21 21 22 22 using System; 23 using System.Collections.Generic;24 23 using HeuristicLab.Common; 25 24 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 26 25 using HEAL.Attic; 26 27 27 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 28 [StorableType(" F8A6AD96-28D9-4BEC-8392-8B7BA824B085")]29 public abstract class VariableBase : Symbol, IVariableSymbol {28 [StorableType("2E342E38-BE2F-4E49-A9C3-2E833B83FDBC")] 29 public abstract class WindowedSymbol : Symbol, IWindowedSymbol { 30 30 #region Properties 31 31 [Storable] 32 private double weightMu;33 public double WeightMu{34 get { return weightMu; }32 private bool enableWindowing; 33 public bool EnableWindowing { 34 get { return enableWindowing; } 35 35 set { 36 if (value != weightMu) { 37 weightMu = value; 36 if (value != enableWindowing) { 37 enableWindowing = value; 38 OnChanged(EventArgs.Empty); 39 } 40 } 41 } 42 43 [Storable] 44 private double offsetMu; 45 public double OffsetMu { 46 get { return offsetMu; } 47 set { 48 if (value != offsetMu) { 49 offsetMu = value; 38 50 OnChanged(EventArgs.Empty); 39 51 } … … 41 53 } 42 54 [Storable] 43 private double weightSigma;44 public double WeightSigma {45 get { return weightSigma; }55 private double offsetSigma; 56 public double OffsetSigma { 57 get { return offsetSigma; } 46 58 set { 47 if ( weightSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");48 if (value != weightSigma) {49 weightSigma = value;59 if (offsetSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed."); 60 if (value != offsetSigma) { 61 offsetSigma = value; 50 62 OnChanged(EventArgs.Empty); 51 63 } … … 53 65 } 54 66 [Storable] 55 private double weightManipulatorMu;56 public double WeightManipulatorMu {57 get { return weightManipulatorMu; }67 private double lengthMu; 68 public double LengthMu { 69 get { return lengthMu; } 58 70 set { 59 if (value != weightManipulatorMu) {60 weightManipulatorMu = value;71 if (value != lengthMu) { 72 lengthMu = value; 61 73 OnChanged(EventArgs.Empty); 62 74 } … … 64 76 } 65 77 [Storable] 66 private double weightManipulatorSigma;67 public double WeightManipulatorSigma {68 get { return weightManipulatorSigma; }78 private double lengthSigma; 79 public double LengthSigma { 80 get { return lengthSigma; } 69 81 set { 70 if (weightManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed."); 71 if (value != weightManipulatorSigma) { 72 weightManipulatorSigma = value; 82 if (lengthSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed."); 83 if (value != lengthSigma) { 84 lengthSigma = value; 85 OnChanged(EventArgs.Empty); ; 86 } 87 } 88 } 89 90 [Storable] 91 private double manipulatorOffsetMu; 92 public double ManipulatorOffsetMu { 93 get { return manipulatorOffsetMu; } 94 set { 95 if (value != manipulatorOffsetMu) { 96 manipulatorOffsetMu = value; 73 97 OnChanged(EventArgs.Empty); 74 98 } 75 99 } 76 100 } 77 [Storable (DefaultValue = 0.0)]78 private double m ultiplicativeWeightManipulatorSigma;79 public double M ultiplicativeWeightManipulatorSigma {80 get { return m ultiplicativeWeightManipulatorSigma; }101 [Storable] 102 private double manipulatorOffsetSigma; 103 public double ManipulatorOffsetSigma { 104 get { return manipulatorOffsetSigma; } 81 105 set { 82 if (m ultiplicativeWeightManipulatorSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed.");83 if (value != m ultiplicativeWeightManipulatorSigma) {84 m ultiplicativeWeightManipulatorSigma = value;106 if (manipulatorOffsetSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed."); 107 if (value != manipulatorOffsetSigma) { 108 manipulatorOffsetSigma = value; 85 109 OnChanged(EventArgs.Empty); 86 110 } 87 111 } 88 112 } 89 90 [Storable(DefaultValue = 1.0)] 91 private double variableChangeProbability; 92 93 public double VariableChangeProbability { 94 get { return variableChangeProbability; } 113 [Storable] 114 private double manipulatorLengthMu; 115 public double ManipulatorLengthMu { 116 get { return manipulatorLengthMu; } 95 117 set { 96 if (value < 0 || value > 1.0) throw new ArgumentException("Variable change probability must lie in the interval [0..1]"); 97 variableChangeProbability = value; 118 if (value != manipulatorLengthMu) { 119 manipulatorLengthMu = value; 120 OnChanged(EventArgs.Empty); 121 } 98 122 } 99 123 } 100 101 private List<string> variableNames;102 124 [Storable] 103 public IEnumerable<string> VariableNames { 104 get { return variableNames; } 125 private double manipulatorLengthSigma; 126 public double ManipulatorLengthSigma { 127 get { return manipulatorLengthSigma; } 105 128 set { 106 if (value == null) throw new ArgumentNullException(); 107 variableNames.Clear(); 108 variableNames.AddRange(value); 109 OnChanged(EventArgs.Empty); 129 if (manipulatorLengthSigma < 0.0) throw new ArgumentException("Negative sigma is not allowed."); 130 if (value != manipulatorLengthSigma) { 131 manipulatorLengthSigma = value; 132 OnChanged(EventArgs.Empty);; 133 } 110 134 } 111 }112 113 private List<string> allVariableNames;114 [Storable]115 public IEnumerable<string> AllVariableNames {116 get { return allVariableNames; }117 set {118 if (value == null) throw new ArgumentNullException();119 allVariableNames.Clear();120 allVariableNames.AddRange(value);121 }122 }123 124 public override bool Enabled {125 get {126 if (variableNames.Count == 0) return false;127 return base.Enabled;128 }129 set {130 if (variableNames.Count == 0) base.Enabled = false;131 else base.Enabled = value;132 }133 }134 135 private const int minimumArity = 0;136 private const int maximumArity = 0;137 138 public override int MinimumArity {139 get { return minimumArity; }140 }141 public override int MaximumArity {142 get { return maximumArity; }143 135 } 144 136 #endregion 145 137 146 [StorableHook(HookType.AfterDeserialization)] 147 private void AfterDeserialization() { 148 if (allVariableNames == null || (allVariableNames.Count == 0 && variableNames.Count > 0)) { 149 allVariableNames = variableNames; 150 } 138 [StorableConstructor] 139 protected WindowedSymbol(StorableConstructorFlag _) : base(_) { 140 } 141 protected WindowedSymbol(WindowedSymbol original, Cloner cloner) 142 : base(original, cloner) { 143 enableWindowing = original.enableWindowing; 144 145 offsetMu = original.offsetMu; 146 offsetSigma = original.offsetSigma; 147 lengthMu = original.lengthMu; 148 lengthSigma = original.lengthSigma; 149 150 manipulatorOffsetMu = original.manipulatorOffsetMu; 151 manipulatorOffsetSigma = original.manipulatorOffsetSigma; 152 manipulatorLengthMu = original.manipulatorLengthMu; 153 manipulatorLengthSigma = original.manipulatorLengthSigma; 154 } 155 protected WindowedSymbol(string name, string description) 156 : base(name, description) { 157 enableWindowing = false; 158 159 offsetMu = 0.0; 160 offsetSigma = 0.05; 161 lengthMu = 1.0; 162 lengthSigma = 0.05; 163 164 manipulatorOffsetMu = 0.0; 165 manipulatorOffsetSigma = 0.05; 166 manipulatorLengthMu = 0.0; 167 manipulatorLengthSigma = 0.05; 151 168 } 152 169 153 [StorableConstructor] 154 protected VariableBase(StorableConstructorFlag _) : base(_) { 155 variableNames = new List<string>(); 156 allVariableNames = new List<string>(); 157 } 158 protected VariableBase(VariableBase original, Cloner cloner) 159 : base(original, cloner) { 160 weightMu = original.weightMu; 161 weightSigma = original.weightSigma; 162 variableNames = new List<string>(original.variableNames); 163 allVariableNames = new List<string>(original.allVariableNames); 164 weightManipulatorMu = original.weightManipulatorMu; 165 weightManipulatorSigma = original.weightManipulatorSigma; 166 multiplicativeWeightManipulatorSigma = original.multiplicativeWeightManipulatorSigma; 167 variableChangeProbability = original.variableChangeProbability; 168 } 169 protected VariableBase(string name, string description) 170 : base(name, description) { 171 weightMu = 1.0; 172 weightSigma = 1.0; 173 weightManipulatorMu = 0.0; 174 weightManipulatorSigma = 0.05; 175 multiplicativeWeightManipulatorSigma = 0.03; 176 variableChangeProbability = 0.2; 177 variableNames = new List<string>(); 178 allVariableNames = new List<string>(); 170 public override ISymbolicExpressionTreeNode CreateTreeNode() { 171 return new WindowedSymbolTreeNode(this); 179 172 } 180 173 } -
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Symbols/WindowedSymbolTreeNode.cs
r17551 r17573 20 20 #endregion 21 21 22 using System; 22 23 using HeuristicLab.Common; 23 24 using HeuristicLab.Core; … … 25 26 using HEAL.Attic; 26 27 using HeuristicLab.Random; 28 27 29 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 28 [StorableType(" B92EF904-18EC-41FC-9123-9B9293246815")]29 public abstract class VariableTreeNodeBase : SymbolicExpressionTreeTerminalNode, IVariableTreeNode {30 public new VariableBaseSymbol {31 get { return ( VariableBase)base.Symbol; }30 [StorableType("E79432BB-414D-4535-8751-D0139AF048E1")] 31 public class WindowedSymbolTreeNode : SymbolicExpressionTreeNode, IWindowedSymbolTreeNode { 32 public new WindowedSymbol Symbol { 33 get { return (WindowedSymbol)base.Symbol; } 32 34 } 33 35 [Storable] 34 private double weight;35 public double Weight {36 get { return weight; }37 set { weight = value; }36 private double offset; 37 public double Offset { 38 get { return offset; } 39 set { offset = Math.Min(Math.Max(value, 0.0), 1.0); } 38 40 } 39 41 [Storable] 40 private string variableName;41 public string VariableName{42 get { return variableName; }43 set { variableName = value; }42 private double length; 43 public double Length { 44 get { return length; } 45 set { length = Math.Min(Math.Max(value, 0.0), 1.0); } 44 46 } 45 47 46 48 [StorableConstructor] 47 protected VariableTreeNodeBase(StorableConstructorFlag _) : base(_) { }48 protected VariableTreeNodeBase(VariableTreeNodeBase original, Cloner cloner)49 protected WindowedSymbolTreeNode(StorableConstructorFlag _) : base(_) { } 50 protected WindowedSymbolTreeNode(WindowedSymbolTreeNode original, Cloner cloner) 49 51 : base(original, cloner) { 50 weight = original.weight;51 variableName = original.variableName;52 offset = original.offset; 53 length = original.length; 52 54 } 53 protected VariableTreeNodeBase() { } 54 protected VariableTreeNodeBase(VariableBase variableSymbol) : base(variableSymbol) { } 55 public override IDeepCloneable Clone(Cloner cloner) { 56 return new WindowedSymbolTreeNode(this, cloner); 57 } 58 59 public WindowedSymbolTreeNode(WindowedSymbol windowedSymbol) : base(windowedSymbol) { 60 if (!windowedSymbol.EnableWindowing) { 61 Offset = 0.0; 62 Length = 1.0; 63 } 64 } 55 65 56 66 public override bool HasLocalParameters { 57 get { return true; }67 get { return Symbol.EnableWindowing; } 58 68 } 59 69 60 70 public override void ResetLocalParameters(IRandom random) { 61 71 base.ResetLocalParameters(random); 62 weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightMu, Symbol.WeightSigma);63 72 64 #pragma warning disable 612, 618 65 variableName = Symbol.VariableNames.SelectRandom(random); 66 #pragma warning restore 612, 618 73 if (Symbol.EnableWindowing) { 74 Offset = NormalDistributedRandom.NextDouble(random, Symbol.OffsetMu, Symbol.OffsetSigma); 75 Length = NormalDistributedRandom.NextDouble(random, Symbol.LengthMu, Symbol.LengthSigma); 76 } 67 77 } 68 78 … … 70 80 base.ShakeLocalParameters(random, shakingFactor); 71 81 72 // 50% additive & 50% multiplicative (TODO: BUG in if statement below -> fix in HL 4.0!) 73 if (random.NextDouble() < 0) { 74 double x = NormalDistributedRandom.NextDouble(random, Symbol.WeightManipulatorMu, Symbol.WeightManipulatorSigma); 75 weight = weight + x * shakingFactor; 76 } else { 77 double x = NormalDistributedRandom.NextDouble(random, 1.0, Symbol.MultiplicativeWeightManipulatorSigma); 78 weight = weight * x; 79 } 80 81 if (Symbol.VariableChangeProbability >= 1.0) { 82 // old behaviour for backwards compatibility 83 #region Backwards compatible code, remove with 3.4 84 #pragma warning disable 612, 618 85 variableName = Symbol.VariableNames.SelectRandom(random); 86 #pragma warning restore 612, 618 87 #endregion 88 } else if (random.NextDouble() < Symbol.VariableChangeProbability) { 89 var oldName = variableName; 90 variableName = Symbol.VariableNames.SampleRandom(random); 91 if (oldName != variableName) { 92 // re-initialize weight if the variable is changed 93 weight = NormalDistributedRandom.NextDouble(random, Symbol.WeightMu, Symbol.WeightSigma); 94 } 82 if (Symbol.EnableWindowing) { 83 Offset += NormalDistributedRandom.NextDouble(random, Symbol.ManipulatorOffsetMu, Symbol.ManipulatorOffsetSigma) * shakingFactor; 84 Length += NormalDistributedRandom.NextDouble(random, Symbol.ManipulatorLengthMu, Symbol.ManipulatorLengthSigma) * shakingFactor; 95 85 } 96 86 } 97 87 98 88 public override string ToString() { 99 if (weight.IsAlmost(1.0)) return variableName; 100 else return weight.ToString("E4") + " " + variableName; 89 return Symbol.EnableWindowing 90 ? base.ToString() + $"[{Offset} : {Length}]" 91 : base.ToString(); 101 92 } 102 93 }
Note: See TracChangeset
for help on using the changeset viewer.