org.cpsolver.ifs.example.csp

## Class StructuredCSPModel

- java.lang.Object
- - org.cpsolver.ifs.model.Model<CSPVariable,CSPValue>
  - - org.cpsolver.ifs.example.csp.StructuredCSPModel

-     public class StructuredCSPModel
      extends Model<CSPVariable,CSPValue>

  Random Binary CSP with kernels.
  This class only implements the generation of Structured CSP problem.
  In Structured CSP, variables are divided into several kernels (some variables may remain ouside kernels). Different constraints (in density and tightnes) are generated according to whether variables are from the same kernel or not.
  Model parameters:

  Related Solver Parameters
  Parameter | Type | Comment
  --- | --- | ---
  CSP.NrVariables | `Integer` | Number of variables
  CSP.DomainSize | `Integer` | Number of values for each variable
  CSP.NrKernels | `Integer` | Number of kernels
  CSP.KernelSize | `Integer` | Number of variables in each kernel
  CSP.Tightness | `Double` | Tightness of constraints outside kernels
  CSP.KernelTightness | `Double` | Tightness of constraints inside a kernel
  CSP.Density | `Double` | Density of constraints outside kernels
  CSP.KernelDensity | `Double` | Density of constraints inside a kernel
  General.MPP | `String` | Minimal perturbation problem → generate initial assignment

  Version:
    IFS 1.3 (Iterative Forward Search)
    Copyright (C) 2006 - 2014 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.
  Author:
    Tomáš Müller

- - ### Field Summary

    - ### Fields inherited from class org.cpsolver.ifs.model.Model

      `sDoubleFormat, sPercentageFormat, sTimeFormat`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StructuredCSPModel(DataProperties properties, long seed)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<String,String>` | `getInfo(Assignment<CSPVariable,CSPValue> assignment)` Return information table

    - ### Methods inherited from class org.cpsolver.ifs.model.Model

      `addConstraint, addCriterion, addGlobalConstraint, addModelListener, addVariable, afterAssigned, afterAssigned, afterUnassigned, afterUnassigned, assignedVariables, assignedVariables, beforeAssigned, beforeAssigned, beforeUnassigned, beforeUnassigned, bestUnassignedVariables, bestUnassignedVariables, clearAssignmentContexts, clearBest, conflictConstraints, conflictValues, conflictValues, constraints, countConstraints, countGlobalConstraints, countVariables, createAssignmentContexts, createInheritedAssignment, createReference, getBestPerturbations, getBestUnassignedVariables, getBestValue, getCriteria, getCriterion, getDefaultAssignment, getEmptyAssignment, getExtendedInfo, getExtendedInfo, getInfo, getInfo, getInfo, getInfoProviders, getModelListeners, getPerc, getPercRev, getTotalValue, getTotalValue, getTotalValue, getTotalValue, globalConstraints, inConflict, inConflict, init, invalidateVariablesWithInitialValueCache, modelListenerOfType, nrAssignedVariables, nrAssignedVariables, nrUnassignedVariables, nrUnassignedVariables, perturbVariables, perturbVariables, perturbVariables, perturbVariables, perturbVariables, removeConstraint, removeCriterion, removeCriterion, removeGlobalConstraint, removeModelListener, removeReference, removeVariable, restoreBest, restoreBest, restoreBest, saveBest, saveBest, setBestValue, setDefaultAssignment, toString, toString, unassignedHardConstraints, unassignedVariables, unassignedVariables, variables, variablesWithInitialValue, weaken`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### StructuredCSPModel

          public StructuredCSPModel(DataProperties properties,
                                    long seed)

      Constructor
      Parameters:
        `properties` - solver configuration
        `seed` - random seed

  - ### Method Detail

    - #### getInfo

          public Map<String,String> getInfo(Assignment<CSPVariable,CSPValue> assignment)

      Return information table
      Overrides:
        `getInfo` in class `Model<CSPVariable,CSPValue>`
      Parameters:
        `assignment` - current assignment
      Returns:
        info table