integraal.services.concrete.InteGraal_KBChase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brunner-integraal Show documentation
Show all versions of brunner-integraal Show documentation
InteGraal module for the BRunner project
package integraal.services.concrete;
import org.slf4j.LoggerFactory;
import fr.boreal.component_builder.api.IAlgorithmParameters;
import fr.boreal.component_builder.api.IInputDataScenario;
import fr.boreal.component_builder.utils.ComponentPrinter;
import fr.boreal.forward_chaining.chase.Chase;
import integraal.services.AbstractInteGraalService;
import tools.service.CommonOps;
/**
* KBChase
*/
public class InteGraal_KBChase extends AbstractInteGraalService {
Chase chase;
/**
* @param ids input data scenario
* @param iap algorithm parameters
*/
public InteGraal_KBChase(IInputDataScenario ids, IAlgorithmParameters iap) {
super(ids, iap);
LOG = LoggerFactory.getLogger(InteGraal_KBChase.class);
}
public void prepareServiceSpecificOperations() {
setup(CommonOps.FACTBASE_LOADING, builder::trySetFactBase);
setup(CommonOps.RULE_LOADING, builder::trySetRuleBase);
setup(CommonOps.BUILD_CHASE, this::buildChase);
operation(CommonOps.EXECUTE_CHASE, this::executeChase);
}
private void buildChase() {
chase = builder.buildOrGetChase();
}
private void executeChase() {
chase.execute();
}
public void postProcessingTrial() {
ComponentPrinter.writeFactbaseSizeToLog(chase.getFactBase());
}
}