Interface InterpretationProcessor<S>

  • Type Parameters:
    S - some class
    All Known Implementing Classes:
    SatMaximizeInterpretationProcessor, SatPartialKBipolarInterpretationProcessor

    public interface InterpretationProcessor<S>
    Performs further processing on interpretations, e.g. maximization.

    Note that sometimes it is necessary for processors to work on isolated states. Just consider a sat based maximization processor, which has to generate clauses to compute larger interpretations until we reach a maximum. Usually we do not want to pollute the shared state with these generated clauses, because it may cut off other solutions. In such cases we can tell the Pipeline to create a new state on which we perform the processing and which is only used by this processor.

    As a consequence the implementation of the process method must not rely on the fact that its state updates are seen be subsequent processors. Final updates on the shared state must therefore be performed in the updateState method, which is guaranteed to get the shared state.

    Author:
    Mathias Hofer
    • Method Detail

      • process

        Interpretation process​(S state,
                               Interpretation interpretation,
                               AbstractDialecticalFramework adf)
        Performs the processing of the given interpretation on a potential isolated state, meaning that the updates on this state are not seen by the subsequent processors. If the given state is isolated or shared by the other processors depends on the configuration of the Pipeline and hence by the user.

        Necessary updates on the shared state have to be performed in the updateState method, which is called by the pipeline after the processing is done.

        Parameters:
        state - a potentially isolated state or the shared one
        interpretation - the result of the previous processor
        adf - the corresponding adf
        Returns:
        an interpretation
      • updateState

        void updateState​(S state,
                         Interpretation processed,
                         AbstractDialecticalFramework adf)
        This method is called by the Pipeline on the shared state and the result of the process method, hence after the processing is done.

        Note that if this processor has to update the shared state, it has to happen in this method. Since process may only have access to an isolated state to perform its processing.

        Parameters:
        state - the shared state
        processed - the result of the process method
        adf - the corresponding adf