@ALDParametrizedClass public class MTBSetWeightedEnergy<T> extends Object
Objects of this class contain a set of energies. With each energy an individual weight is associated which allows application-dependent energy combinations. Per default the weights of all energies in the set are set to 1.0.
| Modifier and Type | Field and Description |
|---|---|
protected Vector<T> |
energies
List of snake energies.
|
protected Vector<Double> |
weights
List of energy weights.
|
| Constructor and Description |
|---|
MTBSetWeightedEnergy()
Default contructor for empty set.
|
MTBSetWeightedEnergy(Vector<T> es)
Constructor for a given vector of energies.
|
MTBSetWeightedEnergy(Vector<T> es,
Vector<Double> ws)
Constructor with energies and weights.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEnergy(T e)
Append another energy to the list with default weight 1.0.
|
void |
addEnergy(T e,
double w)
Append another energy to the list.
|
T |
getEnergy(int i)
Returns element i of the energy list.
|
Vector<T> |
getEnergyList()
Returns the list of energies.
|
Double |
getWeight(int i)
Returns element i of the weight list.
|
Vector<Double> |
getWeights()
Returns the list of weights.
|
void |
setEnergyList(Vector<T> es)
Specify a new set of energies, all weights are reset to 1.0.
|
void |
setWeights(Vector<Double> ws)
Specify new weights.
|
String |
toString() |
@ALDClassParameter(label="energies",
mode=STANDARD,
dataIOOrder=-10)
protected Vector<T> energies
public MTBSetWeightedEnergy()
public MTBSetWeightedEnergy(Vector<T> es)
es - Vector with energies.public MTBSetWeightedEnergy(Vector<T> es, Vector<Double> ws) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Both vectors must have the same size, otherwise an exception is thrown.
es - Vector of energies.ws - Vector of weights.de.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionpublic void setEnergyList(Vector<T> es)
es - New vector of energies.public void setWeights(Vector<Double> ws)
Note that it is assumed that the size of the weight vector matches the size of the current energy set.
ws - List of energy weights.public Vector<T> getEnergyList()
public T getEnergy(int i)
i - Index of energy to be returned.public Vector<Double> getWeights()
public Double getWeight(int i)
public void addEnergy(T e, double w)
e - New energy.w - Weight for the energy.public void addEnergy(T e)
e - New energy to be appended.Copyright © 2010–2025 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.