You may want to run a series of scenarios to incrementally assess the impact of a range of objectives on a range of variables. This is where a well documented, repeatable and deliberate "Structured Anlaysis" is recommended. For example, you may have a series of visual quality, growing stock, patching, volume, route budget, and access objectives. You may want to determine the effect of these objectives on harvest volumes, patching and costs. Batch scripts enable you to run the series without ongoing input from you. You may plan out your series of scenarios like this:
Plan which targets will be tested in each scenario. For example:
Figure 74. Possible Target Set for the Crowsnest Pass
Targets set for three scenarios
Code model components that correspond to each of your
targets. This will be your "menu" or "common" set of
targets from which you will choose a subset for each of your
scenarios. Each of your targets will have a target name and a
descriptive string that is used to document each target
in the scenario output file. They will also belong to a
"target category". This will limit more than one target from
being selected within one category. In the following examples, we
will explain two possible target categories for the Crowsnest Pass
dataset. The following example is excerpted from the beanshell script
c:\Program Files\Spatial Planning Systems\Patchworks\sample\analysis\common.bsh
.
Example 1. Defining a visual quality target in the common.bsh
file
useVQO = new TargetDescription("Ensure less than 20% of the area is less than free to grow in any VQO zone", "VQO") {void apply() { ArrayList list = new ArrayList(control.getTargetLabels()); Collections.sort(list); for (int i=0; i≤listsize(); i++) { String label = list.get(i); if (label.startsWith("feature.VQO."))
setActive(label, true, false, true);
} } }; noVQO= new TargetDescription("No disturbance level control in VQO areas", "VQO") {
void apply() { ArrayList list = new ArrayList(control.getTargetLabels()); Collections.sort(list); for (int i=0; i≤list.size(); i++) { String label = list.get(i); if (label.startsWith("feature.VQO.")) setActive(label, false, false, true);
} } };
The name of the target is | |
The value of any target that starts with
| |
The | |
The name of the target is | |
The "true" from the previous target has now been
changed to "false". Any target that begins with
|
Example 2. Defining a harvest volume target in the common.bsh
file
aspatialHarvest= new TargetDescription("Annual aspatial harvest targets:Conifer-100,000; Deciduous-4,000 m3", "Harvest volume") {void apply() { setActive("product.Yield.managed.Conif", true, true, false);
setTarget("product.Yield.managed.Conif", 100000, 100000);
setMinWeight("product.Yield.managed.Conif", 1000); setActive("product.Yield.managed.Decid", true, true, false);
setTarget("product.Yield.managed.Decid", 4000, 4000);
setMinWeight("product.Yield.managed.Decid", 1000); } }; deliveredHarvest= new TargetDescription("Annual delivered wood harvest targets. These targets specify the amount of volume delivered to each mill: Mill 1-Conifer-10,000m3 ;Mill 1-Deciduous-4,000m3 ;Mill 2-Conifer-90,000m3", "Harvest volume") { apply() { setActive("product.Mill1.Conif", true, true, false);
setTarget("product.Mill1.Conif", 10000, 10000); setMinWeight("product.Mill2.Conif", 10000); setActive("product.Mill1.Decid", true, true, false); setTarget("product.Mill1.Decid", 4000, 4000); setMinWeight("product.Mill1.Decid", 1000); setActive("product.Mill2.Conif", true, true, false); setTarget("product.Mill2.Conif", 90000, 90000); setMinWeight("product.Mill2.Conif", 1000); } };
The name of the target is | |
The | |
The | |
The | |
The | |
For the second harvest volume target
|
Once the common.bsh
file has been set up, you
are ready to set up the scenario
set file
that lists the targets that you have chosen for each
scenario from the common file. This scenario file represents
combinations of targets from the
common.bsh
file that are selected
and combined into scenarios. The link between the two
files is the target name. The relationship between
the two files is illustrated below:
Figure 75. Relationship between the common and scenario set beanshell files
The link between the common and scenario set beanshell files is the target name.
The following example explains
a few of the scenarios from the
C5_ScenarioSet.bsh
found in the c:\Program Files\Spatial Planning Systems\Patchworks\sample\ analysis
folder. When you
examine this file, you will notice that the
common.bsh
is sourced at the beginning
of the C5_ScenarioSet.bsh
file.
Example 3. A possible scenarios.bsh
file
s.addScenario("C5_Aspatial1","The aspatial1 run imposes an aspatial harvest target and a minimum growing stock objective.", new TargetDescription[] {noVQO, useConifGS, noDisturbancePatch, noHarvestPatches,
aspatialHarvest, unlimitedRoadBudget, noCompartAccess} ); s.addScenario("C5_Aspatial2", "The aspatial2 run builds on aspatial1 and includes VQO and harvest retrictions in several landscape units.", new TargetDescription[] {useVQO, useConifGS, noDisturbancePatch, noHarvestPatches, aspatialHarvest, unlimitedRoadBudget, useCompartAccess} ); s.addScenario("C5_Spatial1",
"The Spatial1 builds on Aspatial2, and adds broad patch and generous road objectives. Harvest targets are applied towards specific mill destinations.", new Target Description[] {useVQO, useConifGS, useBroadDisturbancePatch, useHarvestPatches,
deliveredHarvest, highRoadBudget, useCompartAccess} );
The name of the scenario is | |
There are 7 targets listed for this scenario. There is no visual quality target, there are no patching targets, wood can be delivered to any mill, there is unlimited budget for roading, and no deferred harvest in special compartments. | |
The name of the scenario is | |
There are 7 targets listed for this scenario. There are visual quality targets, controls on both harvest and disturbance patches, a road budget, deferred harvest in special compartments and harvest targets are applied towards specified mill destinations. |
Source the scenario file from the Patchworks console to run the series of scenarios.
Figure 76. Sourcing the Scenario Set from the Patchworks console
When the pop-up window shows up, simply
check off the boxes of the scenarios you would like to run
and wait for the results. Here we checked off the first two
aspatial runs and the first spatial run corresponding to:
Example 3, “A possible scenarios.bsh
file”:
Figure 77. The Patchworks console and the Set batch processing option windows
If you look in your black command processor window, you will see the scheduler going through the iterations necessary to find an optimal solution for the first scenario set. When the scheduler has found it, it will save the scenario, and continue with the second and third scenario set.