Beispiel #1
0
 public bool Equals(MarkovChainNode other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(Links, other.Links) && Word == other.Word);
 }
        public static ChordProgression ChordProgression(Func <MarkovChainNode <Chord>, MarkovChainNode <Chord> > filterFunc)
        {
            var chords = new List <Chord>();
            var chain  = ChordProgressionLibrary.Chain;

            do
            {
                var chord = MarkovChainNode <Chord> .Choose(chain, filterFunc);

                if (chord != null)
                {
                    chords.Add(chord.Data);
                    chain = chord.ChildNodes;
                }
            } while (chain != null && chain.Count > 0);

            return(new ChordProgression(chords));
        }
Beispiel #3
0
 public void AddLink(MarkovChainNode toNode)
 {
     Links.Add(toNode);
 }