Free cookie consent management tool by TermsFeed Policy Generator

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

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

#2665 Testet Problems, Testet error functions, Small fixes, Created HL files

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