Package com.anylogic.engine.analysis
- java.lang.Object
- com.anylogic.engine.analysis.ChartItem
- com.anylogic.engine.analysis.BasicDataSet
- com.anylogic.engine.analysis.DataSet
- All Implemented Interfaces:
Serializable
public class DataSet extends BasicDataSet
A data set capable of storing 2D (X,Y) data of type double and maintaining the
up-to-date minimum and maximum of the stored data for each dimension. The data
set keeps a given limited number of the latest data items.
Please note that adding a new item when the dataset is full will cause loss of the oldest sample and, if the lost item contained minimum or maximum, will initiate a new search for min/max, which may be quite time consuming for large datasets. Therefore for large datasets it is recommended to have the size not less than the number of items yoiu plan to add.
Please note that adding a new item when the dataset is full will cause loss of the oldest sample and, if the lost item contained minimum or maximum, will initiate a new search for min/max, which may be quite time consuming for large datasets. Therefore for large datasets it is recommended to have the size not less than the number of items yoiu plan to add.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Constructor | Description |
---|---|
DataSet |
Constructs a 2D data set with data of type double with a given capacity.
|
DataSet |
Constructs a 2D data set with data of type double with a given capacity.
Registers the given updater so that dataset uses it while being updated. |
Modifier and Type | Method | Description |
---|---|---|
void | add |
Adds a new data item to the data set.
|
void | add |
Adds a new statechart state data item to the data set.
|
void | fillFrom |
Makes this dataset an exact copy of the given original dataset.
|
void | fillFrom |
Discards all existing data, sets the capacity to equal to the
number of entries in the given table function and fills the
dataset from the given table function.
|
String | getSVGDeltaAndMarkSynced | |
void | reset() |
Discards all stored data and their minimum/maximum.
|
void | setCapacity |
Resizes the data set according to the new capacity.
|
add, allowDuplicateX, allowDuplicateY, destroyUpdater_xjal, duplicateXAllowed, duplicateYAllowed, getCapacity, getPlainDataTable, getX, getXMax, getXMean, getXMedian, getXMin, getY, getYMax, getYMean, getYMedian, getYMin, size, toString, update
public DataSet(int capacity)
Constructs a 2D data set with data of type double with a given capacity.
- Parameters:
capacity
- the maximum number of (x,y) items the data set can store
public DataSet(int capacity, DataUpdater_xjal updater)
Constructs a 2D data set with data of type double with a given capacity.
Registers the given updater so that dataset uses it while being updated. Updater may be BasicDataSet.destroyUpdater_xjal() dropped off when no more needed, in order to improve memory performance.
Registers the given updater so that dataset uses it while being updated. Updater may be BasicDataSet.destroyUpdater_xjal() dropped off when no more needed, in order to improve memory performance.
- Parameters:
capacity
- the maximum number of (x,y) items the data set can storeupdater
- updater which may be used instead of overridingBasicDataSet.update()
method
public void add(double x, IStatechartState<?, ?> state)
Adds a new statechart state data item to the data set. If the data set is full, the oldest
item will be pushed out and lost. The minimum/maximum may change as a result of
both adding new and discarding old values and are recalculated.
- Parameters:
x
- the x value of the data item, usually timestate
- the y value of the data item, the state (ordinal number of the state will be used)
public void fillFrom(TableFunction tf)
Discards all existing data, sets the capacity to equal to the
number of entries in the given table function and fills the
dataset from the given table function.
- Overrides:
fillFrom
in classBasicDataSet
- Parameters:
tf
- the table function to copy data from
public void reset()
Discards all stored data and their minimum/maximum.
- Overrides:
reset
in classBasicDataSet
public void setCapacity(int newcapacity)
Resizes the data set according to the new capacity. As many as possible
of old data items will be kept. The minimum/maximum are recalculated.
- Overrides:
setCapacity
in classBasicDataSet
- Parameters:
newcapacity
- the new size of the data set
public void add(double x, double y)
Adds a new data item to the data set. If the data set is full, the oldest
item will be pushed out and lost. The minimum/maximum may change as a result of
both adding new and discarding old values and are recalculated.
- Overrides:
add
in classBasicDataSet
- Parameters:
x
- the x value of the data itemy
- the y value of the data item
public void fillFrom(BasicDataSet ds)
Makes this dataset an exact copy of the given original dataset.
- Overrides:
fillFrom
in classBasicDataSet
- Parameters:
ds
- the original dataset
@AnyLogicInternalAPI public String getSVGDeltaAndMarkSynced(boolean deltaonly)