TemporalNetworksTest.ExampleData.GetTestNetwork3 C# (CSharp) Method

GetTestNetwork3() public static method

Returns a test network suitable for testing the AggregateWindow method
public static GetTestNetwork3 ( ) : TemporalNetwork
return TemporalNetwork
        public static TemporalNetwork GetTestNetwork3()
        {
            TemporalNetwork temporal_net = new TemporalNetwork();

            temporal_net.AddTemporalEdge(1, "a", "b");
            temporal_net.AddTemporalEdge(2, "a", "c");

            temporal_net.AddTemporalEdge(7, "c", "e");
            temporal_net.AddTemporalEdge(8, "c", "g");
            temporal_net.AddTemporalEdge(9, "g", "f");
            temporal_net.AddTemporalEdge(10, "f", "h");

            return temporal_net;
        }

Usage Example

Example #1
0
        public void AbsoluteTimeTest()
        {
            TemporalNetwork test = ExampleData.GetTestNetwork3();

            // Default behavior is relative time
            test.ReduceToTwoPaths();

            Assert.IsTrue(test.TwoPathWeights.ContainsKey("a,c,e") && test.TwoPathWeights["a,c,e"] == 1);

            test = ExampleData.GetTestNetwork3();
            test.ReduceToTwoPaths(false, true);

            Assert.IsFalse(test.TwoPathWeights.ContainsKey("a,c,e"));
        }
All Usage Examples Of TemporalNetworksTest.ExampleData::GetTestNetwork3