Class ConstantSampler
Returns a constant value when sampled
Implements
Inherited Members
Namespace: UnityEngine.Perception.Randomization.Samplers
Assembly: Unity.Perception.Runtime.dll
Syntax
[Serializable]
public class ConstantSampler : ISampler
Constructors
ConstantSampler()
Constructs a ConstantSampler
Declaration
public ConstantSampler()
ConstantSampler(float, bool, float, float)
Constructs a new ConstantSampler
Declaration
public ConstantSampler(float value, bool shouldCheckValidRange = false, float minAllowed = 0, float maxAllowed = 0)
Parameters
Type | Name | Description |
---|---|---|
float | value | The value from which samples will be generated |
bool | shouldCheckValidRange | Whether the provided minAllowed and maxAllowed values should be used to validate the value provided |
float | minAllowed | The smallest min value allowed for this range |
float | maxAllowed | The largest max value allowed for this range |
Fields
value
The value from which samples will be generated
Declaration
public float value
Field Value
Type | Description |
---|---|
float |
Properties
maxAllowed
The largest value this sampler should output
Declaration
public float maxAllowed { get; set; }
Property Value
Type | Description |
---|---|
float |
minAllowed
The smallest value this sampler should output
Declaration
public float minAllowed { get; set; }
Property Value
Type | Description |
---|---|
float |
shouldCheckValidRange
Whether the provided minAllowed and maxAllowed values should be used to validate this sampler.
Declaration
public bool shouldCheckValidRange { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
CheckAgainstValidRange()
Checks if range valid
Declaration
public void CheckAgainstValidRange()
Sample()
Generates one sample
Declaration
public float Sample()
Returns
Type | Description |
---|---|
float | The generated sample |
Validate()
Validates that the sampler is configured properly
Declaration
public void Validate()