コード例 #1
0
ファイル: GraphTypeHelpers.cs プロジェクト: AP-Hunt/Evolve2
        public static void AdvancedBurst()
        {
            //The generic burst takes a vertex factory, edge factory and identity provider.
            //Pass the default implementation of any parameters you want default behaviour for
            //The factory and identity provider implementations must match the identity type of the chain (eg Guid)
            Burst <Guid> burstHelper = new Burst <Guid>(new StatefulVertexFactory <VertexState>(new EnumState(VertexState.HEALTHY)),
                                                        new DefaultEdgeFactory(),
                                                        new DefaultIdentityProvider());

            //The identity type must be specified because type inference can't help here
            BurstInfo <Guid> burst = burstHelper.Create(10, false);

            //The graph representing the clique is the Graph property
            Graph <Guid> burstGraph = burst.Graph;
        }
コード例 #2
0
ファイル: GraphTypeHelpers.cs プロジェクト: AP-Hunt/Evolve2
        public static void BaiscBurst()
        {
            //The non-generic burst is an implementation of Burst<Guid>
            //which uses DefaultVertexFactory, DefaultEdgeFactory and DefaultIdentityProvider
            Burst burstHelper = new Burst();

            //The identity type must be specified because type inference can't help here
            BurstInfo <Guid> burst = burstHelper.Create(10, false);

            //Can get the vertex at the centre of the burst from the CentreVertex property
            Vertex <Guid> centreVertex = burst.CentreVertex;

            //Can get the graph representing the chain from the Graph property
            Graph <Guid> burstGraph = burst.Graph;
        }