Esempio n. 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);
        }
Esempio n. 2
0
        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;
        }
Esempio n. 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);
        }