Class EnergySavedPairs
Object
EnergySavedPairs
- All Implemented Interfaces:
UpdatableMarks
Stores and manages pairwise energy interactions between marks.
This class implements UpdatableMarks to allow for dynamic updates of mark pairs and
their energies.
-
Constructor Summary
ConstructorsConstructorDescriptionEnergySavedPairs(AddCriteria<EnergyPair> addCriteria) Creates a new instance with the specified add criteria for energy pairs. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(MemoForIndex pxlMarkMemoList, VoxelizedMarkMemo newMark) voidAsserts that the total energy is valid (not NaN).Creates a set of unique energy pairs.deepCopy()Creates a deep copy of this instance.voidexchange(MemoForIndex memo, VoxelizedMarkMemo oldMark, int indexOldMark, VoxelizedMarkMemo newMark) doublePairwise energy totalvoidinitUpdatableMarks(MemoForIndex pxlMarkMemoList, EnergyStack stack, Logger logger, SharedFeatures sharedFeatures) booleanisMarksSpan(MarkCollection marks) Checks if the pair collection only contains items from a particular mark configuration.voidremove(MemoForIndex marksExisting, VoxelizedMarkMemo mark) Creates a shallow copy of this instance.toString()
-
Constructor Details
-
EnergySavedPairs
Creates a new instance with the specified add criteria for energy pairs.- Parameters:
addCriteria- theAddCriteriaforEnergyPairs
-
-
Method Details
-
shallowCopy
Creates a shallow copy of this instance.- Returns:
- a new
EnergySavedPairswith a shallow copy of the pair collection
-
deepCopy
Creates a deep copy of this instance.- Returns:
- a new
EnergySavedPairswith a deep copy of the pair collection
-
add
public void add(MemoForIndex pxlMarkMemoList, VoxelizedMarkMemo newMark) throws UpdateMarkSetException - Specified by:
addin interfaceUpdatableMarks- Throws:
UpdateMarkSetException
-
remove
public void remove(MemoForIndex marksExisting, VoxelizedMarkMemo mark) throws UpdateMarkSetException - Specified by:
removein interfaceUpdatableMarks- Throws:
UpdateMarkSetException
-
exchange
public void exchange(MemoForIndex memo, VoxelizedMarkMemo oldMark, int indexOldMark, VoxelizedMarkMemo newMark) throws UpdateMarkSetException - Specified by:
exchangein interfaceUpdatableMarks- Throws:
UpdateMarkSetException
-
isMarksSpan
Checks if the pair collection only contains items from a particular mark configuration.- Parameters:
marks- theMarkCollectionto check against- Returns:
- true if the pair collection only contains marks from the given collection, false otherwise
-
toString
-
assertValid
public void assertValid()Asserts that the total energy is valid (not NaN). -
createPairsUnique
Creates a set of unique energy pairs.- Returns:
- a
Setof uniqueEnergyPairs
-
getEnergyTotal
public double getEnergyTotal()Pairwise energy total
-