public static NodeTypeFrequencyProfile createProfile(IEnumerable <Node> allNodes, bool atLeastOneOfEach)
        {
            NodeTypeFrequencyProfile result = new NodeTypeFrequencyProfile();

            foreach (var node in allNodes)
            {
                result.increaseCount(node.type, 1);
            }

            if (atLeastOneOfEach)
            {
                result.addOneOfEach();
            }

            result.sortTypeByFrequencies();
            return(result);
        }
        /// <summary>
        /// Creates a frequency profile of occurence of nodes of specific types in given set of programs. If atLeastOneOfEach is set to true, frequency of all nodes will initially be set to one, which leads to non-zero probability of generating every type of node,
        /// even if it is never encountered in any of given programs. If it is set to false, initial frequencies will be set to zero and nodetypes that were never encountered in samples will never be generated.
        /// </summary>
        /// <param name="programs"></param>
        /// <param name="atLeastOneOfEach"></param>
        /// <returns></returns>
        public static NodeTypeFrequencyProfile createProfile(List <SolutionProgram> programs, bool atLeastOneOfEach)
        {
            NodeTypeFrequencyProfile result = new NodeTypeFrequencyProfile();

            foreach (var program in programs)
            {
                foreach (var node in program.getAllNodes())
                {
                    result.increaseCount(node.type, 1);
                }
            }
            if (atLeastOneOfEach)
            {
                result.addOneOfEach();
            }

            result.sortTypeByFrequencies();
            return(result);
        }