Class StratifiedChase<RW extends MaterializedData & Writable>
java.lang.Object
fr.inria.rules.integraal.forward_chaining.chase.metachase.stratified.StratifiedChase<RW>
- Type Parameters:
RW- the writable materialized data type processed by the chase
- All Implemented Interfaces:
ForwardChainingAlgorithm, Chase<RW>
public class StratifiedChase<RW extends MaterializedData & Writable>
extends Object
implements Chase<RW>
Chase implementation that executes successive strata of a rule base.
-
Constructor Summary
ConstructorsConstructorDescriptionStratifiedChase(ChaseBuilder<RW> builder, ChasableData<RW> chasableData, List<RuleBase> strata, Collection<HaltingCondition<RW>> halting_conditions, Collection<PreTreatment<RW>> global_preTreatments, Collection<PreTreatment<RW>> step_preTreatments, Collection<EndTreatment<RW>> global_end_treatments, Collection<EndTreatment<RW>> end_of_step_treatments) Creates a stratified chase from a configured builder and the resulting strata. -
Method Summary
Modifier and TypeMethodDescriptionvoidApply end of step treatments These are treatments to do at the end of each step of the chasevoidApply global end treatments These are treatments to do once at the end of the chasevoidApply global pretreatments These are treatments to do once at the beginning of the chasevoidApply pretreatments These are treatments to do at the beginning of each step of the chaseReturns the chased data structure.Returns a serializable description of this stratified chase state.Returns the result of the last applied chase step.Returns the rule base used by this chase.Returns the rule scheduler driving the chase.intReturns the current chase step number.booleanIndicates whether another chase step is available.voidnextStep()Apply the next step of this chasevoidsetRuleBase(RuleBase rb) Sets the rulebase of this chasetoString()
-
Constructor Details
-
StratifiedChase
public StratifiedChase(ChaseBuilder<RW> builder, ChasableData<RW> chasableData, List<RuleBase> strata, Collection<HaltingCondition<RW>> halting_conditions, Collection<PreTreatment<RW>> global_preTreatments, Collection<PreTreatment<RW>> step_preTreatments, Collection<EndTreatment<RW>> global_end_treatments, Collection<EndTreatment<RW>> end_of_step_treatments) Creates a stratified chase from a configured builder and the resulting strata.- Parameters:
builder- the builder used to create the per-stratum chaseschasableData- the chasable data to saturatestrata- the ordered strata to executehalting_conditions- the halting conditions shared across strataglobal_preTreatments- the treatments executed before the first stepstep_preTreatments- the treatments executed before each stratumglobal_end_treatments- the treatments executed after the final stepend_of_step_treatments- the treatments executed after each stratum
-
-
Method Details
-
hasNextStep
public boolean hasNextStep()Description copied from interface:ChaseIndicates whether another chase step is available.- Specified by:
hasNextStepin interfaceChase<RW extends MaterializedData & Writable>- Returns:
- true iff this chase has a next step
-
nextStep
-
applyGlobalPretreatments
public void applyGlobalPretreatments()Description copied from interface:ChaseApply global pretreatments These are treatments to do once at the beginning of the chase- Specified by:
applyGlobalPretreatmentsin interfaceChase<RW extends MaterializedData & Writable>
-
applyPretreatments
public void applyPretreatments()Description copied from interface:ChaseApply pretreatments These are treatments to do at the beginning of each step of the chase- Specified by:
applyPretreatmentsin interfaceChase<RW extends MaterializedData & Writable>
-
applyEndOfStepTreatments
public void applyEndOfStepTreatments()Description copied from interface:ChaseApply end of step treatments These are treatments to do at the end of each step of the chase- Specified by:
applyEndOfStepTreatmentsin interfaceChase<RW extends MaterializedData & Writable>
-
applyGlobalEndTreatments
public void applyGlobalEndTreatments()Description copied from interface:ChaseApply global end treatments These are treatments to do once at the end of the chase- Specified by:
applyGlobalEndTreatmentsin interfaceChase<RW extends MaterializedData & Writable>
-
getChasableData
Description copied from interface:ChaseReturns the chased data structure.- Specified by:
getChasableDatain interfaceChase<RW extends MaterializedData & Writable>- Returns:
- the ChasableData of this chase
-
getRuleBase
Description copied from interface:ChaseReturns the rule base used by this chase.- Specified by:
getRuleBasein interfaceChase<RW extends MaterializedData & Writable>- Returns:
- the rulebase of this chase
-
setRuleBase
Description copied from interface:ChaseSets the rulebase of this chase- Specified by:
setRuleBasein interfaceChase<RW extends MaterializedData & Writable>- Parameters:
rb- the new rulebase
-
getLastStepResults
Description copied from interface:ChaseReturns the result of the last applied chase step.- Specified by:
getLastStepResultsin interfaceChase<RW extends MaterializedData & Writable>- Returns:
- the result of the last step of this chase
-
getRuleScheduler
Description copied from interface:ChaseReturns the rule scheduler driving the chase.- Specified by:
getRuleSchedulerin interfaceChase<RW extends MaterializedData & Writable>- Returns:
- the rule scheduler of this chase
-
getStepCount
public int getStepCount()Description copied from interface:ChaseReturns the current chase step number.- Specified by:
getStepCountin interfaceChase<RW extends MaterializedData & Writable>- Returns:
- the number of the current step
-
toString
-
getDescription
Returns a serializable description of this stratified chase state.- Specified by:
getDescriptionin interfaceChase<RW extends MaterializedData & Writable>- Returns:
- the current chase description
-