Menu Close

Importing an ST-Sim output to run the external programs

Syncrosim Forums ST-Sim & State-and-Transition Simulation Models Importing an ST-Sim output to run the external programs

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20822
    kbadikkbadik
    Participant

    I have an external program script via R that incorporates the recent output from the state attributes in order to return a raster to constrain treatment. Under the previous versions of ST-Sim and rsyncrosim, I had a working version but the new versions doesn’t like some that syntax. I’ve updated the code but still am getting an error message:
    Error in as.character.default(new(“Scenario”, projectId = 1, scenarioId = 1, :
    no method for coercing this S4 class to a vector
    Calls: datasheetRaster -> datasheetRaster
    Execution halted

    Thanks for any suggestions!

    #20823
    leonardo-fridleonardo-frid
    Keymaster

    Hi Kevin,

    Can you please let us know what versions of SyncroSim, ST-Sim and rsyncrosim you are currently using?

    Thanks,
    Leonardo

    #20824
    kbadikkbadik
    Participant

    SyncroSim = 2.3.7, ST-Sim = 3.3.5, rsyncrosim = 1.2.4. I just realized our rsyncrosim version is old.

    #20825
    kbadikkbadik
    Participant

    Here is a github link to the code: https://github.com/kbadik/ST-Sim/blob/0710c6ebc1689c05ff79d97faf6aaf762090b23d/External%20Program-SA%20Import

    data = Sys.getenv(“SSIM_TRANSFER_DIRECTORY”)
    sess = session(Sys.getenv(“SSIM_PROGRAM_DIRECTORY”))
    lib = ssimLibrary(Sys.getenv(“SSIM_LIBRARY_FILEPATH”), session = sess)
    scenarioId = as.numeric(Sys.getenv(“SSIM_SCENARIO_ID”))
    myScenario = scenario(lib, scenario = scenarioId)

    • This reply was modified 2 years, 3 months ago by kbadikkbadik.
    #20827
    leonardo-fridleonardo-frid
    Keymaster

    Thanks Kevin,

    Can you please upgrade rsyncrosim to the latest CRAN version (1.3.2 as of January 5, 2022) and let me know if that resolves your problem? There may be some version compatibility issues with the current SyncroSim version and the old version of rsyncrosim that you are running.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.