Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/31/16 17:05:49 (8 years ago)
Author:
gkronber
Message:

#2608 worked on glucose prediction problem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GeneticProgramming.BloodGlucosePrediction/RealGlucoseVariableTreeNode.cs

    r13865 r13867  
    2525using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Random;
    2728
    2829namespace HeuristicLab.Problems.GeneticProgramming.GlucosePrediction {
     
    3839      set { rowOffset = value; }
    3940    }
     41
     42    [Storable]
     43    private double weight;
     44    public double Weight {
     45      get { return weight; }
     46      set { weight = value; }
     47    }
    4048    [StorableConstructor]
    4149    protected RealGlucoseVariableTreeNode(bool deserializing) : base(deserializing) { }
     
    4351      : base(original, cloner) {
    4452      rowOffset = original.rowOffset;
     53      weight = original.weight;
    4554    }
    4655    protected RealGlucoseVariableTreeNode() { }
     
    5463      base.ResetLocalParameters(random);
    5564      rowOffset = random.Next(Symbol.MinRowOffset, Symbol.MaxRowOffset + 1);
     65      weight = NormalDistributedRandom.NextDouble(random, 0, 10);
    5666    }
    5767
     
    6373      rowOffset = Math.Max(rowOffset, Symbol.MinRowOffset);
    6474      rowOffset = Math.Min(rowOffset, Symbol.MaxRowOffset);
     75      weight += NormalDistributedRandom.NextDouble(random, 0, 1.0 * shakingFactor);
    6576    }
    6677
     
    7081
    7182    public override string ToString() {
    72       return "realGluc(k" + rowOffset + ")";
     83      return string.Format("{0:N3} * realGluc(k{1})", weight, rowOffset);
    7384    }
    7485  }
Note: See TracChangeset for help on using the changeset viewer.