Class Nonogram

java.lang.Object
org.jacop.examples.fd.ExampleFD
org.jacop.examples.fd.nonogram.Nonogram

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

    • 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 Details

    • Nonogram

      public Nonogram()
  • Method Details

    • readFromFile

      public void readFromFile(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(String[] args)
      It executes the program which solves this simple problem.
      Parameters:
      args - no arguments are read.
    • test

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