fuzzylite  6.0
A Fuzzy Logic Control Library in C++
fl::RScriptExporter Class Reference

The RScriptExporter class is an Exporter that creates an R script to plot one or more surfaces of an engine for two input variables and any number of output variables. More...

#include <RScriptExporter.h>

Inheritance diagram for fl::RScriptExporter:
Collaboration diagram for fl::RScriptExporter:

Public Member Functions

 RScriptExporter ()
 
virtual ~RScriptExporter () FL_IOVERRIDE
 
virtual std::string name () const FL_IOVERRIDE
 Returns the name of the exporter. More...
 
void setMinimumColor (const std::string &minimumColor)
 Sets the color to represent the minimum values. More...
 
std::string getMinimumColor () const
 Gets the color to represent the minimum values. More...
 
void setMaximumColor (const std::string &maximumColor)
 Sets the color to represent the maximum values. More...
 
std::string getMaximumColor () const
 Gets the color to represent the maximum values. More...
 
void setContourColor (const std::string &contourColor)
 Sets the color to draw the contour lines. More...
 
std::string getContourColor () const
 Gets the color to draw the contour lines. More...
 
virtual std::string toString (const Engine *engine) const FL_IOVERRIDE
 Returns an R script plotting multiple surfaces based on a data frame generated with 1024 values in the scope of FldExporter::AllVariables for the first two input variables. More...
 
virtual std::string toString (Engine *engine, InputVariable *a, InputVariable *b, int values, FldExporter::ScopeOfValues scope, const std::vector< OutputVariable *> &outputVariables) const
 Returns an R script plotting multiple surfaces based on a data frame generated with the given number of values and scope for the two input variables. More...
 
virtual std::string toString (Engine *engine, InputVariable *a, InputVariable *b, std::istream &reader, const std::vector< OutputVariable *> &outputVariables) const
 Returns an R script plotting multiple surfaces based on the input stream of values for the two input variables. More...
 
virtual void toFile (const std::string &filePath, const Engine *engine) const FL_IOVERRIDE
 Creates an R script file plotting multiple surfaces based on a data frame generated with 1024 values in the scope of FldExporter::AllVariables for the two input variables. More...
 
virtual void toFile (const std::string &filePath, Engine *engine, InputVariable *a, InputVariable *b, int values, FldExporter::ScopeOfValues scope, const std::vector< OutputVariable *> &outputVariables) const
 Creates an R script file plotting multiple surfaces based on a data frame generated with the given number of values and scope for the two input variables. More...
 
virtual void toFile (const std::string &filePath, Engine *engine, InputVariable *a, InputVariable *b, std::istream &reader, const std::vector< OutputVariable *> &outputVariables) const
 Creates an R script file plotting multiple surfaces based on the input stream of values for the two input variables. More...
 
virtual void writeScriptImportingDataFrame (const Engine *engine, std::ostream &writer, InputVariable *a, InputVariable *b, const std::string &dataFramePath, const std::vector< OutputVariable *> &outputVariables) const
 Writes an R script plotting multiple surfaces based on a manually imported data frame containing the data for the two input variables on the output variables. More...
 
virtual void writeScriptExportingDataFrame (Engine *engine, std::ostream &writer, InputVariable *a, InputVariable *b, int values, FldExporter::ScopeOfValues scope, const std::vector< OutputVariable *> &outputVariables) const
 Writes an R script plotting multiple surfaces based on a data frame generated with the given number of values and scope for the two input variables on the output variables. More...
 
virtual void writeScriptExportingDataFrame (Engine *engine, std::ostream &writer, InputVariable *a, InputVariable *b, std::istream &reader, const std::vector< OutputVariable *> &outputVariables) const
 Writes an R script plotting multiple surfaces based on a data frame generated with the given number of values and scope for the two input variables on the output variables. More...
 
- Public Member Functions inherited from fl::Exporter
 Exporter ()
 
virtual ~Exporter ()
 

Protected Member Functions

virtual void writeScriptHeader (std::ostream &writer, const Engine *engine) const
 Writes the header of the R script (e.g., import libraries) More...
 
virtual void writeScriptPlots (std::ostream &writer, InputVariable *a, InputVariable *b, const std::vector< OutputVariable *> &outputVariables) const
 Writes the code to generate the surface plots for the input variables on the output variables. More...
 
virtual RScriptExporterclone () const FL_IOVERRIDE
 Creates a clone of the exporter. More...
 

Detailed Description

The RScriptExporter class is an Exporter that creates an R script to plot one or more surfaces of an engine for two input variables and any number of output variables.

Author
Juan Rada-Vilela, Ph.D.
See also
FldExporter
Exporter
Since
6.0

Definition at line 40 of file RScriptExporter.h.

Constructor & Destructor Documentation

◆ RScriptExporter()

fl::RScriptExporter::RScriptExporter ( )

◆ ~RScriptExporter()

virtual fl::RScriptExporter::~RScriptExporter ( )
virtual

Member Function Documentation

◆ clone()

virtual RScriptExporter* fl::RScriptExporter::clone ( ) const
protectedvirtual

Creates a clone of the exporter.

Returns
a clone of the exporter

Implements fl::Exporter.

◆ getContourColor()

std::string fl::RScriptExporter::getContourColor ( ) const

Gets the color to draw the contour lines.

Returns
the color to draw the contour lines

◆ getMaximumColor()

std::string fl::RScriptExporter::getMaximumColor ( ) const

Gets the color to represent the maximum values.

Returns
maximumColor is the color to represent the maximum values

◆ getMinimumColor()

std::string fl::RScriptExporter::getMinimumColor ( ) const

Gets the color to represent the minimum values.

Returns
the color to represent the minimum values

◆ name()

virtual std::string fl::RScriptExporter::name ( ) const
virtual

Returns the name of the exporter.

Returns
the name of the exporter

Implements fl::Exporter.

◆ setContourColor()

void fl::RScriptExporter::setContourColor ( const std::string &  contourColor)

Sets the color to draw the contour lines.

Parameters
contourColoris the color to draw the contour lines

◆ setMaximumColor()

void fl::RScriptExporter::setMaximumColor ( const std::string &  maximumColor)

Sets the color to represent the maximum values.

Parameters
maximumColoris the color to represent the maximum values

◆ setMinimumColor()

void fl::RScriptExporter::setMinimumColor ( const std::string &  minimumColor)

Sets the color to represent the minimum values.

Parameters
minimumColoris the color to represent the minimum values

◆ toFile() [1/3]

virtual void fl::RScriptExporter::toFile ( const std::string &  filePath,
const Engine engine 
) const
virtual

Creates an R script file plotting multiple surfaces based on a data frame generated with 1024 values in the scope of FldExporter::AllVariables for the two input variables.

Parameters
filePathis the full path of the R script file
engineis the engine to export

Reimplemented from fl::Exporter.

◆ toFile() [2/3]

virtual void fl::RScriptExporter::toFile ( const std::string &  filePath,
Engine engine,
InputVariable a,
InputVariable b,
int  values,
FldExporter::ScopeOfValues  scope,
const std::vector< OutputVariable *> &  outputVariables 
) const
virtual

Creates an R script file plotting multiple surfaces based on a data frame generated with the given number of values and scope for the two input variables.

Parameters
filePathis the full path of the R script file
engineis the engine to export
ais the first input variable
bis the second input variable
valuesis the number of values to evaluate the engine
scopeis the scope of the number of values to evaluate the engine
outputVariablesare the output variables to create the surface for

◆ toFile() [3/3]

virtual void fl::RScriptExporter::toFile ( const std::string &  filePath,
Engine engine,
InputVariable a,
InputVariable b,
std::istream &  reader,
const std::vector< OutputVariable *> &  outputVariables 
) const
virtual

Creates an R script file plotting multiple surfaces based on the input stream of values for the two input variables.

Parameters
filePathis the full path of the R script file
engineis the engine to export
ais the first input variable
bis the second input variable
readeris an input stream of data whose lines contain space-separated input values
outputVariablesare the output variables to create the surface for

◆ toString() [1/3]

virtual std::string fl::RScriptExporter::toString ( const Engine engine) const
virtual

Returns an R script plotting multiple surfaces based on a data frame generated with 1024 values in the scope of FldExporter::AllVariables for the first two input variables.

Parameters
engineis the engine to export
Returns
an R script plotting multiple surfaces for the first two input variables in the engine.

Implements fl::Exporter.

◆ toString() [2/3]

virtual std::string fl::RScriptExporter::toString ( Engine engine,
InputVariable a,
InputVariable b,
int  values,
FldExporter::ScopeOfValues  scope,
const std::vector< OutputVariable *> &  outputVariables 
) const
virtual

Returns an R script plotting multiple surfaces based on a data frame generated with the given number of values and scope for the two input variables.

Parameters
engineis the engine to export
ais the first input variable
bis the second input variable
valuesis the number of values to evaluate the engine
scopeis the scope of the number of values to evaluate the engine
outputVariablesare the output variables to create the surface for
Returns
an R script plotting multiple surfaces for the two input variables on the output variables.

◆ toString() [3/3]

virtual std::string fl::RScriptExporter::toString ( Engine engine,
InputVariable a,
InputVariable b,
std::istream &  reader,
const std::vector< OutputVariable *> &  outputVariables 
) const
virtual

Returns an R script plotting multiple surfaces based on the input stream of values for the two input variables.

Parameters
engineis the engine to export
ais the first input variable
bis the second input variable
readeris an input stream of data whose lines contain space-separated input values
outputVariablesare the output variables to create the surface for
Returns
an R script plotting multiple surfaces for the two input variables on the output variables

◆ writeScriptExportingDataFrame() [1/2]

virtual void fl::RScriptExporter::writeScriptExportingDataFrame ( Engine engine,
std::ostream &  writer,
InputVariable a,
InputVariable b,
int  values,
FldExporter::ScopeOfValues  scope,
const std::vector< OutputVariable *> &  outputVariables 
) const
virtual

Writes an R script plotting multiple surfaces based on a data frame generated with the given number of values and scope for the two input variables on the output variables.

Parameters
engineis the engine to export
writeris the output where the engine will be written to
ais the first input variable
bis the second input variable
valuesis the number of values to evaluate the engine
scopeis the scope of the number of values to evaluate the engine
outputVariablesare the output variables to create the surface for

◆ writeScriptExportingDataFrame() [2/2]

virtual void fl::RScriptExporter::writeScriptExportingDataFrame ( Engine engine,
std::ostream &  writer,
InputVariable a,
InputVariable b,
std::istream &  reader,
const std::vector< OutputVariable *> &  outputVariables 
) const
virtual

Writes an R script plotting multiple surfaces based on a data frame generated with the given number of values and scope for the two input variables on the output variables.

Parameters
engineis the engine to export
writeris the output where the engine will be written to
ais the first input variable
bis the second input variable
readeris an input stream of data whose lines contain space-separated input values
outputVariablesare the output variables to create the surface for

◆ writeScriptHeader()

virtual void fl::RScriptExporter::writeScriptHeader ( std::ostream &  writer,
const Engine engine 
) const
protectedvirtual

Writes the header of the R script (e.g., import libraries)

Parameters
writeris the output where the header will be written to
engineis the engine to export

◆ writeScriptImportingDataFrame()

virtual void fl::RScriptExporter::writeScriptImportingDataFrame ( const Engine engine,
std::ostream &  writer,
InputVariable a,
InputVariable b,
const std::string &  dataFramePath,
const std::vector< OutputVariable *> &  outputVariables 
) const
virtual

Writes an R script plotting multiple surfaces based on a manually imported data frame containing the data for the two input variables on the output variables.

Parameters
engineis the engine to export
writeris the output where the engine will be written to
ais the first input variable
bis the second input variable
dataFramePathis the path where the data frame should be located (the path will not be accessed, it will only be written to script)
outputVariablesare the output variables to create the surface for

◆ writeScriptPlots()

virtual void fl::RScriptExporter::writeScriptPlots ( std::ostream &  writer,
InputVariable a,
InputVariable b,
const std::vector< OutputVariable *> &  outputVariables 
) const
protectedvirtual

Writes the code to generate the surface plots for the input variables on the output variables.

Parameters
writeris the output where the engine will be written to
ais the first input variable
bis the second input variable
outputVariablesare the output variables to create the surface for

The documentation for this class was generated from the following file: