def test_should_form_match_set_backwards(self, cfg):
    population = ClassifiersList()
    situation = Perception('11110000')
    c1 = Classifier(cfg=cfg)
    c2 = Classifier(condition='0##0####', effect='1##1####', cfg=cfg)
    c3 = Classifier(condition='0###1###', effect='1######0', cfg=cfg)
    c4 = Classifier(condition='0###0###', effect='1###1###', cfg=cfg)
    population.append(c1)
    population.append(c2)
    population.append(c3)
    population.append(c4)
    match_set = ClassifiersList.form_match_set_backwards(population, situation)
    assert (2 == len(match_set))
    assert (c1 in match_set)
    assert (c2 in match_set)
def test_should_form_match_set_backwards(self, cfg):
    population = ClassifiersList()
    situation = Perception('11110000')
    c1 = Classifier(cfg=cfg)
    c2 = Classifier(condition='0##0####', effect='1##1####', cfg=cfg)
    c3 = Classifier(condition='0###1###', effect='1######0', cfg=cfg)
    c4 = Classifier(condition='0###0###', effect='1###1###', cfg=cfg)
    population.append(c1)
    population.append(c2)
    population.append(c3)
    population.append(c4)
    match_set = ClassifiersList.form_match_set_backwards(population, situation)
    assert (2 == len(match_set))
    assert (c1 in match_set)
    assert (c2 in match_set)