Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode/Symbols/Numerical Expressions/ShotPowerTreeNode.cs @ 9760

Last change on this file since 9760 was 9565, checked in by melkaref, 12 years ago

Robocode Plugin code without Mutation Operators

File size: 1.3 KB
Line 
1using System;
2using HeuristicLab.Common;
3using HeuristicLab.Core;
4using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
5using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
6
7namespace HeuristicLab.Problems.Robocode
8{
9    [StorableClass]
10    public class ShotPowerTreeNode : SymbolicExpressionTreeTerminalNode
11    {
12        private double value;
13        [Storable]
14        public double Value
15        {
16            get { return value; }
17            private set { this.value = value; }
18        }
19
20        [StorableConstructor]
21        private ShotPowerTreeNode(bool deserializing) : base(deserializing) { }
22        private ShotPowerTreeNode(ShotPowerTreeNode original, Cloner cloner)
23            : base(original, cloner)
24        {
25            this.value = original.value;
26        }
27
28        public ShotPowerTreeNode()
29            : base(new ShotPower())
30        {
31        }
32
33        public override IDeepCloneable Clone(Cloner cloner)
34        {
35            return new ShotPowerTreeNode(this, cloner);
36        }
37
38        public override bool HasLocalParameters
39        {
40            get { return true; }
41        }
42
43        public override void ResetLocalParameters(IRandom random)
44        {
45            value = (double)random.Next(1, 3);
46        }
47    }
48}
Note: See TracBrowser for help on using the repository browser.