Four parts, including Simulation time, ArraryExtract, EnergyPlus simulator and SystemCommand actor, can be modified.
modify_xml(xmlpath, timeStep = 15 * 60, beginTime = 0, endTime = 4 * 24 * 3600, extractLength = 2, idf, epw, outname, programname = "Rscript", programArgs, workingDir, cpp = FALSE)
xmlpath | … see |
---|---|
timeStep | default = 15*60 secs. It depends on your timestep parameters in Energyplus file. By the way, both of the numerical value 15*60 and string "15*60" are supported. But if you want view your xml file, the string form is adviced since it makes you know your step is 15mins while the numerical value will show confused 900 secs in the BCVTB view. |
beginTime | default = 0. Zero means it begin with the date you set in the EnergyPlus file. Similarly, input a string `'1*24*3600'` is more recommended than a numerical value 1*24*3600. |
endTime | default = 4*24*3600. It indicates the co-simulation period is 4 days. |
extractLength | default = 2. It equals to the variables you want input to the EnergyPlus. |
idf | The idf path. Generally speaking, the idf should be in the root directory of your co-simulation project. Therefore, you can use `paste0(xmlpath,'/SmOffPSZ.idf')` to indicate your idf path if your idf name is SmOffPSZ. |
epw | The weather file path. |
outname | default = 'eplusout'. You can use outname to specify the name of messy simulation results files. |
programname | default = 'Rscript'. It means you use R exchange data with EnergyPlus. If you set up R path in your environment variable, you can leave it alone. Or you need specify the complete path of Rscript as 'Your path/R/bin/Rscript'. Similarly, you could set programname as 'python' if you use python to do the co-simulation with Energyplus. It is worth noting that you should list the complete path if you use your own C/C++ based application since there is no environment variable to specify its path. |
programArgs |
|
workingDir | The subfolder path (usually under your xmlpath) you place your script or application. If you use R, `paste0(xmlpath,'/R')` is a good choice. For python user, it is `paste0(xmlpath,'/python')`. For cpp user, it is `paste0(xmlpath,'/cpp')`. If there is no folder path as you specified, the function will create a new one. |
cpp | default = FALSE. If the external program is .exe or .sh, which is developed by yourself, the cpp should be set as TRUE |
The rootnode of the modified xml. It will be imported as the rootnode parameter.
See write_xml
.