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/RealInsulineVariableTreeNode.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    [Storable]
     42    private double weight;
     43    public double Weight {
     44      get { return weight; }
     45      set { weight = value; }
     46    }
    4047    [StorableConstructor]
    4148    protected RealInsulineVariableTreeNode(bool deserializing) : base(deserializing) { }
     
    4350      : base(original, cloner) {
    4451      rowOffset = original.rowOffset;
     52      weight = original.weight;
    4553    }
    4654    protected RealInsulineVariableTreeNode() { }
     
    5462      base.ResetLocalParameters(random);
    5563      rowOffset = random.Next(Symbol.MinRowOffset, Symbol.MaxRowOffset + 1);
     64      weight = NormalDistributedRandom.NextDouble(random, 0, 10);
    5665    }
    5766
     
    6372      rowOffset = Math.Max(rowOffset, Symbol.MinRowOffset);
    6473      rowOffset = Math.Min(rowOffset, Symbol.MaxRowOffset);
     74      weight += NormalDistributedRandom.NextDouble(random, 0, 1.0 * shakingFactor);
    6575    }
    6676
     
    7080
    7181    public override string ToString() {
    72       return "realIns(k" + rowOffset + ")";
     82      return string.Format("{0:N3}*realIns(k{1})", weight, rowOffset);
    7383    }
    7484  }
Note: See TracChangeset for help on using the changeset viewer.