Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/08/13 14:12:00 (12 years ago)
Author:
sforsten
Message:

#1980:

  • added ProportionalTournamentSelector for XCS
  • fixed bug: if an initial population is created in XCS, the initial population also creates general classifier, not only specific ones
  • merged r9204:9466 HeuristicLab.Core from trunk to branch
Location:
branches/LearningClassifierSystems
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems

  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/DoubleVariable.cs

    r9392 r9467  
    112112    }
    113113
    114     // Important! If this mehtod is called instead of the more concrete "Randomize(IRandom random, double spreadPercentage)"
    115     // spread percentage is 50%
    116     public override void Randomize(IRandom random) {
    117       Randomize(random, 50);
     114    // this method is not implemented on purpose, because it may lead to confusion or errors if the wrong parameter would be used (changeSymbolProbability instead of spreadPercentage)
     115    public override void Randomize(IRandom random, double changeSymbolProbability) {
     116      throw new NotImplementedException("The method DoubleVariable.Randomize(IRandom, double) should not be used. Use DoubleVariable.Randomize(IRandom, double, double) instead.");
    118117    }
    119118
    120     public void Randomize(IRandom random, double spreadPercentage) {
     119    // changeSymbolProbability is not used on purpose
     120    public void Randomize(IRandom random, double changeSymbolProbability, double spreadPercentage) {
    121121      if (spreadPercentage < 0 || spreadPercentage > 100) {
    122122        throw new ArgumentException("Spread percentage has to be between 0 and 100.");
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/IActionVariable.cs

    r9226 r9467  
    2121
    2222using System.Collections.Generic;
     23using HeuristicLab.Core;
    2324
    2425namespace HeuristicLab.Encodings.VariableVector {
     
    3031    void SetTo(string value);
    3132    IEnumerable<string> GetAllPossibleActions();
     33
     34    void RandomizeAction(IRandom random);
    3235  }
    3336}
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/IVariable.cs

    r9242 r9467  
    3333    IVariable GetSetCopy();
    3434
    35     void Randomize(IRandom random);
     35    void Randomize(IRandom random, double changeSymbolProbability);
    3636    bool MatchInput(string target);
    3737    bool MatchVariable(IVariable target);
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/IntVariable.cs

    r9392 r9467  
    122122    }
    123123
    124     public override void Randomize(IRandom random) {
     124    public void RandomizeAction(IRandom random) {
     125      int index = random.Next(possibleFeatures.Count());
     126      currentValue = possibleFeatures.ElementAt(index);
     127    }
     128
     129    public override void Randomize(IRandom random, double changeSymbolProbability) {
     130      Wildcard = random.NextDouble() < changeSymbolProbability;
    125131      int index = random.Next(possibleFeatures.Count());
    126132      currentValue = possibleFeatures.ElementAt(index);
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/StringVariable.cs

    r9392 r9467  
    167167    }
    168168
    169     public override void Randomize(IRandom random) {
     169    public void RandomizeAction(IRandom random) {
     170      int index = random.Next(possibleFeatures.Count());
     171      currentValue = possibleFeatures.ElementAt(index);
     172    }
     173
     174    public override void Randomize(IRandom random, double changeSymbolProbability) {
     175      Wildcard = random.NextDouble() < changeSymbolProbability;
    170176      int index = random.Next(possibleFeatures.Count());
    171177      currentValue = possibleFeatures.ElementAt(index);
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.VariableVector/3.3/Variable/Variable.cs

    r9242 r9467  
    5555    public abstract IVariable GetSetCopy();
    5656
    57     public abstract void Randomize(IRandom random);
     57    public abstract void Randomize(IRandom random, double changeSymbolProbability);
    5858
    5959    public virtual bool MatchVariable(IVariable target) { throw new NotSupportedException("This method is not supported by this kind of Variable."); }
Note: See TracChangeset for help on using the changeset viewer.