Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Attributes/PushExpressionAttriubte.cs @ 15032

Last change on this file since 15032 was 15032, checked in by pkimmesw, 7 years ago

#2665 Fixed bias 0 issue, PushExpressionFrequencyAnalyzer, Fixed probability for ERC settings, Fixed enable/disable instructions, Added expression descriptions

File size: 1.5 KB
Line 
1using System;
2
3namespace HeuristicLab.Problems.ProgramSynthesis.Push.Attributes {
4  using HeuristicLab.Problems.ProgramSynthesis.Push.Stack;
5
6  [AttributeUsage(AttributeTargets.Class)]
7  public class PushExpressionAttribute : Attribute {
8    public readonly StackTypes StackType;
9    public readonly StackTypes AdditionalStackDependencies;
10    public readonly string Name;
11    public readonly string Description;
12
13    /// <summary>
14    /// Determines if this expression manipulates the exec stack.
15    /// </summary>
16    public readonly bool ManipulatesExec;
17
18    /// <summary>
19    /// Determines the amount of items fetched form the EXEC stack required for this expression. Used for mapping individuals.
20    /// </summary>
21    public readonly uint ExecIn;
22
23    /// <summary>
24    /// Determines if the expression is visible to the user for configuration purposes.
25    /// </summary>
26    public readonly bool IsHidden;
27
28    public PushExpressionAttribute(
29      StackTypes stackType,
30      string name,
31      string description,
32      StackTypes additionalStackDependencies = default(StackTypes),
33      uint execIn = 0,
34      bool isHidden = false) {
35
36      StackType = stackType;
37      AdditionalStackDependencies = additionalStackDependencies;
38      Name = name;
39      Description = description;
40      ExecIn = execIn;
41      IsHidden = isHidden;
42      ManipulatesExec = stackType == StackTypes.Exec || AdditionalStackDependencies.HasFlag(StackTypes.Exec);
43    }
44  }
45}
Note: See TracBrowser for help on using the repository browser.