Package ai.libs.jaicore.basic.sets
Class LDSRelationComputer<T>
- java.lang.Object
-
- ai.libs.jaicore.basic.algorithm.AAlgorithm<RelationComputationProblem<T>,java.util.List<java.util.List<T>>>
-
- ai.libs.jaicore.basic.sets.LDSRelationComputer<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
java.lang.Iterable<org.api4.java.algorithm.events.IAlgorithmEvent>
,java.util.concurrent.Callable<java.util.List<java.util.List<T>>>
,java.util.Iterator<org.api4.java.algorithm.events.IAlgorithmEvent>
,org.api4.java.algorithm.IAlgorithm<RelationComputationProblem<T>,java.util.List<java.util.List<T>>>
,org.api4.java.common.control.ICancelable
,org.api4.java.common.control.ILoggingCustomizable
public class LDSRelationComputer<T> extends AAlgorithm<RelationComputationProblem<T>,java.util.List<java.util.List<T>>>
This algorithms allows to compute an ordered Cartesian product. It is ordered in the sense that it interprets the sets over which the product is built as ORDERED sets and first generates tuples with items that appear first in the sets. The algorithm also works for ordinary unordered sets but is a bit slower why another algorithm could be favorable.
-
-
Constructor Summary
Constructors Constructor Description LDSRelationComputer(RelationComputationProblem<T> problem)
LDSRelationComputer(java.util.List<java.util.Collection<T>> sets)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.util.List<T>>
call()
java.lang.String
getLoggerName()
int
getNumCreatedNodes()
int
getNumRecycledNodes()
java.util.List<T>
nextTuple()
org.api4.java.algorithm.events.IAlgorithmEvent
nextWithException()
void
setLoggerName(java.lang.String name)
-
Methods inherited from class ai.libs.jaicore.basic.algorithm.AAlgorithm
activate, announceTimeoutDetected, avoidReinterruptionOnShutdownOnCurrentThread, cancel, checkAndConductTermination, checkTermination, computeTimeoutAware, getActivationTime, getConfig, getId, getInput, getListeners, getNumCPUs, getRemainingTimeToDeadline, getState, getTimeout, getTimeoutPrecautionOffset, hasNext, hasThreadBeenInterruptedDuringShutdown, interruptThreadAsPartOfShutdown, isCanceled, isShutdownInitialized, isStopCriterionSatisfied, isTimeouted, iterator, next, post, registerActiveThread, registerListener, resolveShutdownInterruptOnCurrentThread, setConfig, setDeadline, setMaxNumThreads, setNumCPUs, setState, setTimeout, setTimeout, setTimeoutPrecautionOffset, shutdown, terminate, unregisterActiveThread, unregisterThreadAndShutdown
-
-
-
-
Constructor Detail
-
LDSRelationComputer
public LDSRelationComputer(java.util.List<java.util.Collection<T>> sets)
-
LDSRelationComputer
public LDSRelationComputer(RelationComputationProblem<T> problem)
-
-
Method Detail
-
nextWithException
public org.api4.java.algorithm.events.IAlgorithmEvent nextWithException() throws java.lang.InterruptedException, org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException, org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException
- Throws:
java.lang.InterruptedException
org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException
org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException
-
nextTuple
public java.util.List<T> nextTuple() throws java.lang.InterruptedException, org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException, org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException
- Throws:
java.lang.InterruptedException
org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException
org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException
-
call
public java.util.List<java.util.List<T>> call() throws java.lang.InterruptedException, org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException, org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException
- Throws:
java.lang.InterruptedException
org.api4.java.algorithm.exceptions.AlgorithmExecutionCanceledException
org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException
-
getNumRecycledNodes
public int getNumRecycledNodes()
-
getNumCreatedNodes
public int getNumCreatedNodes()
-
setLoggerName
public void setLoggerName(java.lang.String name)
- Specified by:
setLoggerName
in interfaceorg.api4.java.common.control.ILoggingCustomizable
- Overrides:
setLoggerName
in classAAlgorithm<RelationComputationProblem<T>,java.util.List<java.util.List<T>>>
-
getLoggerName
public java.lang.String getLoggerName()
- Specified by:
getLoggerName
in interfaceorg.api4.java.common.control.ILoggingCustomizable
- Overrides:
getLoggerName
in classAAlgorithm<RelationComputationProblem<T>,java.util.List<java.util.List<T>>>
-
-