Class ExampleSet

java.lang.Object
org.jacop.examples.set.ExampleSet
Direct Known Subclasses:
Gardner, SocialGolfer, Steiner

public abstract class ExampleSet extends Object
It is an abstract class to describe all necessary functions of any store.
Version:
4.10
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    It specifies the cost function, null if no cost function is used.
    It specifies the search procedure used by a given example.
    It specifies the constraint store responsible for holding information about constraints and variables.
    It contains all variables used within a specific example.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    It returns the search used within an example.
    It returns an array list of variables used to model the example.
    It specifies the constraint store used within an example.
    abstract void
    It specifies a standard way of modeling the problem.
    static void
    printMatrix(IntVar[][] matrix, int rows, int cols)
    It prints a matrix of variables.
    boolean
    It specifies simple search method based on input order and lexigraphical ordering of values.
    boolean
    It specifies simple search method based on most constrained static and lexigraphical ordering of values.
    boolean
    It searches for all solutions with the optimal value.
    boolean
    searchMasterSlave(List<Var> masterVars, List<Var> slaveVars)
    It conducts master-slave search.
    boolean
    It specifies simple search method based variable order which takes into account the number of constraints attached to a variable and lexigraphical ordering of values.
    boolean
    It specifies simple search method based on input order and lexigraphical ordering of values.
    boolean
    searchSmallestDomain(boolean optimal)
    It specifies simple search method based on smallest domain variable order and lexigraphical ordering of values.
    boolean
    It specifies simple search method based on weighted degree variable order and lexigraphical ordering of values.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • vars

      public List<SetVar> vars
      It contains all variables used within a specific example.
    • cost

      public IntVar cost
      It specifies the cost function, null if no cost function is used.
    • store

      public Store store
      It specifies the constraint store responsible for holding information about constraints and variables.
  • Constructor Details

    • ExampleSet

      public ExampleSet()
  • Method Details

    • model

      public abstract void model()
      It specifies a standard way of modeling the problem.
    • search

      public boolean search()
      It specifies simple search method based on input order and lexigraphical ordering of values.
      Returns:
      true if there is a solution, false otherwise.
    • searchOptimal

      public boolean searchOptimal()
      It specifies simple search method based on input order and lexigraphical ordering of values. It optimizes the solution by minimizing the cost function.
      Returns:
      true if there is a solution, false otherwise.
    • searchAllOptimal

      public boolean searchAllOptimal()
      It searches for all solutions with the optimal value.
      Returns:
      true if any optimal solution has been found.
    • searchSmallestDomain

      public boolean searchSmallestDomain(boolean optimal)
      It specifies simple search method based on smallest domain variable order and lexigraphical ordering of values.
      Parameters:
      optimal - it specifies if the search the optimal solution takes place.
      Returns:
      true if there is a solution, false otherwise.
    • searchWeightedDegree

      public boolean searchWeightedDegree()
      It specifies simple search method based on weighted degree variable order and lexigraphical ordering of values. This search method is rather general any problem good fit. It can be a good first trial to see if the model is correct.
      Returns:
      true if there is a solution, false otherwise.
    • searchMostConstrainedStatic

      public boolean searchMostConstrainedStatic()
      It specifies simple search method based variable order which takes into account the number of constraints attached to a variable and lexigraphical ordering of values.
      Returns:
      true if there is a solution, false otherwise.
    • searchAllAtOnce

      public boolean searchAllAtOnce()
      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.
    • searchMasterSlave

      public boolean searchMasterSlave(List<Var> masterVars, List<Var> slaveVars)
      It conducts master-slave search. Both of them use input order variable ordering.
      Parameters:
      masterVars - it specifies the search variables used in master search.
      slaveVars - it specifies the search variables used in slave search.
      Returns:
      true if the solution exists, false otherwise.
    • getSearch

      public Search<SetVar> getSearch()
      It returns the search used within an example.
      Returns:
      the search used within an example.
    • getStore

      public Store getStore()
      It specifies the constraint store used within an example.
      Returns:
      constraint store used within an example.
    • getSearchVariables

      public List<SetVar> getSearchVariables()
      It returns an array list of variables used to model the example.
      Returns:
      the array list of variables used to model the example.
    • printMatrix

      public static void printMatrix(IntVar[][] matrix, int rows, int cols)
      It prints a matrix of variables. All variables must be grounded.
      Parameters:
      matrix - matrix containing the grounded variables.
      rows - number of elements in the first dimension.
      cols - number of elements in the second dimension.