All Downloads are FREE. Search and download functionalities are using the official Maven repository.

integraal.services.concrete.InteGraal_KBChase Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
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());

	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy