Package pulse.input
Class Range
-
- All Implemented Interfaces:
Serializable,Optimisable,Descriptive
public class Range extends PropertyHolder implements Optimisable
The actual physical range defined as aSegmentwith minimum and maximum values. This is used purely in context of the time sequence defined by theExperimentalData.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassign(ParameterVector params)Tries to assign the upper and lower bound based onparams.SegmentboundLimits(boolean isUpperBound)Calculates the allowed range for either the upper or lower bound.List<Double>[]filter(DiscreteInput input)Contains a data double array ([0] - x, [1] - y), where the data points have been filtered so that each x fits into this range.NumericPropertygetLowerBound()Gets the numeric property defining the lower bound of this range.SegmentgetSegment()Gets the segment representing this rangeNumericPropertygetUpperBound()Gets the numeric property defining the upper bound of this range.Set<NumericPropertyKeyword>listedKeywords()Lists lower and upper bounds as properties.voidoptimisationVector(ParameterVector output)The optimisation vector contain both the lower and upper bounds with the absolute constraints equal to a fourth of their values.voidreset(IndexRange range, List<Double> data)Resets the minimum and maximum values of this range to those specified by the elements ofdata, the indices of which correspond to the lower and upper bound of theIndexRange.voidset(NumericPropertyKeyword type, NumericProperty property)An abstract method, which must be overriden to gain access over setting the values of all relevant (selected by the programmer)NumericProperties in subclasses ofAccessible.voidsetLowerBound(NumericProperty p)Sets the lower bound and triggersfirePropertyChanged.voidsetUpperBound(NumericProperty p)Sets the upper bound and triggersfirePropertyChanged.StringtoString()protected voidupdateMinimum(NumericProperty p)Updates the lower bound of this range using the information contained inp.-
Methods inherited from class pulse.util.PropertyHolder
addListener, areDetailsHidden, data, describe, firePropertyChanged, getDescriptor, getListeners, getPrefix, ignoreSiblings, initListeners, isListedNumericType, isListedParameter, listedTypes, numericData, parameterListChanged, removeListeners, setPrefix, updateProperties, updateProperty
-
Methods inherited from class pulse.util.Accessible
accessibleChildren, genericProperties, genericProperty, numericProperties, numericProperty, property, update, update
-
Methods inherited from class pulse.util.UpwardsNavigable
addHierarchyListener, getHierarchyListeners, getParent, identify, removeHierarchyListener, removeHierarchyListeners, setParent, specificAncestor, tellParent
-
-
-
-
Constructor Detail
-
Range
public Range(List<Double> data)
Constructs aRangefrom the minimum and maximum values ofdata.- Parameters:
data- a list of double values
-
Range
public Range(double a, double b)Constructs a newRangebased on the segment specified byaandb- Parameters:
a- a double valueb- another double value
-
-
Method Detail
-
filter
public List<Double>[] filter(DiscreteInput input)
Contains a data double array ([0] - x, [1] - y), where the data points have been filtered so that each x fits into this range.- Parameters:
input-- Returns:
- a [2][...] array containing filtered x and y values
-
reset
public void reset(IndexRange range, List<Double> data)
Resets the minimum and maximum values of this range to those specified by the elements ofdata, the indices of which correspond to the lower and upper bound of theIndexRange.- Parameters:
range- an object specifying the start/end indices in regard to thedatalistdata- a list of double values (usually, a time sequence)
-
getLowerBound
public NumericProperty getLowerBound()
Gets the numeric property defining the lower bound of this range.- Returns:
- the lower bound (usually referring to a time sequence).
-
getUpperBound
public NumericProperty getUpperBound()
Gets the numeric property defining the upper bound of this range.- Returns:
- the upper bound (usually referring to a time sequence).
-
setLowerBound
public void setLowerBound(NumericProperty p)
Sets the lower bound and triggersfirePropertyChanged.- Parameters:
p- a numeric property with the requiredLOWER_BOUNDtype.
-
setUpperBound
public void setUpperBound(NumericProperty p)
Sets the upper bound and triggersfirePropertyChanged.- Parameters:
p- a numeric property with the requiredUPPER_BOUNDtype.
-
getSegment
public Segment getSegment()
Gets the segment representing this range- Returns:
- a segment
-
updateMinimum
protected void updateMinimum(NumericProperty p)
Updates the lower bound of this range using the information contained inp. Since this is not fail-safe, the method has been made protected.- Parameters:
p- aNumericPropertyrepresenting the laser pulse width.
-
set
public void set(NumericPropertyKeyword type, NumericProperty property)
Description copied from class:AccessibleAn abstract method, which must be overriden to gain access over setting the values of all relevant (selected by the programmer)
NumericProperties in subclasses ofAccessible. Typically this involves aswitchstatement that goes through the different options for thetypeand invokes differentset(...)methods to update the matchingNumericPropertywithproperty.- Specified by:
setin classAccessible- Parameters:
type- the type, which must be equal by definition toproperty.getType().property- the property, which contains new information.
-
listedKeywords
public Set<NumericPropertyKeyword> listedKeywords()
Lists lower and upper bounds as properties.- Overrides:
listedKeywordsin classPropertyHolder- Returns:
- a set of
NumericPropertyKeywordinstances, which have been explicitly marked as a listed parameter for thisPropertyHolder. - See Also:
PropertyHolder
-
boundLimits
public Segment boundLimits(boolean isUpperBound)
Calculates the allowed range for either the upper or lower bound.- Parameters:
isUpperBound- iftrue, will calculate the range for the upper bound, otherwise -- for the lower one.,- Returns:
- a Segment range of limits for the specific bound
-
optimisationVector
public void optimisationVector(ParameterVector output)
The optimisation vector contain both the lower and upper bounds with the absolute constraints equal to a fourth of their values.- Specified by:
optimisationVectorin interfaceOptimisable- Parameters:
output- the vector to be updated
-
assign
public void assign(ParameterVector params) throws SolverException
Tries to assign the upper and lower bound based onparams.- Specified by:
assignin interfaceOptimisable- Parameters:
params- anIndexedVectorwhich may contain the bounds.- Throws:
SolverException
-
-