Interface IOutputFactory

  • All Superinterfaces:
    ISelf<Solver>
    All Known Implementing Classes:
    Solver

    public interface IOutputFactory
    extends ISelf<Solver>
    This aims at simplifying resolution trace output by providing a unique entry point for most (not to say all) resolution message.
    Since:
    12/11/14
    Version:
    choco
    Author:
    Charles Prud'homme
    • Method Detail

      • setOut

        void setOut​(PrintStream printStream)
        Set the current output stream (default is System.out)
        Parameters:
        printStream - a print stream
      • getOut

        PrintStream getOut()
        Returns:
        the current output stream (default is System.out)
      • setErr

        void setErr​(PrintStream printStream)
        Set the current error stream (default is System.err)
        Parameters:
        printStream - a print stream
      • getErr

        PrintStream getErr()
        Returns:
        the current error stream (default is System.err)
      • printVersion

        default void printVersion()
        Print the version message.
      • printFeatures

        default void printFeatures()
        Print (succint) features of the solver given in argument
      • printShortFeatures

        default void printShortFeatures()
        Print (succint) features of the solver given in argument in a single line.
      • printStatistics

        default void printStatistics()
        Print the resolution statistics.

        Recommended usage: to be called after the resolution step.

      • printShortStatistics

        default void printShortStatistics()
        Output the resolution statistics in a single line.

        Recommended usage: to be called after the resolution step.

      • printCSVStatistics

        default void printCSVStatistics()
        Output the resolution statistics in a comma-separated single line. The header is:
             solutionCount;buildingTime(sec);initTime(sec);initPropag(sec);totalTime(sec);objective;nodes;backtracks;fails;restarts;fineProp;coarseProp;
         
      • showStatistics

        default void showStatistics()
        Plug a search monitor which calls printVersion() and printStatistics() before closing the search.

        Recommended usage: to be called before the resolution step.

      • showShortStatistics

        default void showShortStatistics()
        Plug a search monitor which calls printShortStatistics() before closing the search.

        Recommended usage: to be called before the resolution step.

      • showShortStatisticsOnShutdown

        default void showShortStatisticsOnShutdown()
        Calls printShortStatistics() before the program ends (normally or not)? This adds a shutdown hook.

        Recommended usage: to be called before the resolution step.

      • showSolutions

        default void showSolutions​(IMessage message)
        Plug a search monitor which outputs message on each solution.

        Recommended usage: to be called before the resolution step.

        Parameters:
        message - the message to print.
      • showSolutions

        default void showSolutions()
        Plug a search monitor which outputs a message on each solution.

        Recommended usage: to be called before the resolution step.

        See Also:
        IOutputFactory.DefaultSolutionMessage
      • showDecisions

        default void showDecisions​(IMessage message)
        Plug a search monitor which outputs message on each decision.

        Recommended usage: to be called before the resolution step.

        Parameters:
        message - the message to print.
      • showDecisions

        default void showDecisions()
        Plug a search monitor which outputs a message on each decision.

        Recommended usage: to be called before the resolution step.

        See Also:
        IOutputFactory.DefaultSolutionMessage
      • showContradiction

        default void showContradiction()
        Plug a search monitor which outputs the contradictions thrown during the search.
      • showStatisticsDuringResolution

        default void showStatisticsDuringResolution​(long f)
        Plug a search monitor which prints a one-line statistics every f ms.
        Parameters:
        f - frequency, in millisecond
      • showDashboard

        default void showDashboard()
        Create and show a simple dashboard that render resolution statistics every 100 milliseconds.
      • showDashboard

        default void showDashboard​(long refresh)
        Create and show a simple dashboard that render resolution statistics every 'refresh' milliseconds. Note that a low refresh rate will slow down the entire process.
        Parameters:
        refresh - frequency rate, in milliseconds.
      • outputSearchTreeToGraphviz

        default Closeable outputSearchTreeToGraphviz​(String gvFilename)
        Populate a DOT file (gvFilename with search tree to be vizualized with Graphviz.
        Parameters:
        gvFilename - dot filename
        Returns:
        a Closeable object to be closed at the end of resolution
      • outputSearchTreeToGephi

        default Closeable outputSearchTreeToGephi​(String gexfFilename)
        Populate a GEXF file (gexfFilename with search tree to be vizualized with Gephi.
        Parameters:
        gexfFilename - dot filename
        Returns:
        a Closeable object to be closed at the end of resolution
      • outputSearchTreeToCPProfiler

        default Closeable outputSearchTreeToCPProfiler​(boolean domain)
        Plug cp-profiler instance to this.
        Parameters:
        domain - set to true to send variables' domain on each node, false otherwise.
        Returns:
        a Closeable object to be closed at the end of resolution
      • constraintNetworkToGephi

        default void constraintNetworkToGephi​(String gexfFilename)
        Populate a GEXF file (gexfFilename with constraint netwok to be vizualized with Gephi.
        Parameters:
        gexfFilename - dot filename
      • printDistanceMatrix

        default void printDistanceMatrix​(List<Solution> solutions,
                                         int p)
        Compute and print the distance matrix of integer solutions. The Minkowski's p-distance is used
        Parameters:
        solutions - list of solutions
        p - parameter p of p-distance (set to 2 for euclidean distance)
      • printDifferenceMatrix

        default void printDifferenceMatrix​(List<Solution> solutions)
                                    throws IOException
        Compute and print the distance matrix of integer solutions. The Minkowski's p-distance is used
        Parameters:
        solutions - list of solutions
        Throws:
        IOException