Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/10/13 15:15:13 (11 years ago)
Author:
sforsten
Message:

#1980:

  • added DecisionListView
  • added event handlers in *ProblemData
  • renamed project Problems.XCS.Views to Problems.lCS.Views and Problems.Instances.ConditionActionClassification to Problems.Instances.LCS
  • integrated niching in GAssist and added NichingTournamentSelector
  • minor code improvements and property changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/DecisionList.cs

    r9342 r9352  
    109109    #region IGAssistIndividual Members
    110110
     111    public IGAssistNiche Niche {
     112      get { return defaultAction; }
     113    }
     114
     115    public void SetNiche(IRandom random, IGAssistNiche niche) {
     116      var action = niche as IAction;
     117      if (action == null) {
     118        throw new ArgumentException("Niche has to be an action");
     119      }
     120      if (Niche != null) {
     121        throw new ArgumentException("Niche has already been set. It cannot be set again.");
     122      }
     123      defaultAction = action;
     124      var except = new List<IAction>() { action };
     125      foreach (var rule in rules.Where(x => x.Action.SameNiche(niche))) {
     126        rule.Action.Randomize(random, except);
     127      }
     128    }
     129
    111130    public void ApplySplit(IRandom random, double probability) {
    112131      foreach (var rule in rules) {
     
    126145      }
    127146    }
    128 
    129147    #endregion
    130148  }
Note: See TracChangeset for help on using the changeset viewer.