Class MarksWithEnergyBreakdown
Object
MarksWithEnergyBreakdown
- All Implemented Interfaces:
Serializable
Marks with both the total energy and a breakdown by clique.
This class provides functionality to manage and calculate energies for a collection of marks, including individual, pair, and all-mark energies.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance with the given marks and total energy.MarksWithEnergyBreakdown(MarksWithTotalEnergy marks, EnergySavedIndividual individual, EnergySavedPairs pair, EnergySavedAll all) Creates a newMarksWithEnergyBreakdowninstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(EnergyMemoList wrapperInd, VoxelizedMarkMemo newPxlMarkMemo, EnergyStackWithoutParameters stack) Adds a new mark to the collection and updates energies.voidAsserts that the energy calculations are valid.deepCopy()Creates a deep copy of this instance.voidexchange(int index, VoxelizedMarkMemo newMark) Exchanges a mark at a specific index with a new mark.voidexchange(EnergyMemoList wrapperInd, int index, VoxelizedMarkMemo newMark, EnergyStack energyStack) Exchanges a mark at a specific index with a new mark and updates energies.getAll()Certain features are stored for every object, so that we can reference them in our calculations for the 'all' component.Gets the energy scheme with shared features.doubleGets the total energy of all marks.Energy saved for individual marks.getMarks()Gets the collection of marks.Gets the marks with their total energy.getPair()Every combination of interactions between marks and the associated energy.voidInitializes the energy calculations.voidremove(int index) Removes a mark at a specific index from the collection.voidremove(EnergyMemoList wrapperInd, int index, VoxelizedMarkMemo markToRemove, EnergyStackWithoutParameters stack) Removes a mark at a specific index from the collection and updates energies.voidremove(EnergyMemoList wrapperInd, VoxelizedMarkMemo markToRemove, EnergyStackWithoutParameters stack) Removes a specific mark from the collection and updates energies.voidremoveTwo(EnergyMemoList wrapperInd, int index1, int index2, EnergyStackWithoutParameters energyStack) Removes two marks at specific indices from the collection and updates energies.voidsetAll(EnergySavedAll all) Certain features are stored for every object, so that we can reference them in our calculations for the 'all' component.Creates a shallow copy of this instance.final intsize()Gets the number of marks in the collection.toString()Returns a string representation of the object.voidupdateTotal(EnergyMemoList pxlMarkMemoList, EnergyStackWithoutParameters stack) Updates the total energy based on the current state.
-
Constructor Details
-
MarksWithEnergyBreakdown
Creates a new instance with the given marks and total energy.- Parameters:
marks- theMarksWithTotalEnergycontaining marks with their total energy
-
MarksWithEnergyBreakdown
public MarksWithEnergyBreakdown(MarksWithTotalEnergy marks, EnergySavedIndividual individual, EnergySavedPairs pair, EnergySavedAll all) Creates a newMarksWithEnergyBreakdowninstance.- Parameters:
marks- The marks with their total energy.individual- Energy saved for individual marks.pair- Every combination of interactions between marks and the associated energy.all- Certain features are stored for every object, so that we can reference them in our calculations for the 'all' component.
-
-
Method Details
-
initialize
Initializes the energy calculations.- Throws:
NamedFeatureCalculateException- if there's an error during initialization
-
assertValid
public void assertValid()Asserts that the energy calculations are valid. -
getMarksWithTotalEnergy
Gets the marks with their total energy.- Returns:
- the
MarksWithTotalEnergycontaining marks with total energy
-
updateTotal
public void updateTotal(EnergyMemoList pxlMarkMemoList, EnergyStackWithoutParameters stack) throws NamedFeatureCalculateException Updates the total energy based on the current state.- Parameters:
pxlMarkMemoList- theEnergyMemoListcontaining energy memosstack- theEnergyStackWithoutParametersfor energy calculations- Throws:
NamedFeatureCalculateException- if there's an error during calculation
-
shallowCopy
Creates a shallow copy of this instance.- Returns:
- a new
MarksWithEnergyBreakdowninstance with shallow copies of the internal state
-
deepCopy
Creates a deep copy of this instance.- Returns:
- a new
MarksWithEnergyBreakdowninstance with deep copies of the internal state
-
getEnergyTotal
public double getEnergyTotal()Gets the total energy of all marks.- Returns:
- the total energy as a double
-
getMarks
Gets the collection of marks.- Returns:
- the
MarkCollectioncontaining all marks
-
getEnergyScheme
Gets the energy scheme with shared features.- Returns:
- the
EnergySchemeWithSharedFeaturesused for energy calculations
-
add
public void add(EnergyMemoList wrapperInd, VoxelizedMarkMemo newPxlMarkMemo, EnergyStackWithoutParameters stack) throws NamedFeatureCalculateException Adds a new mark to the collection and updates energies.- Parameters:
wrapperInd- theEnergyMemoListcontaining energy memosnewPxlMarkMemo- the newVoxelizedMarkMemoto addstack- theEnergyStackWithoutParametersfor energy calculations- Throws:
NamedFeatureCalculateException- if there's an error during calculation
-
remove
public void remove(EnergyMemoList wrapperInd, VoxelizedMarkMemo markToRemove, EnergyStackWithoutParameters stack) throws NamedFeatureCalculateException Removes a specific mark from the collection and updates energies.- Parameters:
wrapperInd- theEnergyMemoListcontaining energy memosmarkToRemove- theVoxelizedMarkMemoto removestack- theEnergyStackWithoutParametersfor energy calculations- Throws:
NamedFeatureCalculateException- if there's an error during calculation
-
remove
public void remove(EnergyMemoList wrapperInd, int index, VoxelizedMarkMemo markToRemove, EnergyStackWithoutParameters stack) throws NamedFeatureCalculateException Removes a mark at a specific index from the collection and updates energies.- Parameters:
wrapperInd- theEnergyMemoListcontaining energy memosindex- the index of the mark to removemarkToRemove- theVoxelizedMarkMemoto removestack- theEnergyStackWithoutParametersfor energy calculations- Throws:
NamedFeatureCalculateException- if there's an error during calculation
-
removeTwo
public void removeTwo(EnergyMemoList wrapperInd, int index1, int index2, EnergyStackWithoutParameters energyStack) throws NamedFeatureCalculateException Removes two marks at specific indices from the collection and updates energies.- Parameters:
wrapperInd- theEnergyMemoListcontaining energy memosindex1- the index of the first mark to removeindex2- the index of the second mark to removeenergyStack- theEnergyStackWithoutParametersfor energy calculations- Throws:
NamedFeatureCalculateException- if there's an error during calculation
-
exchange
public void exchange(EnergyMemoList wrapperInd, int index, VoxelizedMarkMemo newMark, EnergyStack energyStack) throws NamedFeatureCalculateException Exchanges a mark at a specific index with a new mark and updates energies.- Parameters:
wrapperInd- theEnergyMemoListcontaining energy memosindex- the index of the mark to exchangenewMark- the newVoxelizedMarkMemoto replace the existing markenergyStack- theEnergyStackfor energy calculations- Throws:
NamedFeatureCalculateException- if there's an error during calculation
-
remove
public void remove(int index) Removes a mark at a specific index from the collection.- Parameters:
index- the index of the mark to remove
-
exchange
Exchanges a mark at a specific index with a new mark.- Parameters:
index- the index of the mark to exchangenewMark- the newVoxelizedMarkMemoto replace the existing mark
-
toString
Returns a string representation of the object. -
size
public final int size()Gets the number of marks in the collection.- Returns:
- the number of marks as an int
-
getIndividual
Energy saved for individual marks. -
getPair
Every combination of interactions between marks and the associated energy. -
getAll
Certain features are stored for every object, so that we can reference them in our calculations for the 'all' component. -
setAll
Certain features are stored for every object, so that we can reference them in our calculations for the 'all' component.
-