Search in sources :

Example 1 with HomomorphismIteratorChecker

use of fr.lirmm.graphik.graal.homomorphism.utils.HomomorphismIteratorChecker in project graal by graphik-team.

the class NoForwardChecking method getCandidatsIterator.

@Override
public CloseableIterator<Term> getCandidatsIterator(AtomSet g, Var var, Substitution initialSubstitution, Map<Variable, Integer> map, Var[] varData, RulesCompilation rc) throws BacktrackException {
    HomomorphismIteratorChecker tmp;
    try {
        tmp = new HomomorphismIteratorChecker(var, g.termsIterator(), var.shared.preAtoms, g, initialSubstitution, map, varData, rc);
    } catch (AtomSetException e) {
        throw new BacktrackException(e);
    }
    tmp.setProfiler(this.getProfiler());
    return tmp;
}
Also used : AtomSetException(fr.lirmm.graphik.graal.api.core.AtomSetException) HomomorphismIteratorChecker(fr.lirmm.graphik.graal.homomorphism.utils.HomomorphismIteratorChecker) BacktrackException(fr.lirmm.graphik.graal.homomorphism.BacktrackException)

Example 2 with HomomorphismIteratorChecker

use of fr.lirmm.graphik.graal.homomorphism.utils.HomomorphismIteratorChecker in project graal by graphik-team.

the class AbstractNFC method getCandidatsIterator.

@Override
public CloseableIterator<Term> getCandidatsIterator(AtomSet g, Var var, Substitution initialSubstitution, Map<Variable, Integer> map, Var[] varData, RulesCompilation rc) throws BacktrackException {
    HomomorphismIteratorChecker tmp;
    if (this.data[var.shared.level].last.init) {
        tmp = new HomomorphismIteratorChecker(var, new CloseableIteratorAdapter<Term>(this.data[var.shared.level].last.candidats.iterator()), this.data[var.shared.level].toCheckAfterAssignment, g, initialSubstitution, map, varData, rc);
    } else {
        try {
            tmp = new HomomorphismIteratorChecker(var, g.termsIterator(), var.shared.preAtoms, g, initialSubstitution, map, varData, rc);
        } catch (AtomSetException e) {
            throw new BacktrackException(e);
        }
    }
    tmp.setProfiler(this.getProfiler());
    return tmp;
}
Also used : AtomSetException(fr.lirmm.graphik.graal.api.core.AtomSetException) HomomorphismIteratorChecker(fr.lirmm.graphik.graal.homomorphism.utils.HomomorphismIteratorChecker) CloseableIteratorAdapter(fr.lirmm.graphik.util.stream.CloseableIteratorAdapter) BacktrackException(fr.lirmm.graphik.graal.homomorphism.BacktrackException)

Example 3 with HomomorphismIteratorChecker

use of fr.lirmm.graphik.graal.homomorphism.utils.HomomorphismIteratorChecker in project graal by graphik-team.

the class NFC2WithLimit method getCandidatsIterator.

@Override
public CloseableIterator<Term> getCandidatsIterator(AtomSet g, Var var, Substitution initialSubstitution, Map<Variable, Integer> map, Var[] varData, RulesCompilation rc) throws BacktrackException {
    HomomorphismIteratorChecker tmp;
    if (this.data[var.shared.level].last.init) {
        this.dataWithLimit[var.shared.level].atomsToCheck.addAll(this.data[var.shared.level].toCheckAfterAssignment);
        tmp = new HomomorphismIteratorChecker(var, new CloseableIteratorAdapter<Term>(this.data[var.shared.level].last.candidats.iterator()), this.dataWithLimit[var.shared.level].atomsToCheck, g, initialSubstitution, map, varData, rc);
    } else {
        try {
            tmp = new HomomorphismIteratorChecker(var, g.termsIterator(), var.shared.preAtoms, g, initialSubstitution, map, varData, rc);
        } catch (AtomSetException e) {
            throw new BacktrackException(e);
        }
    }
    tmp.setProfiler(this.getProfiler());
    return tmp;
}
Also used : AtomSetException(fr.lirmm.graphik.graal.api.core.AtomSetException) HomomorphismIteratorChecker(fr.lirmm.graphik.graal.homomorphism.utils.HomomorphismIteratorChecker) CloseableIteratorAdapter(fr.lirmm.graphik.util.stream.CloseableIteratorAdapter) BacktrackException(fr.lirmm.graphik.graal.homomorphism.BacktrackException)

Example 4 with HomomorphismIteratorChecker

use of fr.lirmm.graphik.graal.homomorphism.utils.HomomorphismIteratorChecker in project graal by graphik-team.

the class SimpleFC method getCandidatsIterator.

@Override
public CloseableIterator<Term> getCandidatsIterator(AtomSet g, Var var, Substitution initialSubstitution, Map<Variable, Integer> map, Var[] varData, RulesCompilation rc) throws BacktrackException {
    HomomorphismIteratorChecker tmp;
    try {
        tmp = new HomomorphismIteratorChecker(var, g.termsIterator(), var.shared.preAtoms, g, initialSubstitution, map, varData, rc);
    } catch (AtomSetException e) {
        throw new BacktrackException(e);
    }
    tmp.setProfiler(this.getProfiler());
    return tmp;
}
Also used : AtomSetException(fr.lirmm.graphik.graal.api.core.AtomSetException) HomomorphismIteratorChecker(fr.lirmm.graphik.graal.homomorphism.utils.HomomorphismIteratorChecker) BacktrackException(fr.lirmm.graphik.graal.homomorphism.BacktrackException)

Aggregations

AtomSetException (fr.lirmm.graphik.graal.api.core.AtomSetException)4 BacktrackException (fr.lirmm.graphik.graal.homomorphism.BacktrackException)4 HomomorphismIteratorChecker (fr.lirmm.graphik.graal.homomorphism.utils.HomomorphismIteratorChecker)4 CloseableIteratorAdapter (fr.lirmm.graphik.util.stream.CloseableIteratorAdapter)2