Package org.anchoranalysis.mpp.proposer
Class ProposerContext
Object
org.anchoranalysis.mpp.proposer.ProposerContext
public final class ProposerContext extends Object
Context for proposing operations in the MPP framework.
This class encapsulates various components needed for proposing operations, including random number generation, energy stack, region map, and error handling.
-
Constructor Summary
Constructors Constructor Description ProposerContext(RandomNumberGenerator randomNumberGenerator, EnergyStack energyStack, RegionMap regionMap, OperationContext operationContext, ErrorNode errorNode) -
Method Summary
Modifier and Type Method Description ProposerContextaddErrorLevel(String errorMessage)Creates a new ProposerContext with an additional error level.VoxelizedMarkMemocreate(Mark mark)Creates a VoxelizedMarkMemo for the given mark.Dimensionsdimensions()Gets the dimensions of the energy stack.booleanequals(Object o)EnergyStackgetEnergyStack()Energy stack for the current context.ErrorNodegetErrorNode()Error node for tracking and managing errors.OperationContextgetOperationContext()Operation context for the current operation.RandomNumberGeneratorgetRandomNumberGenerator()Random number generator for sampling operations.RegionMapgetRegionMap()Region map for the current context.inthashCode()ProposerContextreplaceError(ErrorNode errorNode)Creates a new ProposerContext with a replaced error node.intsampleInteger(int maxValExclusive)Samples an integer uniformly between [0..maxValExclusive).StringtoString()
-
Constructor Details
-
ProposerContext
public ProposerContext(RandomNumberGenerator randomNumberGenerator, EnergyStack energyStack, RegionMap regionMap, OperationContext operationContext, ErrorNode errorNode)
-
-
Method Details
-
replaceError
Creates a new ProposerContext with a replaced error node.- Parameters:
errorNode- The new error node to use- Returns:
- A new ProposerContext with the updated error node
-
addErrorLevel
Creates a new ProposerContext with an additional error level.- Parameters:
errorMessage- The error message to add- Returns:
- A new ProposerContext with the added error level
-
sampleInteger
public int sampleInteger(int maxValExclusive)Samples an integer uniformly between [0..maxValExclusive).- Parameters:
maxValExclusive- The exclusive upper bound for the sampled integer- Returns:
- A randomly sampled integer
-
dimensions
Gets the dimensions of the energy stack.- Returns:
- The dimensions of the energy stack
-
create
Creates a VoxelizedMarkMemo for the given mark.- Parameters:
mark- The mark to create a VoxelizedMarkMemo for- Returns:
- A new VoxelizedMarkMemo
-
getRandomNumberGenerator
Random number generator for sampling operations. -
getEnergyStack
Energy stack for the current context. -
getRegionMap
Region map for the current context. -
getOperationContext
Operation context for the current operation. -
getErrorNode
Error node for tracking and managing errors. -
equals
-
hashCode
public int hashCode() -
toString
-