Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/13 13:31:29 (11 years ago)
Author:
sforsten
Message:

#1980:

  • several small bug fixes
  • added windowing technique ILAS to GAssist
  • GAssist and XCS work now with real-valued features
  • severely improved the performance of XCS
Location:
branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3
Files:
2 edited

Legend:

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

    • Property svn:ignore
      •  

        old new  
        11*.user
        22Plugin.cs
         3obj
  • branches/LearningClassifierSystems/HeuristicLab.Encodings.DecisionList/3.3/DecisionList.cs

    r9352 r9392  
    8080
    8181    // for convenience
    82     public IEnumerable<IAction> Evaluate(IEnumerable<DecisionListInput> input) {
    83       int numberOfAliveRules;
    84       return Evaluate(input, out numberOfAliveRules);
     82    public IEnumerable<IAction> Evaluate(IEnumerable<IGAssistInput> input) {
     83      ItemSet<Rule> aliveRules;
     84      return Evaluate(input, out aliveRules);
    8585    }
    8686    // for convenience
    87     public IEnumerable<IAction> Evaluate(IEnumerable<DecisionListInput> input, out int numberOfAliveRules) {
     87    public IEnumerable<IAction> Evaluate(IEnumerable<IGAssistInput> input, out ItemSet<Rule> aliveRules) {
    8888      double theoryLengtgh;
    89       return Evaluate(input, out numberOfAliveRules, out theoryLengtgh);
     89      return Evaluate(input, out aliveRules, out theoryLengtgh);
    9090    }
    91     public IEnumerable<IAction> Evaluate(IEnumerable<DecisionListInput> input, out int numberOfAliveRules, out double theoryLengtgh) {
     91    public IEnumerable<IAction> Evaluate(IEnumerable<IGAssistInput> input, out ItemSet<Rule> aliveRules, out double theoryLength) {
    9292      var estimated = new List<IAction>();
    93       var activatedRules = new HashSet<Rule>();
     93      var activatedRules = new ItemSet<Rule>();
     94      int count = 0;
    9495      foreach (var dli in input) {
     96        count++;
    9597        foreach (var rule in rules) {
    9698          if (rule.MatchInput(dli)) {
     
    100102          }
    101103        }
     104        if (count > estimated.Count) {
     105          estimated.Add(defaultAction);
     106        }
    102107      }
    103       numberOfAliveRules = activatedRules.Count;
    104       theoryLengtgh = activatedRules.Sum(x => x.ComputeTheoryLength());
     108      aliveRules = activatedRules;
     109      theoryLength = activatedRules.Sum(x => x.ComputeTheoryLength());
    105110
    106111      return estimated;
     112    }
     113
     114    public void RemoveRules(IEnumerable<Rule> deadRules) {
     115      foreach (var deadRule in deadRules) {
     116        Rules.Remove(deadRule);
     117      }
    107118    }
    108119
     
    145156      }
    146157    }
     158
     159    public IGAssistSolution CreateGAssistSolution(IGAssistNichesProblemData problemData) {
     160      return new DecisionListSolution(this, problemData);
     161    }
    147162    #endregion
    148163  }
Note: See TracChangeset for help on using the changeset viewer.