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()
void
assign(ParameterVector pv)
Tries to assign a selected set of parameters to the search vector used in optimisation.DiscreteInput
getInput()
boolean
isInProgress()
void
run()
Runs this task if is eitherREADY
orQUEUED
.ParameterVector
searchVector()
Generates a search vector (= optimisation vector) using the search flags set by thePathSolver
.void
set(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)NumericPropert
ies in subclasses ofAccessible
.void
setDefaultOptimiser()
-
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:GeneralTask
Runs this task if is either
READY
orQUEUED
. 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:
run
in interfaceRunnable
- Overrides:
run
in classGeneralTask
-
searchVector
public ParameterVector searchVector()
Generates a search vector (= optimisation vector) using the search flags set by thePathSolver
.- Specified by:
searchVector
in classGeneralTask
- Returns:
- an
IndexedVector
with search parameters of thisSearchTaks
-
assign
public void assign(ParameterVector pv) throws SolverException
Description copied from class:GeneralTask
Tries to assign a selected set of parameters to the search vector used in optimisation.- Specified by:
assign
in 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:
isInProgress
in classGeneralTask
-
set
public void set(NumericPropertyKeyword type, NumericProperty property)
Description copied from class:Accessible
An abstract method, which must be overriden to gain access over setting the values of all relevant (selected by the programmer)
NumericPropert
ies in subclasses ofAccessible
. Typically this involves aswitch
statement that goes through the different options for thetype
and invokes differentset(...)
methods to update the matchingNumericProperty
withproperty
.- Specified by:
set
in 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:
activeParameters
in classGeneralTask
-
setDefaultOptimiser
public void setDefaultOptimiser()
- Overrides:
setDefaultOptimiser
in classGeneralTask
-
getInput
public DiscreteInput getInput()
- Specified by:
getInput
in classGeneralTask
-
-