Menu Close

Identifying transition group IDs

Syncrosim Forums ST-Sim & State-and-Transition Simulation Models Identifying transition group IDs

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6043
    kbadikkbadik
    Participant

    Hi all,
    I’m trying to output specific spatial transitions via R and the rsyncosim package. Using the libraries from the Advanced Course last November, I’ve successfully subset the results to isolate individual transitions using this code:
    > myRastersTimestep5 = datasheetRaster(myProject, scenario=162, “STSim_OutputSpatialTransition”, timestep=5, subset=expression(grepl(“tg_489”,Filename,fixed=T)))

    The issue is I can’t figure out how to identify what transition the “tg_489” id is associated with? I’ve looked at the Types by Group ID but it doesn’t appear to be that. Is the “tg_XX” an internal code the software assigns?

    Thanks for any insight!
    Kevin

    #6045
    Leonardo FridLeonardo Frid
    Keymaster

    Hi Kevin,

    Yes, this is an internal code that is the primary key to the table. We are planning to have a way to access these codes that are project definition ID values in an upcoming release. In the meantime you can use the following code that requires the RSQLite package:

    > library(RSQLite)
    > myLibPath = “Path to your library/myLibrary.ssim
    > mySQLStatement = “Select TransitionGroupID, Name From STSim_TransitionGroup Where TransitionGroupID = 489”
    > myLib = dbConnect(RSQLite::SQLite(), myLibPath)
    > dbGetQuery(myLib, mySQLStatement)
    TransitionGroupID Name
    1 489 Fire

    Note that if you remove the where clause from the SQL statement you will get all the transition groups and their corresponding ID values.

    Let me know if you have any questions.

    Regards,
    Leonardo

    #6046
    kbadikkbadik
    Participant

    Thanks, Leonardo. I was able to replicate the code and think that I can transfer this to my own .ssim. Much appreciated!

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