Exemplo n.º 1
0
    def test_landscape_data(self):
        net = ECA(30, size=5)
        data_before_setup = net.landscape_data
        self.assertEqual(data_before_setup.__dict__, {})

        data_after_setup = net.landscape().landscape_data
        self.assertEqual(data_before_setup.__dict__, {})
        self.assertEqual(
            list(data_after_setup.__dict__.keys()), ['transitions'])

        data_after_expound = net.expound().landscape_data
        self.assertEqual(data_before_setup.__dict__, {})
        self.assertEqual(set(data_after_setup.__dict__.keys()), set([
            "transitions",
            "basins",
            "basin_sizes",
            "attractors",
            "attractor_lengths",
            "in_degrees",
            "heights",
            "recurrence_times",
            "basin_entropy"
        ]))
        self.assertEqual(set(data_after_expound.__dict__.keys()), set([
            "transitions",
            "basins",
            "basin_sizes",
            "attractors",
            "attractor_lengths",
            "in_degrees",
            "heights",
            "recurrence_times",
            "basin_entropy"
        ]))
Exemplo n.º 2
0
 def test_expound(self):
     net = ECA(30, size=5)
     before = net.landscape_data
     after = net.expound().landscape_data
     self.assertEqual(before.__dict__, {})
     self.assertEqual(set(after.__dict__.keys()), set([
         "transitions",
         "basins",
         "basin_sizes",
         "attractors",
         "attractor_lengths",
         "in_degrees",
         "heights",
         "recurrence_times",
         "basin_entropy"
     ]))