public ChordChainGeneticFunction(
            DiscreteNeuralNetworkByChord dnn,
            NGramGraphMarkovChain <Chord> chord,
            INGramWeightAssigner <Chord> assigner,
            ChordRandomFunctionType type = ChordRandomFunctionType.NoRandomSelection,
            ChordCrossFunctionType cross = ChordCrossFunctionType.DiscreteChoice)
        {
            dnn.NullCheck();
            chord.NullCheck();
            assigner.NullCheck();

            this.NeuralNetwork      = dnn;
            this.NGramGraph         = chord;
            this.RandomFunctionType = type;
            this.CrossFunctionType  = cross;
            this.ChordDepth         = this.NeuralNetwork.InputsCount * 2;
            this.NGramDepth         = 10;
            this.MutateCoefficient  = 0.05D;
            this.Assigner           = assigner;

            this.random = new Random();

            switch (type)
            {
            case ChordRandomFunctionType.AllowRandomSelection:
                this.RandomSelectionCoefficient = .05D;
                return;
            }
        }
        public NGramGraphChainRetriever(NGramGraphMarkovChain <T> a)
        {
            a.NullCheck();

            this.graph = a;
            this.NodeDepthBeforeGreedy = 100;
            this.Max = int.MaxValue;
        }
        public float Distance(NGramGraphMarkovChain <T> left, NGramGraphMarkovChain <T> right, NGramGraphDistanceType type = NGramGraphDistanceType.CompleteGraph)
        {
            left.NullCheck();
            right.NullCheck();

            switch (type)
            {
            case NGramGraphDistanceType.CompleteGraph:
                return((this.DistanceCompleteWithRespectToLeft(left, right) + this.DistanceCompleteWithRespectToLeft(right, left)) / 2F);

            case NGramGraphDistanceType.SubGraph:
                if (left.Count() > right.Count())
                {
                    return(this.DistanceCompleteWithRespectToLeft(right, left));
                }
                return(this.DistanceCompleteWithRespectToLeft(left, right));
            }
            throw new NotImplementedException();
        }
        public void LoadGraph(NGramGraphMarkovChain <T> graph)
        {
            graph.NullCheck();

            this.Graph = graph;
        }