Class RController
- java.lang.Object
-
- edu.kit.ipd.sdq.eventsim.rvisualization.RController
-
public final class RController extends Object
Controls communication with R via RServe.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTENT_VARIABLE
Variable name which is used in R to store data from RDS file as data table.static String
LOOKUP_TABLE_VARIABLE
static String
METADATA_COLUMN_NAME_PREFIX
by convention, any metadata column is expected to carry the specified prefix in order to recognize metadata columns automatically
-
Constructor Summary
Constructors Constructor Description RController(FilterModel model, FilterSelectionModel selectionModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Entity>
getAssemblyContexts()
Get available assembly contexts from the RDS file.String
getFilterExpression(FilterSelectionModel selectionModel)
int
getMeasurementsCount()
List<Entity>
getMeasuringPointsFrom()
List<Entity>
getMeasuringPointsTo()
int
getMemoryConsumptionInMB()
List<Metadata>
getMetadata(String name)
List<TranslatableEntity>
getMetadataNames()
List<TranslatableEntity>
getMetrics()
Get all metrics which are included in the RDS file.int
getNumberOfDiagramValues()
Get the number of values which are used for the diagram plot.int
getNumberOfTriggerInstances()
Get the number of trigger instances based on the given set of filters.int
getSimulationTimeMax()
Get the simulation time maximum of current data loaded from RDS file and stored inCONTENT_VARIABLE
.int
getSimulationTimeMin()
Get the simulation time minimum of current data loaded from RDS file and stored inCONTENT_VARIABLE
.double[]
getStatistics(String expression)
List<Entity>
getTriggerInstances()
Get all trigger instances based on the given set of filters.List<TranslatableEntity>
getTriggerTypes()
Get available triggers from the RDS file.void
initialize()
boolean
isConnected()
void
loadRDS(String path)
String
plotDiagramToFile(DiagramModel diagramModel, VariableBindingModel bindingModel, String diagramImagePath, String filterExpression)
Plot a diagram by R based on the given filters and stored in the given path.
-
-
-
Field Detail
-
CONTENT_VARIABLE
public static final String CONTENT_VARIABLE
Variable name which is used in R to store data from RDS file as data table.- See Also:
- Constant Field Values
-
LOOKUP_TABLE_VARIABLE
public static final String LOOKUP_TABLE_VARIABLE
- See Also:
- Constant Field Values
-
METADATA_COLUMN_NAME_PREFIX
public static final String METADATA_COLUMN_NAME_PREFIX
by convention, any metadata column is expected to carry the specified prefix in order to recognize metadata columns automatically- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RController
public RController(FilterModel model, FilterSelectionModel selectionModel)
-
-
Method Detail
-
initialize
public void initialize()
-
loadRDS
public void loadRDS(String path)
- Parameters:
path
- the path to the RDS file to be loaded. All occurrences of "\" will be converted to "/" for compliance with R.
-
getMetrics
public List<TranslatableEntity> getMetrics()
Get all metrics which are included in the RDS file.- Returns:
- List of all available metrics.
-
getTriggerInstances
public List<Entity> getTriggerInstances()
Get all trigger instances based on the given set of filters.- Returns:
- List of all trigger instances as
Entity
.
-
getNumberOfTriggerInstances
public int getNumberOfTriggerInstances()
Get the number of trigger instances based on the given set of filters.- Returns:
- Number of available trigger instances.
-
getTriggerTypes
public List<TranslatableEntity> getTriggerTypes()
Get available triggers from the RDS file.- Returns:
- List of triggers if available, otherwise null.
-
getAssemblyContexts
public List<Entity> getAssemblyContexts()
Get available assembly contexts from the RDS file.- Returns:
- List of assembly context elements if available, otherwise null.
-
getMetadataNames
public List<TranslatableEntity> getMetadataNames()
-
getNumberOfDiagramValues
public int getNumberOfDiagramValues()
Get the number of values which are used for the diagram plot.- Returns:
- Number of values.
-
getMeasurementsCount
public int getMeasurementsCount()
-
getMemoryConsumptionInMB
public int getMemoryConsumptionInMB()
-
getSimulationTimeMax
public int getSimulationTimeMax()
Get the simulation time maximum of current data loaded from RDS file and stored inCONTENT_VARIABLE
.- Returns:
- Simulation time maximum.
-
getSimulationTimeMin
public int getSimulationTimeMin()
Get the simulation time minimum of current data loaded from RDS file and stored inCONTENT_VARIABLE
.- Returns:
- Simulation time minimum.
-
getStatistics
public double[] getStatistics(String expression)
-
getFilterExpression
public String getFilterExpression(FilterSelectionModel selectionModel)
-
plotDiagramToFile
public String plotDiagramToFile(DiagramModel diagramModel, VariableBindingModel bindingModel, String diagramImagePath, String filterExpression)
Plot a diagram by R based on the given filters and stored in the given path.- Parameters:
type
- Type of the diagram (DiagramType
).diagramImagePath
- Path where the image of the diagram should be stored.diagramTitle
- Diagram title.diagramSubTitle
- Diagram sub title.- Throws:
Exception
- If invalid diagram type was used.
-
isConnected
public boolean isConnected()
-
-