public SiteHarvester(int harvestType, SiteRemovalMask someRemovalMask, HarvestReport someReport, int someDuration) { itsHarvestType = harvestType; itsRemovalMask = someRemovalMask; itsReport = someReport; itsDuration = someDuration; }
public HarvestRegime() { itsManagementAreaId = 0; itsRotationAge = 0; itsRemovalMask = new SiteRemovalMask(); itsRankAlgorithm = null; itsDuration = 0; itsReport = new HarvestReport(); }
public override void Read(StreamReader inFile) { int rankAlgorithmId; string label = "Harvest Module\0"; int id; string instring; string[] sarray; if ((instring = inFile.ReadLine()) == null) { throw new Exception("Error reading label from harvest section."); } sarray = instring.Split('#'); id = int.Parse(sarray[0]); SetLabel(label); SetUserInputId(id); if ((instring = inFile.ReadLine()) == null) { throw new Exception("Error reading management area id from harvest section."); } sarray = instring.Split('#'); itsManagementAreaId = int.Parse(sarray[0]); if ((instring = inFile.ReadLine()) == null) { throw new Exception("Error reading rotation age from harvest section."); } sarray = instring.Split('#'); itsRotationAge = int.Parse(sarray[0]); if ((instring = inFile.ReadLine()) == null) { throw new Exception("Error reading rank algorithm from harvest section."); } sarray = instring.Split('#'); rankAlgorithmId = int.Parse(sarray[0]); readCustomization1(inFile); itsRemovalMask = new SiteRemovalMask(); if (label != "Basal_Area_Thinning") { readCustomization2(inFile); } switch (rankAlgorithmId) { /* * Accroding to the input data file HarvestparameterDebug.dat from Jacob, which used all possible functions, these * methods may not be used in current version any longer. */ //case 6: // may not used // //itsRankAlgorithm = new OldestRank(itsManagementAreaId, itsRotationAge); // break; //case 7: // may not used // //itsRankAlgorithm = new EconomicImportanceRank(itsManagementAreaId, itsRotationAge, itsRemovalMask); // break; //case 4: // may not used // //itsRankAlgorithm = new RegulateDistributionRank(itsManagementAreaId, itsRotationAge); // break; ///* 29-SEP-99 */ //case 5: // may not used // //itsRankAlgorithm = new RelativeOldestRank(itsManagementAreaId, itsRotationAge, itsRemovalMask); // break; case 1: itsRankAlgorithm = new RandomRank(itsManagementAreaId, itsRotationAge); break; case 2: itsRankAlgorithm = new RankbyVolume(itsManagementAreaId, itsRotationAge); break; case 3: itsRankAlgorithm = new RankbyStocking(itsManagementAreaId, itsRotationAge); //Add By Qia on July 26 2012 break; /* -- END -- */ default: throw new Exception("Illegal rankAlgorithmId in HarvestRegime::read()."); } itsRankAlgorithm.read(inFile); }