Exemplo n.º 1
0
    def test_should_expand(self, cfg):
        # given
        cl_1 = Classifier(action=0, cfg=cfg)
        cl_2 = Classifier(action=1, numerosity=2, cfg=cfg)
        cl_3 = Classifier(action=2, numerosity=3, cfg=cfg)
        population = ClassifiersList(*[cl_1, cl_2, cl_3])

        # when
        expanded = population.expand()

        # then
        assert len(expanded) == 6
        assert cl_1 in expanded
        assert cl_2 in expanded
        assert cl_3 in expanded
Exemplo n.º 2
0
    def test_should_expand(self, cfg):
        # given
        population = ClassifiersList(cfg=cfg)
        c0 = Classifier(action=0, cfg=cfg)
        c1 = Classifier(action=1, numerosity=2, cfg=cfg)
        c2 = Classifier(action=2, numerosity=3, cfg=cfg)

        population.append(c0)
        population.append(c1)
        population.append(c2)

        # when
        expanded = population.expand()

        # then
        assert 6 == len(expanded)
        assert c0 in expanded
        assert c1 in expanded
        assert c2 in expanded