Learn R Programming

sensors4plumes (version 0.9.3)

optimisationCurve: Plot Optimisation Curve

Description

Generates algorithm-specific plots of optimisation or optimal sampling design(s).

Usage

optimisationCurve(optSD, type, nameSave, ...)

Arguments

optSD

result of optimiseSD

type

character, indicating type of optimisationFun used, of "ssa", "genetic", "greedy", "global", "manual"

nameSave

path of file where to save, without suffix, generates a .png file

...

parameters to be forwarded to png

Value

Generates a plot or a file with it, no value returned.

Details

The type of plot depends on the algorithm:

"ssa": curve of the cost in each iteration: proposed design (red dot), accepted design (blue line), best design until now (green line)

"genetic": two plots in one panel. Optimisation curve: mean (blue line) and best (green circles) cost in each iteration. Population: cost versus number of sensors in the final population. It may be useful to choose larger width as plots are placed beside each other.

"greedy": cost (blue) and number of sensors (red) in each iteration, combined in one plot with adjusted scales. Lowest cost is marked by solid dots.

"global": a barplot of all sampling designs, showing how many plumes are detected by 1st, 2nd, etc. sensor.

"manual": similar to the plots of "greedy".

Examples

Run this code
# NOT RUN {
data(SDgreedy)
curve_greedy1 = optimisationCurve(
  optSD = SDgreedy,
  type = "greedy")

data(SDgenetic)
curve_genetic1 = optimisationCurve(
  optSD = SDgenetic,
  type = "genetic")

data(SDglobal)
curve_global1 = optimisationCurve(
  optSD = SDglobal,
  type = "global")
  
data(SDmanual)  
curve_manual1 = optimisationCurve(
  optSD = SDmanual,
  type = "manual")


data(SDssa)
curve_ssa1 = optimisationCurve(
  optSD = SDssa,
  type = "ssa")

  
# }
# NOT RUN {
# generates a file
curve_global1 = optimisationCurve(
  optSD = SDglobal,
  type = "global",
  nameSave = "optSD_global",
  width = 600, height = 300)
# }

Run the code above in your browser using DataLab