Package org.jacop.examples.fd
Class Gates
java.lang.Object
org.jacop.examples.fd.ExampleFD
org.jacop.examples.fd.Gates
It specifies an adder using gates specified by extensional constraints.
- Version:
- 4.10
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidand(BooleanVar in1, BooleanVar in2, BooleanVar out, BiFunction<IntVar[], int[][], Constraint> tableConstraintProvider) It imposes an extensional constraint enforcing an and relationship between two input parameters and an output parameter.static voidIt executes a program to solve gates problems.voidmodel()It specifies a standard way of modeling the problem.voidmodel(BiFunction<IntVar[], int[][], Constraint> tableConstraintProvider) voidnot(BooleanVar in, BooleanVar out, BiFunction<IntVar[], int[][], Constraint> tableConstraintProvider) It imposes an extensional constraint enforcing an not relationship between input parameter and an output parameter.voidor(BooleanVar in1, BooleanVar in2, BooleanVar out, BiFunction<IntVar[], int[][], Constraint> tableConstraintProvider) It imposes an extensional constraint enforcing an or relationship between two input parameters and an output parameter.booleanIt provides a specific search with extensive printout of the result.static ConstrainttableConstraintProviderUsingExtensionalSTR(IntVar[] vars, int[][] tuples) static ConstrainttableConstraintProviderUsingSimpleTable(IntVar[] vars, int[][] tuples) voidxor(BooleanVar in1, BooleanVar in2, BooleanVar out, BiFunction<IntVar[], int[][], Constraint> tableConstraintProvider) It imposes an extensional constraint enforcing an xor relationship between two input parameters and an output parameter.Methods inherited from class org.jacop.examples.fd.ExampleFD
creditSearch, getSearch, getSearchVariables, getStore, printMatrix, search, searchAllAtOnce, searchAllOptimal, searchLDS, searchMasterSlave, searchMaxRegretOptimal, searchMiddle, searchMostConstrainedStatic, searchOptimal, searchSmallestDomain, searchSmallestMedian, searchSmallestMiddle, searchSmallestMin, searchWeightedDegree, searchWithMaxRegret, searchWithRestarts, shavingSearch
-
Constructor Details
-
Gates
public Gates()
-
-
Method Details
-
model
public void model()Description copied from class:ExampleFDIt specifies a standard way of modeling the problem. -
model
-
and
public void and(BooleanVar in1, BooleanVar in2, BooleanVar out, BiFunction<IntVar[], int[][], Constraint> tableConstraintProvider) It imposes an extensional constraint enforcing an and relationship between two input parameters and an output parameter.- Parameters:
in1- the first input parameter.in2- the second input parameter.out- the output parameter.tableConstraintProvider- function that when provided input to create table constraint will create one.
-
or
public void or(BooleanVar in1, BooleanVar in2, BooleanVar out, BiFunction<IntVar[], int[][], Constraint> tableConstraintProvider) It imposes an extensional constraint enforcing an or relationship between two input parameters and an output parameter.- Parameters:
in1- the first input parameter.in2- the second input parameter.out- the output parameter.tableConstraintProvider- function that when provided input to create table constraint will create one.
-
xor
public void xor(BooleanVar in1, BooleanVar in2, BooleanVar out, BiFunction<IntVar[], int[][], Constraint> tableConstraintProvider) It imposes an extensional constraint enforcing an xor relationship between two input parameters and an output parameter.- Parameters:
in1- the first input parameter.in2- the second input parameter.out- the output parameter.tableConstraintProvider- function that when provided input to create table constraint will create one.
-
not
public void not(BooleanVar in, BooleanVar out, BiFunction<IntVar[], int[][], Constraint> tableConstraintProvider) It imposes an extensional constraint enforcing an not relationship between input parameter and an output parameter.- Parameters:
in- the first input parameter.out- the output parameter.tableConstraintProvider- function that when provided input to create table constraint will create one.
-
main
It executes a program to solve gates problems.- Parameters:
args- parameters (none)
-
searchSpecific
public boolean searchSpecific()It provides a specific search with extensive printout of the result.- Returns:
- true if there is a solution, false otherwise.
-
tableConstraintProviderUsingSimpleTable
-
tableConstraintProviderUsingExtensionalSTR
-