コード例 #1
0
        public void GetRandomGenerator_When_T_Is_ISymmetricMatrix()
        {
            //Arrange
            var provider = new NetworkToolProvider();

            //Act
            var factory = provider.GetRandomGenerator<ISymmetricMatrix<double>>();

            //Assert
            Assert.NotNull(factory);
            Assert.IsType<RandomGeneratorMatrix<double>>(factory);
        }
コード例 #2
0
ファイル: RandomNetworkGenFx.cs プロジェクト: BgRva/Blob1
        internal INetwork CreateNetwork(Guid id, IRandomNetGenParamMgr paramMgr)
        {
            INetwork net = null;
            using (var toolProvider = new NetworkToolProvider())
            {
                using (var rgg = toolProvider.GetRandomGenerator<IBasicAdjList>())
                {
                    rgg.NodeCount = paramMgr.NodeCount;
                    rgg.EdgeCount = paramMgr.EdgeCount;
                    rgg.IsDirected = paramMgr.IsDirected;
                    net = rgg.Generate(id);
                    net.Name = paramMgr.NetworkName;
                }
            }

            return net;
        }
コード例 #3
0
        public void GetRandomGenerator_When_T_Is_IBasicAdjList()
        {
            //Arrange
            var provider = new NetworkToolProvider();

            //Act
            var factory = provider.GetRandomGenerator<IBasicAdjList>();

            Assert.NotNull(factory);
            Assert.IsType<RandomGeneratorBasicAdjList>(factory);
        }