using System; using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; namespace HeuristicLab.Problems.Robocode { [StorableClass] public class ShotPowerTreeNode : SymbolicExpressionTreeTerminalNode { private double value; [Storable] public double Value { get { return value; } private set { this.value = value; } } [StorableConstructor] private ShotPowerTreeNode(bool deserializing) : base(deserializing) { } private ShotPowerTreeNode(ShotPowerTreeNode original, Cloner cloner) : base(original, cloner) { this.value = original.value; } public ShotPowerTreeNode() : base(new ShotPower()) { } public override IDeepCloneable Clone(Cloner cloner) { return new ShotPowerTreeNode(this, cloner); } public override bool HasLocalParameters { get { return true; } } public override void ResetLocalParameters(IRandom random) { value = (double)random.Next(1, 3); } } }