update_modules_embedding: Update Modules Embedding in GAMS code

Description Usage Arguments Note Author(s) Examples

View source: R/update_modules_embedding.R

Description

A function that updates in the GAMS code all include commands which are related to Modules. The function automatically checks which modules exist and which files in these modules exist and creates the corresponding include commands in GAMS

Usage

1
2
3
4
5
6
update_modules_embedding(
  modelpath = ".",
  modulepath = "modules/",
  includefile = "modules/include.gms",
  verbose = FALSE
)

Arguments

modelpath

Path to the model that should be updated (main folder).

modulepath

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

includefile

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

verbose

Defines whether additional information should be printed or not.

Note

Module phases are automatically detected checking the main code of the model, but not checking code in modules. If you want to use additional phases which are only included within a module, you need to specify them manually by adding a comment into your gams code indicating that there is an additional phase. The syntax is "* !add_phase!: <phase>", e.g. "* !add_phase!: new_phase"

Author(s)

Jan Philipp Dietrich

Examples

1
2
3
4
# copy dummymodel to temporary directory and update module embedding
file.copy(system.file("dummymodel",package="gms"),tempdir(), recursive = TRUE)
model   <- paste0(tempdir(),"/dummymodel")
update_modules_embedding(model)

gms documentation built on July 2, 2020, 2:36 a.m.