Skip to content

Commit

Permalink
Update to 1.2 - Launch any program
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément Hardy committed Jul 10, 2023
1 parent 2c62fb3 commit 698478f
Show file tree
Hide file tree
Showing 78 changed files with 2,640 additions and 130 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
LandisData Extension

Name "Magic Harvest"
Version "1.2"
Type disturbance:harvest
Assembly Landis.Extension.MagicHarvest
Class Landis.Extension.MagicHarvest.PlugIn
Description "Allows the update of the parameters of the harvest extension during the simulation"
CoreVersion 7.0
4 changes: 2 additions & 2 deletions Deploy/Installer Inno Setup script.iss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; LANDIS-II Extension infomation
#define CoreRelease "LANDIS-II-V7"
#define ExtensionName "Magic harvest"
#define AppVersion "1.1"
#define AppVersion "1.2"
#define AppPublisher "Clément Hardy"

; Build directory
Expand Down Expand Up @@ -53,7 +53,7 @@ Source: "..\Examples\BaseHarvest\*"; DestDir: {#AppDir}\Examples\{#ExtensionName

; LANDIS-II identifies the extension with the info in this .txt file
; NB. New releases must modify the name of this file and the info in it
#define InfoTxt "Magic harvest v1.1.txt"
#define InfoTxt "Magic harvest v1.2.txt"
Source: .\Installation Files\plug-ins-installer-files\{#InfoTxt}; DestDir: {#LandisPlugInDir}
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

Expand Down
75 changes: 75 additions & 0 deletions Examples/BaseHarvest/Landis-log.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
2022-06-01 13:03:43,630 - LANDIS-II 7.0 (7)
2022-06-01 13:03:43,639 -
2022-06-01 13:03:43,714 - Loading scenario from file "test_scenario.txt" ...
2022-06-01 13:03:43,783 - Initialized random number generator with user-supplied seed = 4 357
2022-06-01 13:03:43,784 - Loading species data from file "./input/species_ecoregions/species.txt" ...
2022-06-01 13:03:43,813 - Loading ecoregions from file "./input/species_ecoregions/ecoregions.txt" ...
2022-06-01 13:03:43,831 - Initializing landscape from ecoregions map "./input/species_ecoregions/ecoregions.tif" ...
2022-06-01 13:03:43,845 - Cell length = 100 m, cell area = 1 ha
2022-06-01 13:03:43,846 - Map dimensions: 100 rows by 100 columns = 10 000 cells
2022-06-01 13:03:43,854 - Sites: 9 539 active (95.4 %), 461 inactive (4.6 %)
2022-06-01 13:03:43,864 - Loading Age-only Succession extension ...
2022-06-01 13:03:43,919 - Registering Data: Succession.AgeCohorts.
2022-06-01 13:03:43,921 - Loading dynamic input data from file "./input/succession/age-only-succession-dynamic-inputs.txt" ...
2022-06-01 13:03:43,924 - Dynamic Input Parser: Add new year = 0.
2022-06-01 13:03:43,933 - Registering Data: TimeOfLastSuccession.
2022-06-01 13:03:43,933 - Registering Data: Shade.
2022-06-01 13:03:43,934 - Creating Dispersal Neighborhood List.
2022-06-01 13:03:43,934 - Dispersal: NeighborRadius=5050, CellLength=100, numCellRadius=50
2022-06-01 13:03:43,948 - Loading initial communities from file "./input/succession/initial-communities.txt" ...
2022-06-01 13:03:43,958 - Reading initial communities map "./input/succession/initial communities.tif" ...
2022-06-01 13:03:44,008 - Loading Magic Harvest extension ...
2022-06-01 13:03:44,015 - Magic Harvest : Parameters loaded
2022-06-01 13:03:44,015 - Loading Base Harvest extension ...
2022-06-01 13:03:44,180 - Registering Data: Harvest.PrescriptionName.
2022-06-01 13:03:44,181 - Registering Data: Harvest.TimeOfLastEvent.
2022-06-01 13:03:44,181 - Registering Data: Harvest.CohortsDamaged.
2022-06-01 13:03:44,242 - Magic Harvest : Initialized
2022-06-01 13:03:44,309 - Generating event table...
2022-06-01 13:03:44,314 - Generating summary table...
2022-06-01 13:03:44,328 - Reading management-area map ./input/disturbances/management.tif ...
2022-06-01 13:03:44,340 - Inactive management areas: 0
2022-06-01 13:03:44,340 - Reading stand map ./input/disturbances/stands.tif ...
2022-06-01 13:03:44,369 - Using the following extensions ...
Extension Name Extension Filename
-------------- ------------------
Age-only Succession ./input/succession/succession.txt
Magic Harvest ./input/disturbances/magic_harvest.txt
Base Harvest ./input/disturbances/harvest.txt

2022-06-01 13:03:44,372 - Current time: 10
2022-06-01 13:03:44,373 - Running Base Harvest ...
2022-06-01 13:03:44,791 - Running Age-only Succession ...
2022-06-01 13:03:45,212 - Current time: 20
2022-06-01 13:03:45,212 - Running Base Harvest ...
2022-06-01 13:03:45,275 - Running Age-only Succession ...
2022-06-01 13:03:45,489 - Current time: 30
2022-06-01 13:03:45,489 - Running Base Harvest ...
2022-06-01 13:03:46,650 - Running Age-only Succession ...
2022-06-01 13:03:46,824 - Current time: 40
2022-06-01 13:03:46,824 - Running Base Harvest ...
2022-06-01 13:03:46,921 - Running Age-only Succession ...
2022-06-01 13:03:47,051 - Current time: 50
2022-06-01 13:03:47,051 - Running Base Harvest ...
2022-06-01 13:03:47,169 - Running Age-only Succession ...
2022-06-01 13:03:47,280 - Current time: 60
2022-06-01 13:03:47,280 - Running Base Harvest ...
2022-06-01 13:03:47,318 - Running Age-only Succession ...
2022-06-01 13:03:47,412 - Current time: 70
2022-06-01 13:03:47,412 - Running Magic Harvest ...
2022-06-01 13:03:47,424 - Magic Harvest is now running
2022-06-01 13:03:47,424 - Magic Harvest : Printing extensions detected
2022-06-01 13:03:47,424 - System.Collections.Generic.List`1[Landis.Core.ExtensionMain]
2022-06-01 13:03:47,424 - Magic Harvest
2022-06-01 13:03:47,424 - Base Harvest
2022-06-01 13:03:47,424 - Magic Harvest : Selected the extension Base Harvest.
2022-06-01 13:03:47,424 - Magic Harvest : Launching the python script at ./switchManagementRasterNames.py
2022-06-01 13:03:47,425 - Magic Harvest : USING NON-CMD COMMAND
2022-06-01 13:03:47,488 - Magic Harvest : Python script has finished running
2022-06-01 13:03:47,491 - Internal error occurred within the program:
2022-06-01 13:03:47,491 - [A]Landis.Library.HarvestManagement.ManagementAreaDataset cannot be cast to [B]Landis.Library.HarvestManagement.ManagementAreaDataset. Type A originates from 'Landis.Library.HarvestManagement-v4, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\Program Files\LANDIS-II-v7\extensions\Landis.Library.HarvestManagement-v4.dll'. Type B originates from 'Landis.Library.HarvestManagement-v3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' at location 'C:\Program Files\LANDIS-II-v7\extensions\Landis.Library.HarvestManagement-v3.dll'.
2022-06-01 13:03:47,491 -
2022-06-01 13:03:47,491 - Stack trace:
2022-06-01 13:03:47,521 - at Landis.Extension.MagicHarvest.PlugIn.Run()
at Landis.Model.Run(String scenarioPath, IUserInterface ui)
at Landis.App.Main(String[] args) in D:\CGAProjects\Rob\LANDIS_FINAL\GitHubRepo\Core-Model-v7\Tool-Console\src\App.cs:line 99
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<landisMetadata><extension name="Base Harvest" timeInterval="10"><scenario-replication timeMin="0" timeMax="150" rasterOutCellArea="1" /><outputs><output type="Table" name="EventLog" filePath="./output/harvest/log.csv" visualize="False" MetadataFilePath="Metadata\Base Harvest\EventLog_Metadata.xml" /><output type="Table" name="SummaryLog" filePath="./output/harvest/summarylog.csv" visualize="True" MetadataFilePath="Metadata\Base Harvest\SummaryLog_Metadata.xml" /><output type="Map" name="prescription" filePath="./output/harvest/prescripts-{timestep}.gis" visualize="True" unit="" dataType="Nominal" /></outputs></extension></landisMetadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<landisMetadata><output><extension name="Base Harvest" metadataFilePath="Base Harvest.xml" /><fields><field name="Time" description="Harvest Year" unit="year" /><field name="ManagementArea" description="Management Area" /><field name="Prescription" description="Prescription Name" /><field name="Stand" description="Stand" /><field name="EventID" description="Event ID" /><field name="StandAge" description="Stand Age" unit="year" /><field name="StandRank" description="Stand Rank" /><field name="NumberOfSites" description="Number of Sites" unit="count" /><field name="HarvestedSites" description="Number of Sites Harvested" unit="count" /><field name="TotalCohortsHarvested" description="Total Number Cohorts Harvested" unit="count" /><field name="CohortsHarvested_abiebals" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_acerrubr" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_acersacc" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_betualle" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_betupapy" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_piceglau" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_pinubank" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_pinuresi" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_pinustro" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_poputrem" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_querelli" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_quermacr" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_querrubr" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_tiliamer" description="Species Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_tsugcana" description="Species Cohorts Harvested by Species" unit="count" /></fields></output></landisMetadata>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<landisMetadata><output><extension name="Base Harvest" metadataFilePath="Base Harvest.xml" /><fields><field name="Time" description="Simulation Year" unit="year" /><field name="ManagementArea" description="Management Area" /><field name="Prescription" description="Prescription Name" /><field name="HarvestedSites" description="Harvested Sites" unit="count" /><field name="CohortsHarvested_abiebals" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_acerrubr" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_acersacc" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_betualle" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_betupapy" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_piceglau" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_pinubank" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_pinuresi" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_pinustro" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_poputrem" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_querelli" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_quermacr" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_querrubr" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_tiliamer" description="Number of Cohorts Harvested by Species" unit="count" /><field name="CohortsHarvested_tsugcana" description="Number of Cohorts Harvested by Species" unit="count" /></fields></output></landisMetadata>
126 changes: 126 additions & 0 deletions Examples/BaseHarvest/input/disturbances/harvest_0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
>> HARVEST MODULE PARAMETER FILE

>> If a parameter requires SPECIES information, it must be followed by a
>> table listing a species name, followed by a list of parameters,
>> as outlined in the documentation.

>>------------------------------------------------------------------------
>> TYPE OF DATA

LandisData "Base Harvest"

>>------------------------------------------------------------------------
>> TIMESTEP

Timestep 10

>>------------------------------------------------------------------------
>> MANAGEMENT AREAS: the .gis file which defines the management areas.

ManagementAreas "./input/disturbances/management.tif"

>>------------------------------------------------------------------------
>> STANDS: the .gis file which defines the stands. A stand can belong to
>> one and only one management area.

Stands "./input/disturbances/stands.tif"

>>------------------------------------------------------------------------
>> PRESCRIPTIONS

Prescription CPRS

>> STAND RANKING:
StandRanking MaxCohortAge
>> STAND QUALIFICATION FOR CUTTING:
MinimumAge 20
>> SITE SELECTION:
>> Minimum Size Maximum Size
>> ---------- ----------
SiteSelection PartialStandSpread 1 10
>> COHORT REMOVAL METHOD:
CohortsRemoved ClearCut

Prescription Shelterwood

>> STAND RANKING:
StandRanking MaxCohortAge
>> STAND QUALIFICATION FOR CUTTING:
MinimumAge 20
>> SITE SELECTION:
>> Minimum Size Maximum Size
>> ---------- ----------
SiteSelection PartialStandSpread 1 10
CohortsRemoved SpeciesList
>> Species Cohorts removed
>> ------- ---------------
abiebals 1/2
acerrubr 1/2
acersacc 1/2
betualle 1/2
betupapy 1/2
piceglau 1/2
pinubank 1/2
pinuresi 1/2
pinustro 1/2
poputrem 1/2
querelli 1/2
quermacr 1/2
querrubr 1/2
tiliamer 1/2
tsugcana 1/2
SingleRepeat 20
CohortsRemoved ClearCut

Prescription CPI-CP

>> STAND RANKING:
StandRanking MaxCohortAge
>> STAND QUALIFICATION FOR CUTTING:
MinimumAge 20
>> SITE SELECTION:
>> Minimum Size Maximum Size
>> ---------- ----------
SiteSelection PartialStandSpread 1 10
>> COHORT REMOVAL METHOD:
CohortsRemoved SpeciesList
>> Species Cohorts removed
>> ------- ---------------
abiebals 1/3
acerrubr 1/3
acersacc 1/3
betualle 1/3
betupapy 1/3
piceglau 1/3
pinubank 1/3
pinuresi 1/3
pinustro 1/3
poputrem 1/3
querelli 1/3
quermacr 1/3
querrubr 1/3
tiliamer 1/3
tsugcana 1/3
MultipleRepeat 30


>>-----------------------------------------------------------------
>> HARVEST IMPLEMENTATION TABLE
>> The following table defines which management areas (defined in the
>> ManagementArea file) are treated by which prescription(s).

HarvestImplementations

>> Mgmt Area Prescription Harvest Area Begin Time End Time
>> --------- ------------ ------------ ---------- --------
1 CPRS 2.5%
>> 1 Shelterwood 0.5%
>> 1 CPI-CP 0.5%

>>------------------------------------------------------------------------
>> OUTPUT FILES

PrescriptionMaps ./output/harvest/prescripts-{timestep}.gis
EventLog ./output/harvest/log.csv
SummaryLog ./output/harvest/summarylog.csv
>>------------------------------------------------------------------------
4 changes: 3 additions & 1 deletion Examples/BaseHarvest/input/disturbances/magic_harvest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ Timestep 70

HarvestExtensionParameterFile ./input/disturbances/harvest.txt

PythonScriptLocation ./switchManagementRasterNames.py
ProcessToLaunch python

ProcessArguments "./switchManagementRasterNames.py {timestep}"
Loading

0 comments on commit 698478f

Please sign in to comment.