Class REngineHelper
java.lang.Object
de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.utils.REngineHelper
Provides helper method for working with the R engine and the SensorFramework. The class offers
methods for feeding sensor data into R and may later also provide methods for more complex
commands and calculation.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Transfer data to R by the specified type. -
Field Summary
Modifier and TypeFieldDescriptionstatic final REngineHelper.TransferType
The default setting for data transfer to R. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
storeMeasurementsInRVector
(SensorAndMeasurements measurements, int sensorNumber, RReport.TimeseriesData dataSelection, RConnection rConnection) Convenience method, callsstoreMeasurementsInRVector(SensorAndMeasurements, int, TimeseriesData, TransferType, RConnection)
with the standardREngineHelper.TransferType
which isTransferType.MEMORY
.static String
storeMeasurementsInRVector
(SensorAndMeasurements measurements, int sensorNumber, RReport.TimeseriesData dataSelection, REngineHelper.TransferType transferType, RConnection rConnection) Export the measurements of a sensor to R.
-
Field Details
-
TRANSFER_TYPE
The default setting for data transfer to R.
-
-
Constructor Details
-
REngineHelper
public REngineHelper()
-
-
Method Details
-
storeMeasurementsInRVector
public static String storeMeasurementsInRVector(SensorAndMeasurements measurements, int sensorNumber, RReport.TimeseriesData dataSelection, RConnection rConnection) Convenience method, callsstoreMeasurementsInRVector(SensorAndMeasurements, int, TimeseriesData, TransferType, RConnection)
with the standardREngineHelper.TransferType
which isTransferType.MEMORY
.- Parameters:
measurements
- Measurements for a sensor.sensorNumber
- number of the sensor vector in R.dataSelection
- the data element to save.rConnection
- Connection to the R engine.- Returns:
- R variable name which contains the data.
-
storeMeasurementsInRVector
public static String storeMeasurementsInRVector(SensorAndMeasurements measurements, int sensorNumber, RReport.TimeseriesData dataSelection, REngineHelper.TransferType transferType, RConnection rConnection) Export the measurements of a sensor to R. There are two alternatives. The measurements can be transferred via an array, which implies certain size restrictions. An alternative is to use a temporary file. The behavior can only be switched in source code by the constantTRANSFER_TYPE
. Variable names in R are as follows:
For timespan data: "sensor" + #
For eventtime data: "sensor" + # + "_ET")- Parameters:
measurements
- Measurements for a sensor.sensorNumber
- number of the sensor vector in R.dataSelection
- the data element to save.rConnection
- Connection to the R engine.- Returns:
- R variable name which contains the data.
-