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 newMarksWithEnergyBreakdown
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(EnergyMemoList wrapperInd, VoxelizedMarkMemo newPxlMarkMemo, EnergyStackWithoutParameters stack) Adds a new mark to the collection and updates energies.void
Asserts that the energy calculations are valid.deepCopy()
Creates a deep copy of this instance.void
exchange
(int index, VoxelizedMarkMemo newMark) Exchanges a mark at a specific index with a new mark.void
exchange
(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.double
Gets 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.void
Initializes the energy calculations.void
remove
(int index) Removes a mark at a specific index from the collection.void
remove
(EnergyMemoList wrapperInd, int index, VoxelizedMarkMemo markToRemove, EnergyStackWithoutParameters stack) Removes a mark at a specific index from the collection and updates energies.void
remove
(EnergyMemoList wrapperInd, VoxelizedMarkMemo markToRemove, EnergyStackWithoutParameters stack) Removes a specific mark from the collection and updates energies.void
removeTwo
(EnergyMemoList wrapperInd, int index1, int index2, EnergyStackWithoutParameters energyStack) Removes two marks at specific indices from the collection and updates energies.void
setAll
(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 int
size()
Gets the number of marks in the collection.toString()
Returns a string representation of the object.void
updateTotal
(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
- theMarksWithTotalEnergy
containing marks with their total energy
-
MarksWithEnergyBreakdown
public MarksWithEnergyBreakdown(MarksWithTotalEnergy marks, EnergySavedIndividual individual, EnergySavedPairs pair, EnergySavedAll all) Creates a newMarksWithEnergyBreakdown
instance.- 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
MarksWithTotalEnergy
containing 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
- theEnergyMemoList
containing energy memosstack
- theEnergyStackWithoutParameters
for energy calculations- Throws:
NamedFeatureCalculateException
- if there's an error during calculation
-
shallowCopy
Creates a shallow copy of this instance.- Returns:
- a new
MarksWithEnergyBreakdown
instance with shallow copies of the internal state
-
deepCopy
Creates a deep copy of this instance.- Returns:
- a new
MarksWithEnergyBreakdown
instance 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
MarkCollection
containing all marks
-
getEnergyScheme
Gets the energy scheme with shared features.- Returns:
- the
EnergySchemeWithSharedFeatures
used 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
- theEnergyMemoList
containing energy memosnewPxlMarkMemo
- the newVoxelizedMarkMemo
to addstack
- theEnergyStackWithoutParameters
for 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
- theEnergyMemoList
containing energy memosmarkToRemove
- theVoxelizedMarkMemo
to removestack
- theEnergyStackWithoutParameters
for 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
- theEnergyMemoList
containing energy memosindex
- the index of the mark to removemarkToRemove
- theVoxelizedMarkMemo
to removestack
- theEnergyStackWithoutParameters
for 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
- theEnergyMemoList
containing energy memosindex1
- the index of the first mark to removeindex2
- the index of the second mark to removeenergyStack
- theEnergyStackWithoutParameters
for 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
- theEnergyMemoList
containing energy memosindex
- the index of the mark to exchangenewMark
- the newVoxelizedMarkMemo
to replace the existing markenergyStack
- theEnergyStack
for 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 newVoxelizedMarkMemo
to 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.
-