Class Calculation
- java.lang.Object
-
- pulse.util.UpwardsNavigable
-
- pulse.util.Group
-
- pulse.util.Accessible
-
- pulse.util.PropertyHolder
-
- pulse.tasks.Calculation
-
- All Implemented Interfaces:
Serializable,Comparable<Calculation>,Response,Descriptive
public class Calculation extends PropertyHolder implements Comparable<Calculation>, Response
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static doubleRELATIVE_TIME_MARGIN
-
Constructor Summary
Constructors Constructor Description Calculation(Calculation c)Creates an orphan Calculation, retaining some properties of the argumentCalculation(SearchTask t)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SegmentaccessibleRange()voidclear()intcompareTo(Calculation arg0)Compares two calculations based on their model selection criteria.voidconformTo(UpwardsNavigable owner)booleanequals(Object obj)doubleevaluate(double t)ModelSelectionCriteriongetModelSelectionCriterion()static InstanceDescriptor<? extends ModelSelectionCriterion>getModelSelectionDescriptor()OptimiserStatisticgetOptimiserStatistic()ProblemgetProblem()ResultgetResult()DifferenceSchemegetScheme()StatusgetStatus()inthashCode()protected voidinitModelCriterion(Statistic res)voidinitOptimiser()booleanisBetterThan(Calculation a)Checks if thisCalculationis better thana.doubleobjectiveFunction(GeneralTask task)This will use the currentDifferenceSchemeto solve theProblemfor thisSearchTaskand calculate the SSR value showing how well (or bad) the calculated solution describes theExperimentalData.voidprocess()This will use the currentDifferenceSchemeto solve theProblemfor thisCalculation.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.voidsetModelSelectionCriterion(ModelSelectionCriterion rs)voidsetOptimiserStatistic(OptimiserStatistic os)voidsetProblem(Problem problem, ExperimentalData curve)After setting and adopting theproblemby thisSearchTask, this will attempt to change the parameters of thatproblemin accordance with the loadedExperimentalDatafor thisSearchTask(if not null).Later, if any changes to the properties of thatProblemoccur and if the source of that event is either theMetadataor thePropertyHolderTable, they will be accounted for by altering the parameters of theproblemaccordingly -- immediately after the former take place.voidsetResult(Result result)voidsetScheme(DifferenceScheme scheme, ExperimentalData curve)Adopts theschemeby thisSearchTaskand updates the time limit ofschemeto matchExperimentalData.booleansetStatus(Status status)Attempts to set the status of this calculation tostatus.NumericPropertyweight(List<Calculation> all)-
Methods inherited from class pulse.util.PropertyHolder
addListener, areDetailsHidden, data, describe, firePropertyChanged, getDescriptor, getListeners, getPrefix, ignoreSiblings, initListeners, isListedNumericType, isListedParameter, listedKeywords, 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
-
-
-
-
Field Detail
-
RELATIVE_TIME_MARGIN
public static final double RELATIVE_TIME_MARGIN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Calculation
public Calculation(SearchTask t)
-
Calculation
public Calculation(Calculation c)
Creates an orphan Calculation, retaining some properties of the argument- Parameters:
c- another calculation to be archived.
-
-
Method Detail
-
conformTo
public void conformTo(UpwardsNavigable owner)
-
clear
public void clear()
-
setProblem
public void setProblem(Problem problem, ExperimentalData curve)
After setting and adopting the
problemby thisSearchTask, this will attempt to change the parameters of thatproblemin accordance with the loadedExperimentalDatafor thisSearchTask(if not null).Later, if any changes to the properties of thatProblemoccur and if the source of that event is either theMetadataor thePropertyHolderTable, they will be accounted for by altering the parameters of theproblemaccordingly -- immediately after the former take place.- Parameters:
problem- aProblemcurve-
-
setScheme
public void setScheme(DifferenceScheme scheme, ExperimentalData curve)
Adopts theschemeby thisSearchTaskand updates the time limit ofschemeto matchExperimentalData.- Parameters:
scheme- theDiffenceScheme.curve-
-
process
public void process() throws SolverExceptionThis will use the currentDifferenceSchemeto solve theProblemfor thisCalculation.- Throws:
SolverException
-
getStatus
public Status getStatus()
-
setStatus
public boolean setStatus(Status status)
Attempts to set the status of this calculation tostatus.- Parameters:
status- a status- Returns:
trueif this attempt is successful, including the case when the status being set is equal to the current status.falseif the current status is one of the following:DONE,EXECUTION_ERROR,INCOMPLETE,IN_PROGRES, AND thestatusbeing set isQUEUED.
-
weight
public NumericProperty weight(List<Calculation> all)
-
setModelSelectionCriterion
public void setModelSelectionCriterion(ModelSelectionCriterion rs)
-
getModelSelectionCriterion
public ModelSelectionCriterion getModelSelectionCriterion()
-
setOptimiserStatistic
public void setOptimiserStatistic(OptimiserStatistic os)
-
getOptimiserStatistic
public OptimiserStatistic getOptimiserStatistic()
- Specified by:
getOptimiserStatisticin interfaceResponse
-
getProblem
public Problem getProblem()
-
initOptimiser
public void initOptimiser()
-
initModelCriterion
protected void initModelCriterion(Statistic res)
-
getScheme
public DifferenceScheme getScheme()
-
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.
-
isBetterThan
public boolean isBetterThan(Calculation a)
Checks if thisCalculationis better thana.- Parameters:
a- another completed calculation- Returns:
trueif another calculation hasn't been completed or if this calculation's statistic is lower than statistic ofa.
-
compareTo
public int compareTo(Calculation arg0)
Compares two calculations based on their model selection criteria.- Specified by:
compareToin interfaceComparable<Calculation>- Parameters:
arg0- another calculation- Returns:
- the result of comparing the model selection statistics of
thisandarg0.
-
getModelSelectionDescriptor
public static InstanceDescriptor<? extends ModelSelectionCriterion> getModelSelectionDescriptor()
-
getResult
public Result getResult()
-
setResult
public void setResult(Result result)
-
accessibleRange
public Segment accessibleRange()
- Specified by:
accessibleRangein interfaceResponse
-
objectiveFunction
public double objectiveFunction(GeneralTask task) throws SolverException
This will use the currentDifferenceSchemeto solve theProblemfor thisSearchTaskand calculate the SSR value showing how well (or bad) the calculated solution describes theExperimentalData.- Specified by:
objectiveFunctionin interfaceResponse- Parameters:
task-- Returns:
- the value of SSR (sum of squared residuals).
- Throws:
SolverException
-
-