|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.omegahat.Graphics.Primitives.GraphicalObject
|
+--org.omegahat.Graphics.Primitives.RGO
|
+--org.omegahat.Graphics.Primitives.GraphicalContainer
|
+--org.omegahat.Graphics.Plots.DynamicTimeSeriesStack
|
+--org.omegahat.Numerics.Optimizers.PlotListener
Objects to set up and maintain dynamic time-series stack plots to follow optimization.
Should be added twice to the optimizer; once as an iteration listener for events, and once as an information listener for iteration. The initial event causes the listener to create and initilize its plot stack. The information event causes the current model point to be added to the plot.
| Field Summary | |
protected java.lang.String[] |
names
The names to be used for the parameters. |
protected int |
nIterations
The number of iterations to be plotted (i.e., the X scale for the plots). |
protected boolean[] |
on
Turn the individual plots on or off. |
protected OptimizerIterator |
opt
|
protected ScaleInt[] |
scales
An array of ScaleInt references to scales for each of the plots. |
| Fields inherited from class org.omegahat.Graphics.Plots.DynamicTimeSeriesStack |
numSeries |
| Fields inherited from class org.omegahat.Graphics.Primitives.GraphicalContainer |
allocator, children, origin, parent, scaleX, scaleY |
| Fields inherited from class org.omegahat.Graphics.Primitives.RGO |
region |
| Fields inherited from class org.omegahat.Graphics.Primitives.GraphicalObject |
ACTIVE, fontSize, lastDevice, lastHeightCM, lastRegion, lastWidthCM, parents, status, VISIBLE |
| Fields inherited from interface org.omegahat.Environment.DataStructures.MathOperable |
DIVIDE, MINUS, MULTIPLY, PLUS |
| Constructor Summary | |
PlotListener()
|
|
PlotListener(ModelPointNumericInt xp,
OptimizerIterator opt)
|
|
| Method Summary | |
boolean |
continueIteration(IterationEvent ev)
The action called when the plot listener is registered as an iteration listener (for initialization only. |
ScaleInt |
defaultScale(double value)
The default scaling, given only the single value. |
ScaleInt |
defaultScale(int which,
ModelPointNumericInt model)
Compute the default scale for plot which from the model point. |
DynamicTimeSeries |
findPlot(int i)
Find the time-series plot, if any, for this index (as usual, 0 for the plot of values, etc.). |
java.lang.String[] |
getNames()
Accessor for names field |
int |
getNIterations()
Accessor for nIterations field |
boolean[] |
getOn()
Accessor for on field |
OptimizerIterator |
getOpt()
Accessor for opt field |
ScaleInt[] |
getScales()
Accessor for scales field |
void |
iterationPerformed(IterationEvent ev)
Method called on each iteration of the optimizer. |
void |
make(ModelPointNumericInt model,
OptimizerIterator opt)
The actual work of constructing the plot requires information about the model and, optionally, about the scales and which plots are desired. |
void |
makePlots(ModelPointNumericInt model,
int nIterations)
Fill in the DynamicTimeSeriesStack plotting object, given the scales. |
ScaleInt[] |
makeScales(ModelPointNumericInt model,
boolean initialize)
Construct scales and optionally initialize them to default (and very arbitrary) values. |
int |
nPlots(ModelPointNumericInt model)
The number of plots allocated for in the scales (1 + 2 * N, where N is the number of parameters). |
java.lang.String[] |
setNames(java.lang.String[] value)
Accessor for setting names field |
int |
setNIterations(int value)
Accessor for setting nIterations field |
boolean[] |
setOn(boolean[] value)
Accessor for setting on field |
OptimizerIterator |
setOpt(OptimizerIterator value)
Accessor for setting opt field |
ScaleInt |
setScale(int which,
double min,
double max)
Set an individual range. |
ScaleInt[] |
setScales(ScaleInt[] value)
Accessor for setting scales field |
| Methods inherited from class org.omegahat.Graphics.Plots.DynamicTimeSeriesStack |
addValue, addValues, editXScale, editYScale, getNumSeries, getTimeSeries, make |
| Methods inherited from class org.omegahat.Graphics.Primitives.GraphicalContainer |
add, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addGraphicalObject, addValue, copy, copy, draw, drawChildren, get, getChild, getChildCount, getChildren, getDevice, getOrigin, getRegionAllocator, getXScale, getYScale, parent, parent, remove, removeGraphicalObject, removeGraphicalObject, setOrigin, setRegionAllocator, setXScale, setYScale, subset, subset, transform, transform |
| Methods inherited from class org.omegahat.Graphics.Primitives.RGO |
center, centre, createRegionDescription, createRegionDescription, getRegion, height, height, setHJust, setRegion, setVJust, width, width, x, x, y, y |
| Methods inherited from class org.omegahat.Graphics.Primitives.GraphicalObject |
cacheSize, getFontSize, getFontSize, getParameters, getParents, getStatus, isActive, isVisible, lastHeightCM, lastRegion, lastWidthCM, parents, setActive, setParameters, setParents, setVisible |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.omegahat.Graphics.Primitives.GraphicalComponentInt |
getParameters, getRegion, isActive, isVisible, parents, setActive, setParameters, setRegion, setVisible |
| Field Detail |
protected OptimizerIterator opt
protected int nIterations
This defaults arbitrarily to half the maximum number of iterations when make is called.
protected boolean[] on
protected java.lang.String[] names
May be specified; if not, will be inferred from the model if possible.
protected ScaleInt[] scales
This mapping implies nothing about whether all these plots are to be produced; the individual scales will be null if a particular plot is not wanted.
| Constructor Detail |
public PlotListener()
public PlotListener(ModelPointNumericInt xp,
OptimizerIterator opt)
| Method Detail |
public void make(ModelPointNumericInt model,
OptimizerIterator opt)
Since the plot scales will only be reconstructed if its current definition is unset or inconsistent with the model, make can be called directly, followed by settings for any of the details, before fitting starts. If it is not, default settings will be chosen.
public OptimizerIterator getOpt()
opt fieldpublic OptimizerIterator setOpt(OptimizerIterator value)
opt fieldpublic int getNIterations()
nIterations fieldpublic int setNIterations(int value)
nIterations fieldpublic boolean[] getOn()
on fieldpublic boolean[] setOn(boolean[] value)
on fieldpublic java.lang.String[] getNames()
names fieldpublic java.lang.String[] setNames(java.lang.String[] value)
names fieldpublic ScaleInt[] getScales()
scales fieldpublic ScaleInt[] setScales(ScaleInt[] value)
scales fieldpublic void iterationPerformed(IterationEvent ev)
InformationListenerNote that by definition, this includes the initial state of the iteration, corresponding to the initial values.
iterationPerformed in interface InformationListenerpublic boolean continueIteration(IterationEvent ev)
continueIteration in interface IterationListener
public ScaleInt[] makeScales(ModelPointNumericInt model,
boolean initialize)
To construct the scales before the fitting starts, call the method with a null optimizer, and then set individual scales sensibly. Set the initialize argument to false if you plan to set all scales directly.
public ScaleInt defaultScale(double value)
We can't do much, so we set the scale to -3*value, +3*value and to an arbitrary -100., 100. for 0. values.
public ScaleInt defaultScale(int which,
ModelPointNumericInt model)
public int nPlots(ModelPointNumericInt model)
public ScaleInt setScale(int which,
double min,
double max)
The plots are indexed 0 for the value, 1 - N for the individual parameters, N+1 to 2*N for the elements of the gradient. Setting a scale does not alter whether the corresponding plot is currently on (use the elements of the on property for that).
public DynamicTimeSeries findPlot(int i)
public void makePlots(ModelPointNumericInt model,
int nIterations)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||