Loading a Woodstock Model
This guide shows how to load a Woodstock-formatted model into ws3.
Prerequisites
A Woodstock model directory containing standard section files (AREAS, YIELDS, ACTIONS, TRANSITIONS)
ws3 installed
Procedure
1. Create a ForestModel instance
from ws3.forest import ForestModel
fm = ForestModel(
model_name="my_model",
model_path="path/to/model",
base_year=2020,
horizon=10,
period_length=10
)
2. Import sections
fm.import_areas_section()
fm.import_yields_section()
fm.import_actions_section()
fm.import_transitions_section()
3. Initialize
fm.initialize_areas()
fm.add_null_action()
fm.reset_actions()
4. Verify the load
print(f"Development types: {len(fm.dtypes)}")
print(f"Actions: {list(fm.actions.keys())}")
print(f"Yield names: {fm.ynames}")
Troubleshooting
Missing section files — confirm
model_pathcontains standard Woodstock section files and that file naming follows the convention<model_name>.<section>.Empty development types — check that the AREAS section contains non-zero area values and that
area_epsilonis appropriate.