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:
Serializable,Cloneable,Iterable<ElementOfCombinatoricsProb>,Collection<ElementOfCombinatoricsProb>,Set<ElementOfCombinatoricsProb>
- Direct Known Subclasses:
KnapSack,TravelingSalesman
public abstract class CombinatoricsProblem extends HashSet<ElementOfCombinatoricsProb>
This class implements a combinatorial optimization problem- Author:
- Sebastian Franke
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CombinatoricsProblem(List<ElementOfCombinatoricsProb> elements)
-
Method Summary
Modifier and Type Method Description ArrayList<ElementOfCombinatoricsProb>createDifference(ArrayList<ElementOfCombinatoricsProb> c)abstract ArrayList<ElementOfCombinatoricsProb>createRandomNewSolution(ArrayList<ElementOfCombinatoricsProb> currSol)abstract doubleevaluate(ArrayList<ElementOfCombinatoricsProb> sol)ArrayList<ArrayList<ElementOfCombinatoricsProb>>formNeighborhood(ArrayList<ElementOfCombinatoricsProb> currSol, int minIterations, int maxIteration, double threshold)abstract booleanisValid(ArrayList<ElementOfCombinatoricsProb> sol)abstract doublesumOfWeights(ArrayList<ElementOfCombinatoricsProb> sol)-
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size, spliterator
-
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
-
-
-
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(List<ElementOfCombinatoricsProb> elements)
-
-
Method Detail
-
createDifference
public ArrayList<ElementOfCombinatoricsProb> createDifference(ArrayList<ElementOfCombinatoricsProb> c)
- Parameters:
c- the List to be subtracted from "this" List- Returns:
- the differnece of the lists
-
sumOfWeights
public abstract double sumOfWeights(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 ArrayList<ArrayList<ElementOfCombinatoricsProb>> formNeighborhood(ArrayList<ElementOfCombinatoricsProb> currSol, int minIterations, int maxIteration, double threshold)
-
createRandomNewSolution
public abstract ArrayList<ElementOfCombinatoricsProb> createRandomNewSolution(ArrayList<ElementOfCombinatoricsProb> currSol)
-
evaluate
public abstract double evaluate(ArrayList<ElementOfCombinatoricsProb> sol)
-
isValid
public abstract boolean isValid(ArrayList<ElementOfCombinatoricsProb> sol)
-
-