September 20, 2018 at 6:16 pm #6195Leonardo FridKeymaster
How do you copy an existing primary stratum and all of its associated scenario properties into a project and scenario that has already been created and contains other strata?
1. In the destination project add the new stratum definition by inserting a new row with the stratum name to Project | Properties | Strata | Primary Stratum.
2. Ensure that all other definitions (i.e., state classes, transition types, transition groups, etc…) match for both the source and destination project.
3. For each scenario property that you would like to copy from the source to the destination project export that scenario property to excel and save it ensuring it only includes records for the primary stratum you would like to have copied.
4. Back in SyncroSim navigate to the destination scenario and for each property that you would like to add data for the new stratum select import and point to the corresponding excel file that was exported in the previous step. When importing choose the Append option.
5. For example to import the Transition Pathways | States:
a. Navigate to Scenario | Properties | Transition Pathways and in the lower tabs navigate to the second to last one called States.
b. Right click on the table and select Export All. Then choose a destination folder and file name. The exported Excel file should be available to view in your Windows task bar.
c. Select all records in this file except the ones belonging to the stratum that you want to import into the destination project, then delete these records.
d. Save the Excel file.
e. Return to the SyncroSim interface and navigate to the States property for the destination scenario then select Import by right clicking on the table and navigate to the Excel file with the states data for the new stratum. When importing choose the Append option.
6. Note that when importing Transition Pathways, States must be imported before Transitions.
7. Repeat this for as many scenario properties as needed (i.e., Initial Conditions, Transition Targets, etc…).
8. This process could also be scripted using either the current R or soon to be released Python Packages.September 25, 2018 at 7:25 pm #6198Leonardo FridKeymaster
An alternative way to copy the transitions associated with a particular stratum into an existing scenario is the following:
1. Define the new stratum in the Project Properties | Strata
2. In the Transition Pathway Diagrams, go to the stratum tab that you want to copy from in the Transition Pathways and select everything with your mouse (i.e., all state classes and transitions) by holding done the left button and drawing a rectangle around all state class boxes.
3. Right Click, Copy
4. Right click, paste into the tab for the new stratum.
5. To copy in initial conditions and other properties you will need to export to excel and copy the records for the new stratum.
This method actually also works between projects and libraries as long as the definitions in the destination project are identical to the definitions in the source project. This may actually be an easier approach than the one posted above.October 23, 2018 at 7:36 pm #6227davidandersonParticipant
I put together a Python/Jupyter notebook that does some of this. It is mostly working directly in the database using SQL.
Here is the link to the notebook. Try it out. It does require that a target SQLite database be created in the STSim software. Along with creating a project and a scenario.
This is very developmental as I just finished putting it together. It works but has zero error checking. No promises if things go wrong for you.
On a side note, interested in seeing the Python Package when it comes out.
- You must be logged in to reply to this topic.