Package org.anchoranalysis.mpp.proposer
Class ProposerContext
Object
ProposerContext
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
ConstructorsConstructorDescriptionProposerContext
(RandomNumberGenerator randomNumberGenerator, EnergyStack energyStack, RegionMap regionMap, OperationContext operationContext, ErrorNode errorNode) Creates a newProposerContext
instance. -
Method Summary
Modifier and TypeMethodDescriptionaddErrorLevel
(String errorMessage) Creates a new ProposerContext with an additional error level.Creates a VoxelizedMarkMemo for the given mark.Gets the dimensions of the energy stack.boolean
Energy stack for the current context.Error node for tracking and managing errors.Operation context for the current operation.Random number generator for sampling operations.Region map for the current context.int
hashCode()
replaceError
(ErrorNode errorNode) Creates a new ProposerContext with a replaced error node.int
sampleInteger
(int maxValExclusive) Samples an integer uniformly between [0..maxValExclusive).toString()
-
Constructor Details
-
ProposerContext
public ProposerContext(RandomNumberGenerator randomNumberGenerator, EnergyStack energyStack, RegionMap regionMap, OperationContext operationContext, ErrorNode errorNode) Creates a newProposerContext
instance.- Parameters:
randomNumberGenerator
- Random number generator for sampling operations.energyStack
- Energy stack for the current context.regionMap
- Region map for the current context.operationContext
- Operation context for the current operation.errorNode
- Error node for tracking and managing errors.
-
-
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
-