Skip to content

Problem with equationCoefficientGenerator, minimal CGE model #4

@SmiAdam

Description

@SmiAdam

Hi, I'm trying to run a minimal CGE model (with files posted on https://www.copsmodels.com/minimal.htm) using this procedure but I'm having some troubles with the .tab code translated into R code. After the 'translation' the function equationCoefficientGenerator within model Reference Class have some trouble executing correctly. For example sometimes the code treats strings incorrectly e.g. "households" are called without quotations causing the code to break. Some of those can be worked around but with some I'm having no luck. For example minimal.tab contains function ABS[...] which translated into R remains surrounded by square brackets (rather than round bracket, consistent with R syntax).

Is there a way to easily access and edit equationCoefficientGenerator with some manual fixes? I tried equationCoefficientGenerator <- edit(equationCoefficientGenerator) but it produces an error:

Error in the command 'envRefSetField(...)':
'.->equationCoefficientGenerator' is not a field in class "GEModel"

I'm not very proficient in R so there might be a very simple solution but I wasn't able to find it after many attempts.

I would very much appreciate the assistance, if not with the source of the issue, then just with a way to manualy fix equationCoefficientGenerator - i think with trial and error I can iron out those problems with translation of the code.

Thanks,
Adam

Screenshots from translated code:

Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions