/// <summary>
        /// Construct with the specified maximum connection distance (optional/nullable) and flag indicating if local recurrent 
        /// connections should be generated when generating connections within a single node set (same source and target nodeset).
        /// </summary>
        public DefaultNodeSetMappingFunction(double? maximumConnectionDistance,  bool allowLocalRecurrentConnections)
        {
            _maximumConnectionDistance = maximumConnectionDistance;
            if(null != maximumConnectionDistance) {
                _maximumConnectionDistanceSquared = maximumConnectionDistance * maximumConnectionDistance;
            }
            _allowLocalRecurrentConnections = allowLocalRecurrentConnections;

            // Determine node test delegate to use. Using a delegate avoids having to do this test for each possible connection.
            if(null == maximumConnectionDistance) {
                _testNodePair = TestNodePair_NullTest;
            } else {
                _testNodePair = TestNodePair_MaxDistance;
            }
        }
Пример #2
0
        /// <summary>
        /// Construct with the specified maximum connection distance (optional/nullable) and flag indicating if local recurrent
        /// connections should be generated when generating connections within a single node set (same source and target nodeset).
        /// </summary>
        public DefaultNodeSetMappingFunction(double?maximumConnectionDistance, bool allowLocalRecurrentConnections)
        {
            _maximumConnectionDistance = maximumConnectionDistance;
            if (null != maximumConnectionDistance)
            {
                _maximumConnectionDistanceSquared = maximumConnectionDistance * maximumConnectionDistance;
            }
            _allowLocalRecurrentConnections = allowLocalRecurrentConnections;

            // Determine node test delegate to use. Using a delegate avoids having to do this test for each possible connection.
            if (null == maximumConnectionDistance)
            {
                _testNodePair = TestNodePair_NullTest;
            }
            else
            {
                _testNodePair = TestNodePair_MaxDistance;
            }
        }