Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/18/13 21:33:56 (11 years ago)
Author:
gkronber
Message:

#2026 worked on brute force solver for GPDL problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.GPDL/HeuristicLab.Grammars/3.3/Sequence.cs

    r10063 r10067  
    2121
    2222using System.Collections.Generic;
     23using System.Collections.ObjectModel;
    2324using System.Linq;
    2425using System.Text;
    2526
    2627namespace HeuristicLab.Grammars {
    27   public class Sequence : List<ISymbol> {
    28     public Sequence()
    29       : base() {
    30     }
    31 
    32     public Sequence(IEnumerable<ISymbol> seq)
    33       : base() {
    34       this.AddRange(seq);
    35     }
    36     public IEnumerator<ISymbol> GetEnumerator() {
    37       return (IEnumerator<ISymbol>)base.GetEnumerator();
     28  public class Sequence : ReadOnlyCollection<ISymbol> {
     29    public Sequence(IList<ISymbol> seq)
     30      : base(seq) {
    3831    }
    3932
     
    5043
    5144    public override string ToString() {
    52       var b = new StringBuilder();
    53       ForEach(s => b.AppendFormat("{0} ", s));
    54       return b.ToString();
     45      return this.Aggregate("", (str, symb) => str + symb);
    5546    }
    5647  }
Note: See TracChangeset for help on using the changeset viewer.