Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Algorithms.IteratedSentenceConstruction/HeuristicLab.Algorithms.IteratedSymbolicExpressionConstruction/3.3/StateFunctions/DefaultStateFunction.cs @ 12909

Last change on this file since 12909 was 12909, checked in by gkronber, 9 years ago

#2471: initial import of basic algorithm and framework (state value approximation not yet supported)

File size: 1.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using HeuristicLab.Common;
7using HeuristicLab.Core;
8using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
9using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
10
11namespace HeuristicLab.Algorithms.IteratedSymbolicExpressionConstruction {
12  // simply returns the concatenated actions (the full path of actions to the current decision represents the state)
13  [StorableClass]
14  [Item("DefaultStateFunction", "")]
15  internal class DefaultStateFunction : Item, IStateFunction {
16    public DefaultStateFunction()
17      : base() {
18    }
19
20    public object CreateState(ISymbolicExpressionTreeNode root, List<int> actions, ISymbolicExpressionTreeNode parentNode, int childIdx) {
21      return string.Join(",", actions);
22    }
23
24    #region item
25    [StorableConstructor]
26    protected DefaultStateFunction(bool deserializing) : base(deserializing) { }
27    protected DefaultStateFunction(DefaultStateFunction original, Cloner cloner)
28      : base(original, cloner) {
29    }
30    public override IDeepCloneable Clone(Cloner cloner) {
31      return new DefaultStateFunction(this, cloner);
32    }
33    #endregion
34
35  }
36}
Note: See TracBrowser for help on using the repository browser.