Last change
on this file since 14834 was
14834,
checked in by pkimmesw, 7 years ago
|
#2665 LexicaseSelector, Performance improvements, UI Fixes, Debugger only shows used stacks, fixed Debugger stepping, Added vector expressions, ERCOptions,
|
File size:
1.6 KB
|
Line | |
---|
1 | namespace HeuristicLab.Problems.ProgramSynthesis.Push.Erc {
|
---|
2 |
|
---|
3 | using HeuristicLab.Common;
|
---|
4 | using HeuristicLab.Core;
|
---|
5 | using HeuristicLab.Data;
|
---|
6 | using HeuristicLab.Parameters;
|
---|
7 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
8 | using HeuristicLab.Problems.ProgramSynthesis.Push.Erc.Interfaces;
|
---|
9 |
|
---|
10 | [StorableClass]
|
---|
11 | public class NameErcOptions : StringErcOptions, IReadOnlyNameErcOptions {
|
---|
12 | private const string NewNameProbabilityParameterName = "New name probability";
|
---|
13 |
|
---|
14 | public NameErcOptions() {
|
---|
15 | Parameters.Add(new FixedValueParameter<PercentValue>(NewNameProbabilityParameterName));
|
---|
16 | }
|
---|
17 |
|
---|
18 | [StorableConstructor]
|
---|
19 | public NameErcOptions(bool deserializing) : base(deserializing) { }
|
---|
20 |
|
---|
21 | public NameErcOptions(NameErcOptions origin, Cloner cloner) : base(origin, cloner) { }
|
---|
22 |
|
---|
23 | /// <summary>
|
---|
24 | /// The probability that the selection of the ephemeral
|
---|
25 | /// random NAME constant for inclusion in randomly generated code will produce a new name
|
---|
26 | /// (rather than a name that was previously generated).
|
---|
27 | /// </summary>
|
---|
28 | public IValueParameter<PercentValue> NewNameProbabilityParameter
|
---|
29 | {
|
---|
30 | get { return (IValueParameter<PercentValue>)Parameters[NewNameProbabilityParameterName]; }
|
---|
31 | }
|
---|
32 |
|
---|
33 | public double NewNameProbability
|
---|
34 | {
|
---|
35 | get { return NewNameProbabilityParameter.Value.Value; }
|
---|
36 | set { NewNameProbabilityParameter.Value.Value = value; }
|
---|
37 | }
|
---|
38 |
|
---|
39 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
40 | return new NameErcOptions(this, cloner);
|
---|
41 | }
|
---|
42 | }
|
---|
43 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.