Package net.sf.tweety.math.opt.problem
Class CombinatoricsProblem
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.HashSet<ElementOfCombinatoricsProb>
-
- net.sf.tweety.math.opt.problem.CombinatoricsProblem
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<ElementOfCombinatoricsProb>
,java.util.Collection<ElementOfCombinatoricsProb>
,java.util.Set<ElementOfCombinatoricsProb>
- Direct Known Subclasses:
KnapSack
,TravelingSalesman
public abstract class CombinatoricsProblem extends java.util.HashSet<ElementOfCombinatoricsProb>
This class implements a combinatorial optimization problem- Author:
- Sebastian Franke
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CombinatoricsProblem(java.util.List<ElementOfCombinatoricsProb> elements)
-
Method Summary
Modifier and Type Method Description java.util.ArrayList<ElementOfCombinatoricsProb>
createDifference(java.util.ArrayList<ElementOfCombinatoricsProb> c)
abstract java.util.ArrayList<ElementOfCombinatoricsProb>
createRandomNewSolution(java.util.ArrayList<ElementOfCombinatoricsProb> currSol)
abstract double
evaluate(java.util.ArrayList<ElementOfCombinatoricsProb> sol)
java.util.ArrayList<java.util.ArrayList<ElementOfCombinatoricsProb>>
formNeighborhood(java.util.ArrayList<ElementOfCombinatoricsProb> currSol, int minIterations, int maxIteration, double threshold)
abstract boolean
isValid(java.util.ArrayList<ElementOfCombinatoricsProb> sol)
abstract double
sumOfWeights(java.util.ArrayList<ElementOfCombinatoricsProb> sol)
-
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size, spliterator
-
-
-
-
Field Detail
-
MINIMIZE
public static final int MINIMIZE
Static constant for the type "minimization"- See Also:
- Constant Field Values
-
MAXIMIZE
public static final int MAXIMIZE
Static constant for the type "maximization"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CombinatoricsProblem
public CombinatoricsProblem(java.util.List<ElementOfCombinatoricsProb> elements)
-
-
Method Detail
-
createDifference
public java.util.ArrayList<ElementOfCombinatoricsProb> createDifference(java.util.ArrayList<ElementOfCombinatoricsProb> c)
- Parameters:
c
- the List to be subtracted from "this" List- Returns:
- the differnece of the lists
-
sumOfWeights
public abstract double sumOfWeights(java.util.ArrayList<ElementOfCombinatoricsProb> sol)
- Parameters:
sol
- is the solution to be viewd- Returns:
- if the solution sol is valid under the constraints of the problem
-
formNeighborhood
public java.util.ArrayList<java.util.ArrayList<ElementOfCombinatoricsProb>> formNeighborhood(java.util.ArrayList<ElementOfCombinatoricsProb> currSol, int minIterations, int maxIteration, double threshold)
-
createRandomNewSolution
public abstract java.util.ArrayList<ElementOfCombinatoricsProb> createRandomNewSolution(java.util.ArrayList<ElementOfCombinatoricsProb> currSol)
-
evaluate
public abstract double evaluate(java.util.ArrayList<ElementOfCombinatoricsProb> sol)
-
isValid
public abstract boolean isValid(java.util.ArrayList<ElementOfCombinatoricsProb> sol)
-
-