Package org.processmining.specpp.base
Interface Composer<C extends Candidate,I extends Composition<C>,R extends Result>
-
- Type Parameters:
C- type of candidates that this composer handlesI- type of intermediate result which is a composition of candidatesR- type of the final result that is generated from the intermediate result (composition)
- All Superinterfaces:
java.util.function.Consumer<C>
- All Known Subinterfaces:
ComposerComponent<C,I,R>,ConstrainingComposer<C,I,R,L>
- All Known Implementing Classes:
AbsoluteFitnessFilter,AbstractActivityActivationAwareFitnessFilter,AbstractComposer,AbstractConstrainingComposer,AbstractPostponingComposer,AbstractQueueingComposer,AcceptingComposer,AggregatedFitnessFilter,CachingFitnessFilter,CombinedFitnessFilter,ComposerDelevopmentEntryPoint,ConstrainingFilteringPlaceComposer,DeltaComposer,ETCBasedComposer,EventingAbsoluteFitnessFilter,EventingAggregatedFitnessFilter,EventingCombinedFitnessFilter,EventingPlaceComposerWithCIPR,EventingRelativeFitnessFilter,FilteringComposer,InstrumentedComposer,PlaceAccepter,PlaceComposerWithCIPR,RecursiveComposer,RelativeFitnessFilter,UniwiredComposer
public interface Composer<C extends Candidate,I extends Composition<C>,R extends Result> extends java.util.function.Consumer<C>Base interface for Composers. They function as Consumers as the pendant toProposers which are Suppliers. A composer maintains an internal collection of candidates. This intermediate state may be queried asynchronously viagetIntermediateResult()Candidates are offered to this class via theaccept(Candidate c)method. When (a) the candidate source (proposer) is exhausted, (b) or this composer signalsisFinished(), e.g. due to its internal composition being full, (c) or the computation is gracefully cancelled,candidatesAreExhausted()is called. At the end of the composer's lifecycle,generateResult()is called. The collection of candidates can be transformed, e.g. summarized, in this hook method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccept(C c)Hook method which decides how to handle an incoming candidate.voidcandidatesAreExhausted()Hook method which is called when this composer will not receive any more candidates in the future as the connected proposer has been exhausted.RgenerateResult()Hook method where a final result is computed from the incrementally built up intermediate result.IgetIntermediateResult()Typically just returns the internally managed composition.booleanisFinished()Whether this composer has reached a state where it does not want to handle new candidates.
-
-
-
Method Detail
-
isFinished
boolean isFinished()
Whether this composer has reached a state where it does not want to handle new candidates.- Returns:
- true iff no more candidates will be accepted
-
candidatesAreExhausted
void candidatesAreExhausted()
Hook method which is called when this composer will not receive any more candidates in the future as the connected proposer has been exhausted.
-
getIntermediateResult
I getIntermediateResult()
Typically just returns the internally managed composition. Care must be taken, that this method may be called asynchronously.- Returns:
- the intermediate result
-
generateResult
R generateResult()
Hook method where a final result is computed from the incrementally built up intermediate result.- Returns:
- the final result
-
accept
void accept(C c)
Hook method which decides how to handle an incoming candidate. The internal logic decides whether the candidate is eventually added to the current composition.
-
-