Class SimpleOptimisationTask<T extends PropertyHolder & Optimisable>
- java.lang.Object
-
- pulse.util.UpwardsNavigable
-
- pulse.util.Group
-
- pulse.util.Accessible
-
- pulse.search.GeneralTask
-
- pulse.search.SimpleOptimisationTask<T>
-
- Type Parameters:
T- an optimisable object
- All Implemented Interfaces:
Serializable,Runnable,Descriptive
- Direct Known Subclasses:
PolylineOptimiser
public abstract class SimpleOptimisationTask<T extends PropertyHolder & Optimisable> extends GeneralTask
Generic optimisation class.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleOptimisationTask(T optimisable, DiscreteInput input)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<NumericPropertyKeyword>activeParameters()voidassign(ParameterVector pv)Tries to assign a selected set of parameters to the search vector used in optimisation.DiscreteInputgetInput()booleanisInProgress()voidrun()Runs this task if is eitherREADYorQUEUED.ParameterVectorsearchVector()Generates a search vector (= optimisation vector) using the search flags set by thePathSolver.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.voidsetDefaultOptimiser()-
Methods inherited from class pulse.search.GeneralTask
getBestState, getBuffer, getIterativeState, getResponse, intermediateProcessing, objectiveFunction, onSolverException, postProcessing, setIterativeState, setOptimiser, storeState
-
Methods inherited from class pulse.util.Accessible
accessibleChildren, genericProperties, genericProperty, numericProperties, numericProperty, property, update, update
-
Methods inherited from class pulse.util.Group
access, children, contents, getDescriptor, getSimpleName, subgroups
-
Methods inherited from class pulse.util.UpwardsNavigable
addHierarchyListener, describe, getHierarchyListeners, getParent, identify, initListeners, removeHierarchyListener, removeHierarchyListeners, setParent, specificAncestor, tellParent
-
-
-
-
Constructor Detail
-
SimpleOptimisationTask
public SimpleOptimisationTask(T optimisable, DiscreteInput input)
-
-
Method Detail
-
run
public void run()
Description copied from class:GeneralTaskRuns this task if is either
READYorQUEUED. Otherwise, will do nothing. After making some preparatory steps, will initiate a loop with successive calls toPathSolver.iteration(this), filling the buffer and notifying any data change listeners in parallel. This loop will go on until either converging results are obtained, or a timeout is reached, or if an execution error happens. Whether the run has been successful will be determined by comparing the associated R2 value with theSUCCESS_CUTOFF.- Specified by:
runin interfaceRunnable- Overrides:
runin classGeneralTask
-
searchVector
public ParameterVector searchVector()
Generates a search vector (= optimisation vector) using the search flags set by thePathSolver.- Specified by:
searchVectorin classGeneralTask- Returns:
- an
IndexedVectorwith search parameters of thisSearchTaks
-
assign
public void assign(ParameterVector pv) throws SolverException
Description copied from class:GeneralTaskTries to assign a selected set of parameters to the search vector used in optimisation.- Specified by:
assignin classGeneralTask- Parameters:
pv- a parameter vector containing all of the optimisation parameters whose values will be assigned to this task- Throws:
SolverException
-
isInProgress
public boolean isInProgress()
- Specified by:
isInProgressin classGeneralTask
-
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.
-
activeParameters
public List<NumericPropertyKeyword> activeParameters()
- Specified by:
activeParametersin classGeneralTask
-
setDefaultOptimiser
public void setDefaultOptimiser()
- Overrides:
setDefaultOptimiserin classGeneralTask
-
getInput
public DiscreteInput getInput()
- Specified by:
getInputin classGeneralTask
-
-