Class Nonogram


  • public class Nonogram
    extends ExampleFD
    It solves a nonogram example problem, sometimes also called Paint by Numbers.
    Version:
    4.8
    • Field Detail

      • black

        public int black
        The value that represents a black dot.
      • white

        public int white
        The value that represents a white dot.
      • board

        public IntVar[][] board
        A board to be painted in white/black dots.
      • slideDecomposition

        public boolean slideDecomposition
        It specifies if the slide based decomposition of the regular constraint should be applied. This decomposition uses ternary extensional support constraints. It achieves GAC if FSM is deterministic.
      • regular

        public boolean regular
        It specifies if the regular constraint should be used.
      • extensionalMDD

        public boolean extensionalMDD
        It specifies if one extensional constraint based on MDD created from FSM should be used. The translation process works if FSM is deterministic.
      • row_rules

        public int[][] row_rules
        It specifies a rule for each row.
      • col_rules

        public int[][] col_rules
        It specifies a rule for each column.
    • Constructor Detail

      • Nonogram

        public Nonogram()
    • Method Detail

      • readFromFile

        public void readFromFile​(java.lang.String filename)
      • createAutomaton

        public FSM createAutomaton​(int[] sequence)
        It produces and FSM given a sequence representing a rule. e.g. [2, 3] specifies that there are two black dots followed by three black dots.
        Parameters:
        sequence - a sequence representing a rule. e.g. [2, 3]
        Returns:
        Finite State Machine used by Regular automaton to enforce proper sequence.
      • model

        public void model()
        Description copied from class: ExampleFD
        It specifies a standard way of modeling the problem.
        Specified by:
        model in class ExampleFD
      • searchAll

        public boolean searchAll()
        It specifies simple search method based on most constrained static and lexigraphical ordering of values. It searches for all solutions.
        Returns:
        true if there is a solution, false otherwise.
      • printMatrix

        public void printMatrix​(IntVar[][] matrix)
        It prints a matrix of variables. All variables must be grounded.
        Parameters:
        matrix - matrix containing the grounded variables.
      • main

        public static void main​(java.lang.String[] args)
        It executes the program which solves this simple problem.
        Parameters:
        args - no arguments are read.
      • test

        public static void test​(java.lang.String[] args)
        It executes the program which solves this simple problem.
        Parameters:
        args - no arguments are read.