Learn R Programming

gms (version 0.31.2)

module.skeleton: Create a Module skeleton

Description

This function creates you a module skeleton which you can use to easily create your own modules.

Usage

module.skeleton(
  number,
  name,
  types,
  modelpath = ".",
  modulepath = "modules/",
  includefile = "modules/include.gms",
  version = is.modularGAMS(modelpath, version = TRUE)
)

Arguments

number

Number of your module, typically something between 0-99. Sorts the execution of your modules. Please use a number which is not used, yet.

name

Name of your module (please choose a short name). If you want to extend an existing module (add a new realisation) use the name of the existing one.

types

Vector of names for the different module types (e.g. "on" or "off"). If you want to extend an existing module (add a new realisation), put here the additional type(s)

modelpath

Path of the MAgPIE version that should be updated (main folder).

modulepath

Module path within MAgPIE (relative to the MAgPIE main folder)

includefile

Name and location of the file which includes all modules (relative to main folder)

version

version of the modular GAMS code structure (1 or 2)

Author

Jan Philipp Dietrich

Examples

Run this code
# copy dummymodel to temporary directory and add new module "bla"
file.copy(system.file("dummymodel",package="gms"),tempdir(), recursive = TRUE)
model   <- paste0(tempdir(),"/dummymodel")
module.skeleton(number="03", name="bla", types=c("on","off"), modelpath=model)

Run the code above in your browser using DataLab