Search in sources :

Example 1 with Literals

use of at.ac.tuwien.kr.alpha.core.atoms.Literals in project Alpha by alpha-asp.

the class HeuristicTestUtils method addNoGoods.

static void addNoGoods(AtomStore atomStore, WritableAssignment assignment, NoGoodStoreAlphaRoaming noGoodStore, VSIDS vsids, NoGood... noGoods) {
    int numberOfAtoms = Arrays.stream(noGoods).flatMapToInt(NoGood::stream).map(Literals::atomOf).max().getAsInt();
    TestUtils.fillAtomStore(atomStore, numberOfAtoms);
    assignment.growForMaxAtomId();
    noGoodStore.growForMaxAtomId(numberOfAtoms);
    vsids.growForMaxAtomId(numberOfAtoms);
    Collection<NoGood> setOfNoGoods = new HashSet<>();
    int noGoodId = 1;
    for (NoGood noGood : noGoods) {
        setOfNoGoods.add(noGood);
        noGoodStore.add(noGoodId++, noGood);
    }
    vsids.heapOfActiveAtoms.newNoGoods(setOfNoGoods);
}
Also used : NoGood(at.ac.tuwien.kr.alpha.core.common.NoGood) Literals(at.ac.tuwien.kr.alpha.core.atoms.Literals) HashSet(java.util.HashSet)

Aggregations

Literals (at.ac.tuwien.kr.alpha.core.atoms.Literals)1 NoGood (at.ac.tuwien.kr.alpha.core.common.NoGood)1 HashSet (java.util.HashSet)1