Class RController


  • public final class RController
    extends Object
    Controls communication with R via RServe.
    • 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
      • 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
    • 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.
      • getMeasuringPointsTo

        public List<Entity> getMeasuringPointsTo()
      • getMeasuringPointsFrom

        public List<Entity> getMeasuringPointsFrom()
      • 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.
      • 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 in CONTENT_VARIABLE.
        Returns:
        Simulation time maximum.
      • getSimulationTimeMin

        public int getSimulationTimeMin()
        Get the simulation time minimum of current data loaded from RDS file and stored in CONTENT_VARIABLE.
        Returns:
        Simulation time minimum.
      • getStatistics

        public double[] getStatistics​(String expression)
      • 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()