Class extends OtherClass
MbSeries abstract | MbRocSystem | MbRoc
Use
There are several classes that can be used for data series, in interaction with the graph class (or apart from it). They are:
MbSeriesAbstract: abstract class, inherited by MbSeriesEquation and MbSeriesData
MbSeriesEquation: specify equation string and single variable
MbSeriesData: from a 2-D array
MbRocSystem: holds a system of related ROC equations.
MbRoc: used for ROC (rate of change) equations only
MbGraphingBoard handles all of these through setEquation EXCEPT if an RocSystem is required -- the MbRocSystem must be set up and loaded as individual series.
MbSeriesAbstract and descendants
Constructors
MbSeriesEquation(str_:String, vars_:String="x")
not sure if this can handle 2 variables....??
MbSeriesData(ser:Array)
Public Variables
Constants
type
| DOT | ||
| LINE | ||
| BAR |
Methods
traceSeries(msg:String="")
---- msg ----
x0,y0 (2 decimal places)
x1,y1
---- msg ----
capAt(maxY:Number)
caps the max Y -- mainly for graphing
normalizeBy(tot:Number)
divide y values by "tot"
...should update to calculate total y for normalizing as a default...
replaceData(ser:Array)
MbSeriesData only!
no similar method for MbSeriesEquation
Getters/Setters
getY(xx):Number
getSlope(xx):Number
getXAtPos(index):Number
getYAtPos(index):Number
setBounds(xFrom_:Number, xTo_:Number, step_:Number=0)
step size defaults to 1/200th of range
getSeries():Array {return(series);}
setTrans(xTrans:String, yTrans:String)
so far, choices are xTrans=="none" && yTrans == "log" | "none"
getSeriesLogY():Array
MbRocSystem
MbRoc can be an equation or a dataseries. All MbRoc's must use a common set of variables, defined in the constructor of the MbRocSystem.
var es:MbEquationSystem = new MbEquationSystem([ "s", "i", "r"]);
es.setNumTS(nDays);
es.addEquation("s", "s - "+pA+"*s*i", pS0 );
es.addEquation("i", "i+ "+pA+"*s*i - (1/"+pB+")*i", pI0 );
es.addEquation("r", "r + (1/"+pB+")*i", 1 );
es.makeAllSeries();
for (var i:int=0; i<3; ++i) {
g.doSeriesNum(i, es.getSeries(i));
g.doLineFormatNum(i, cols[i], 3);
}
g.doDraw();
addChild(g);
Constructors
MbRocSystem(varList:Array)
then use addEquation
Methods
addEquation(comp:String, equ:String, init:Number)
makeAllSeries():void
traceSeries(arr:Array)
Getters/Setters
getSeries(num:int) : Array
getVarList():Array
setStepSize(n:Number)
setNumTS(n:Number)
MbRoc
MbRoc is generally only used within a system.
Constructors
MbRoc():MbRoc
then use one of below:
setSeries(ser:Array)
setROC(str_:String, init_:Number=0, vars_:String="t", nSteps:int=100, stepSz_:Number=1)
Getters/Setters
setBoundsBySteps(xFrom_:Number, xTo_:Number)
getY(xx:Number):Number
getYAtPos(n:Number):Number
getSlope(xx:Number)
getSeriesLogY():Array
getSeries(x1:Number=-999, x2:Number=-999, step:Number=0):Array