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.9
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.static void
It executes a program to solve gates problems.void
model()
It specifies a standard way of modeling the problem.void
model
(BiFunction<IntVar[], int[][], Constraint> tableConstraintProvider) 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.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.boolean
It provides a specific search with extensive printout of the result.static Constraint
tableConstraintProviderUsingExtensionalSTR
(IntVar[] vars, int[][] tuples) static Constraint
tableConstraintProviderUsingSimpleTable
(IntVar[] vars, int[][] tuples) 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.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:ExampleFD
It 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
-