Class Index | File Index

Classes


Class Choice


Extends TableNode.

Defined in: Choice.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Choice(description)
A Choice represents an option that can be selected as part of a dancing-links optimization.
Method Summary
Method Attributes Method Name and Description
<static>  
Choice.choose(hiddenNodes)
Satisfies all constraints that this choice satisfies.
<static>  
Iterates over each of the constraints that would be satisfied by this choice.
<static>  
Choice.remove(hiddenNodes)
Removes all nodes in this row from their associated Constraints, indicating that this choice is no longer available to the algorithm.
<static>  
Choice.satisfies(constraint)
Creates a linkage between this Choice and a constraint.
<static>  
Choice.toString()
Methods borrowed from class TableNode:
addToHeadersChains, forEachColumn, forEachRow, hideFromColumn, hideFromRow
Class Detail
Choice(description)
A Choice represents an option that can be selected as part of a dancing-links optimization.

It is a TableNode, with a non enumerable row and column chain because it is intended to be used as a row header.

Parameters:
description
{Object} can be anything, but is associated with the choice.
Method Detail
<static> Choice.choose(hiddenNodes)
Satisfies all constraints that this choice satisfies. Satisfying a constraint will hide all nodes linked to it as well as all nodes in all rows linked to it. The hidden nodes will be added to the array passed in.
Parameters:
hiddenNodes
{Array} an array that all nodes hidden as part of this operation will be added to. May not be null.

<static> Choice.forEachSatisfiedConstraint(func)
Iterates over each of the constraints that would be satisfied by this choice.
Parameters:
func
{function} a function that is called back with a constraint that would be satisfied by this choice and the TableNode that links this Choice to that Constraint. Returning false will terminate the loop early. May not be null.

<static> Choice.remove(hiddenNodes)
Removes all nodes in this row from their associated Constraints, indicating that this choice is no longer available to the algorithm. The pointers holding the row together are maintained, so that only the links into the column structure need to be restored.
Parameters:
hiddenNodes
{Array} an array that all nodes hidden as part of this operation will be added to. May not be null.

<static> {TableNode} Choice.satisfies(constraint)
Creates a linkage between this Choice and a constraint.
Parameters:
constraint
{Constraint} a constraint that selecting this choice will satisfy. May not be null.
Returns:
{TableNode} the TableNode linking this Choice with the constraint.

<static> Choice.toString()

Documentation generated by JsDoc Toolkit 2.4.0 on Thu Oct 19 2017 06:55:56 GMT+0000 (UTC)