Learn R Programming

foreSIGHT (version 0.9.81)

quickSpace: quickSpace

Description

Master function - generates perturbed climate scenarios, generates performance, visualizes performanace and superimposes climate projection information on to the system performance spaces

Usage

quickSpace(obs=NULL,                          
             modelTag="Simple-ann",                   
             attPerturb=NULL,                  
             attHold=NULL,                     
             attPenalty=NULL,                  
             optimArgs=list(pcrossover= 0.8,   
                            pmutation=0.1,
                            maxiter=10,
                            maxFitness=-0.001,
                            popSize = 100,
                            run=20,
                            seed = NULL,
                            parallel = FALSE,
                            keepBest=TRUE,
                            lambda.mult=0.0
                 ),
             exSpArgs=list(),
             simLengthNyrs=NULL,
             systemModel=NULL,
             systemArgs=NULL,
             plotTag="Heat",
             plotArgs=NULL,
             IOmode="suppress",    
             arrayID=NULL,        
             nSeed=NULL,
             climdata=NULL,
             climArgs=list(),
             simDirectory="Simulation1")

Arguments

obs

A dataframe of observed climate data in the form Year Month Day P Temp.

modelTag

A character vector of which stochastic models to use to create each climate variable.Supported tags are shown under details below.

attPerturb

A character vector of climate attributes to hold at a target. A list of all supported attributes can be found under details below.

attHold

A character vector of climate attributes to hold at a target. A list of all supported attributes can be found under under details below.

attPenalty

A character vector of climate attributes to place specific focus on during targeting via the use of a penalty function during the optimisation process.

optimArgs

A list controlling the search algorithm with the following components:

pcrossover

a value of probability of crossover. Defaults to 0.8.

pmutation

a value of probability of mutation. Defaults to 0.1

maxiter

a value of the maximum number of generations. Defaults to 50

maxFitness

a value of the stopping criteria. Defaults to 0.001

popSize

a value of the population size. Defaults to 100

run

a value of an alternative stopping criteria - consecutive runs without improvement in fitness. Defaults to 0.001

seed

a value of the random seed. Defaults to NULL

parallel

specifies if parallel computing should be used. Defaults to False. Can be set to the number of desired cores, or TRUE, where it will detect the number of available cores and run.

keepBest

specifies if the optimisation should keep the best solution in each generation. Defaults to TRUE.

lambda.mult

A multiplier used during the optimisation for primary attributes. Defaults to zero.

exSpArgs

a list to control the exposure space creation with the following components:

type

a string that specifies the type of sampling. Defaults to regular spacing.

samp

a vector indicating the number of targets for each attribute in attSel.

bounds

a list containing elements for attributes listed in attSel, where each attribute has bounds specified. This should be a single value for a stationary target, and a vector of min and max change for primary attributes. Works with samp to create number of step sizes. Defaults with samp to only reproduce historical weather.

simLengthNyrs

A scalar that specifies the length in years of each generated scenario. Only used with stochastic generation.

systemModel

a function name. The function name of the system model used to generate system performance. The system model must have the arguments data and systemArgs.

systemArgs

A list containing all the arguments that are required to control the system model.

plotTag

A character vector which designates how the performance space is visualised. Options are: "Heat", "Contours" or "OAT".

plotArgs

A list controlling how the performance space is visualised with the following components:

title

a string that is used as the title label.

legendtitle

a string that is used to label the legend.

xlim

x axis limits.

ylim

y axis limits.

performancelimits

z axis limits.

lowfill

a string specifying the colour for lower values of performance. Default is "red". For use with plotTag="Heat".

highfill

a string specificying the colour for the high values of performance. Default is "yellow". A colour ramp will be created between this and the lowfill. For use with plotTag="Heat".

contour

a TRUE/FALSE toggle for whether or not contour lines are overlaid. Default is TRUE. For use with plotTag="Heat".

contourlevels

a vector specifying the levels at which controus will be drawn. For use with plotTag = "Contours".

IOmode

A string that specifies the input-output mode for the scenarios = "verbose", "dev" or "suppress".

arrayID

A scalar used to append output file names - only used in IOmode="dev".

nSeed

A scalar used to specify the number of seeds (in this case replicates) for the stochastic generation of time series.

climdata

a data frame of the projected climate data

climArgs

a list that controls the appearance of the superimposed climate projections with the following components:

colour

a string that is used to set the colour of the superimposed climate drojections. Defaults to black.

fill

a string that is used to determine whether the system performance resulting from the climate projections should also be displayed. Set to "Performance" to infill climate projections according to their system performance.

simDirectory

A string used to label the output directory.

Details

modelTag provides the main function with requested models. modelTag is vector of any of the following supported models:

  1. "Simple-ann"a simple annual scaling

  2. "P-ann-wgen"a four parameter annual rainfall model

  3. "P-seas-wgen"a 16 parameter seasonal rainfall model

  4. "P-har6-wgen"a harmonic rainfall model with 6 periods

  5. "P-har12-wgen"a harmonic rainfall model

  6. "P-har12-wgen-FS"a harmonic rainfall model where seasonality is fixed (phase angles must be specified via modelInfoMod=list("P-har12-wgen-FS"=fixedPars=c(x,x,x,x))

  7. "P-har26-wgen"a harmonic rainfall model

  8. "P-2har26-wgen"a double harmonic rainfall model

  9. "Temp-har26-wgen"a harmonic temperature model not conditional on rainfall

  10. "Temp-har26-wgen-wd"a harmonic temperature model dependent on wet or dry day

  11. "Temp-har26-wgen-wdsd"a harmonic temperature model where standard deviation parameters are dependent on wet or dry day

  12. "PET-har12-wgen"a harmonic potential evapotranspiration model

  13. "PET-har26-wgen"a harmonic potential evapotranspiration model

  14. "PET-har26-wgen-wd"a harmonic potential evapotranspiration model dependent on wet or dry day

  15. "Radn-har26-wgen"a harmonic solar radiation model (MJ/m2)

The list of attributes supported by attSel are:

  1. "P_ann_tot_m"

  2. "P_ann_R10_m"

  3. "P_ann_maxDSD_m"

  4. "P_ann_maxWSD_m"

  5. "P_ann_P99_m"

  6. "P_ann_dyWet99p_m"

  7. "P_ann_ratioWS_m"

  8. "Temp_ann_avg_m"

  9. "Temp_ann_P5_m"

  10. "Temp_ann_P95_m"

  11. "Temp_ann_F0_m"

  12. "P_ann_dyWet_m"

  13. "P_ann_DSD_m"

  14. "P_seas_tot_cv"

  15. "P_mon_tot_cv"

  16. "P_ann_avgWSD_m"

  17. "P_ann_avgDSD_m"

  18. "P_JJA_avgWSD_m"

  19. "P_MAM_avgWSD_m"

  20. "P_DJF_avgWSD_m"

  21. "P_SON_avgWSD_m"

  22. "P_JJA_avgDSD_m"

  23. "P_MAM_avgDSD_m"

  24. "P_DJF_avgDSD_m"

  25. "P_SON_avgDSD_m"

  26. "Temp_ann_GSL_m"

  27. "Temp_ann_CSL_m"

  28. "P_JJA_dyWet_m"

  29. "P_MAM_dyWet_m"

  30. "P_DJF_dyWet_m"

  31. "P_SON_dyWet_m"

  32. "P_JJA_tot_m"

  33. "P_MAM_tot_m"

  34. "P_DJF_tot_m"

  35. "P_SON_tot_m"

  36. "P_ann_nWet_m"

  37. "P_ann_dyAll_m"

  38. "P_JJA_dyAll_m"

  39. "P_MAM_dyAll_m"

  40. "P_DJF_dyAll_m"

  41. "P_SON_dyAll_m"

  42. "PET_ann_avg_m"

  43. "PET_ann_tot_m"

  44. "PET_ann_rng_m"

  45. "Temp_ann_rng_m"

  46. "PET_ann_90pX_m"

  47. "P_ann_90X_m"

  48. "P_ann_seasRatio_m"

  49. "PET_ann_P5_m"

  50. "PET_ann_P95_m"

  51. "P_Jan_tot_m"

  52. "P_Feb_tot_m"

  53. "P_Mar_tot_m"

  54. "P_Apr_tot_m"

  55. "P_May_tot_m"

  56. "P_Jun_tot_m"

  57. "P_Jul_tot_m"

  58. "P_Aug_tot_m"

  59. "P_Sep_tot_m"

  60. "P_Oct_tot_m"

  61. "P_Nov_tot_m"

  62. "P_Dec_tot_m"

  63. "Temp_JJA_avg_m"

  64. "Temp_MAM_avg_m"

  65. "Temp_DJF_avg_m"

  66. "Temp_SON_avg_m"

  67. "Temp_Jan_avg_m"

  68. "Temp_Feb_avg_m"

  69. "Temp_Mar_avg_m"

  70. "Temp_Apr_avg_m"

  71. "Temp_May_avg_m"

  72. "Temp_Jun_avg_m"

  73. "Temp_Jul_avg_m"

  74. "Temp_Aug_avg_m"

  75. "Temp_Sep_avg_m"

  76. "Temp_Oct_avg_m"

  77. "Temp_Nov_avg_m"

  78. "Temp_Dec_avg_m"

  79. "PET_JJA_avg_m"

  80. "PET_MAM_avg_m"

  81. "PET_DJF_avg_m"

  82. "PET_SON_avg_m"

  83. "PET_JJA_tot_m"

  84. "PET_MAM_tot_m"

  85. "PET_DJF_tot_m"

  86. "PET_SON_tot_m"

  87. "PET_Jan_tot_m"

  88. "PET_Feb_tot_m"

  89. "PET_Mar_tot_m"

  90. "PET_Apr_tot_m"

  91. "PET_May_tot_m"

  92. "PET_Jun_tot_m"

  93. "PET_Jul_tot_m"

  94. "PET_Aug_tot_m"

  95. "PET_Sep_tot_m"

  96. "PET_Oct_tot_m"

  97. "PET_Nov_tot_m"

  98. "PET_Dec_tot_m"

  99. "PET_Jan_avg_m"

  100. "PET_Feb_avg_m"

  101. "PET_Mar_avg_m"

  102. "PET_Apr_avg_m"

  103. "PET_May_avg_m"

  104. "PET_Jun_avg_m"

  105. "PET_Jul_avg_m"

  106. "PET_Aug_avg_m"

  107. "PET_Sep_avg_m"

  108. "PET_Oct_avg_m"

  109. "PET_Nov_avg_m"

  110. "PET_Dec_avg_m"

  111. "PET_ann_seasRatio_m"

  112. "Radn_ann_avg_m"

  113. "Radn_ann_tot_m"

  114. "Radn_ann_rng_m"

  115. "Radn_ann_P5_m"

  116. "Radn_ann_P95_m"

  117. "Radn_JJA_avg_m"

  118. "Radn_MAM_avg_m"

  119. "Radn_DJF_avg_m"

  120. "Radn_SON_avg_m"

  121. "Radn_JJA_tot_m"

  122. "Radn_MAM_tot_m"

  123. "Radn_DJF_tot_m"

  124. "Radn_SON_tot_m"

  125. "Radn_Jan_tot_m"

  126. "Radn_Feb_tot_m"

  127. "Radn_Mar_tot_m"

  128. "Radn_Apr_tot_m"

  129. "Radn_May_tot_m"

  130. "Radn_Jun_tot_m"

  131. "Radn_Jul_tot_m"

  132. "Radn_Aug_tot_m"

  133. "Radn_Sep_tot_m"

  134. "Radn_Oct_tot_m"

  135. "Radn_Nov_tot_m"

  136. "Radn_Dec_tot_m"

  137. "Radn_Jan_avg_m"

  138. "Radn_Feb_avg_m"

  139. "Radn_Mar_avg_m"

  140. "Radn_Apr_avg_m"

  141. "Radn_May_avg_m"

  142. "Radn_Jun_avg_m"

  143. "Radn_Jul_avg_m"

  144. "Radn_Aug_avg_m"

  145. "Radn_Sep_avg_m"

  146. "Radn_Oct_avg_m"

  147. "Radn_Nov_avg_m"

  148. "Radn_Dec_avg_m"

  149. "Radn_ann_seasRatio_m"