Free cookie consent management tool by TermsFeed Policy Generator

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

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

#2665 Started Plush Encoding, Added Zero Error Individual Count Analyzer

File size: 1.7 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    public readonly int? InExpressionNr;
13
14    /// <summary>
15    /// Determines if this expression manipulates the exec stack.
16    /// </summary>
17    public readonly bool ManipulatesExec;
18
19    /// <summary>
20    /// Determines the amount of items fetched form the EXEC stack required for this expression. Used for mapping individuals.
21    /// </summary>
22    public readonly uint ExecIn;
23
24    /// <summary>
25    /// Determines if the expression is visible to the user for configuration purposes.
26    /// </summary>
27    public readonly bool IsHidden;
28
29    public PushExpressionAttribute(
30      StackTypes stackType,
31      string name,
32      string description,
33      StackTypes additionalStackDependencies = default(StackTypes),
34      uint execIn = 0,
35      bool isHidden = false,
36      int inExpressionNr = -1) {
37
38      StackType = stackType;
39      AdditionalStackDependencies = additionalStackDependencies;
40      Name = name;
41      Description = description;
42      ExecIn = execIn;
43      IsHidden = isHidden;
44      InExpressionNr = inExpressionNr > 0 ? inExpressionNr : default(int?);
45      ManipulatesExec = stackType == StackTypes.Exec || AdditionalStackDependencies.HasFlag(StackTypes.Exec);
46    }
47
48    public bool IsInExpression { get { return this.InExpressionNr.HasValue; } }
49  }
50}
Note: See TracBrowser for help on using the repository browser.