Package org.jacop.examples.fd
Class Gates
- java.lang.Object
-
- org.jacop.examples.fd.ExampleFD
-
- org.jacop.examples.fd.Gates
-
public class Gates extends ExampleFD
It specifies an adder using gates specified by extensional constraints.- Version:
- 4.8
-
-
Constructor Summary
Constructors Constructor Description Gates()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidand(BooleanVar in1, BooleanVar in2, BooleanVar out, java.util.function.BiFunction<IntVar[],int[][],Constraint> tableConstraintProvider)It imposes an extensional constraint enforcing an and relationship between two input parameters and an output parameter.static voidmain(java.lang.String[] args)It executes a program to solve gates problems.voidmodel()It specifies a standard way of modeling the problem.voidmodel(java.util.function.BiFunction<IntVar[],int[][],Constraint> tableConstraintProvider)voidnot(BooleanVar in, BooleanVar out, java.util.function.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, java.util.function.BiFunction<IntVar[],int[][],Constraint> tableConstraintProvider)It imposes an extensional constraint enforcing an or relationship between two input parameters and an output parameter.booleansearchSpecific()It 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, java.util.function.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
-
-
-
-
Method Detail
-
model
public void model()
Description copied from class:ExampleFDIt specifies a standard way of modeling the problem.
-
model
public void model(java.util.function.BiFunction<IntVar[],int[][],Constraint> tableConstraintProvider)
-
and
public void and(BooleanVar in1, BooleanVar in2, BooleanVar out, java.util.function.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, java.util.function.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, java.util.function.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, java.util.function.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
public static void main(java.lang.String[] args)
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
public static Constraint tableConstraintProviderUsingSimpleTable(IntVar[] vars, int[][] tuples)
-
tableConstraintProviderUsingExtensionalSTR
public static Constraint tableConstraintProviderUsingExtensionalSTR(IntVar[] vars, int[][] tuples)
-
-