Skip to content

Commit

Permalink
Output table updates (#1173)
Browse files Browse the repository at this point in the history
Co-authored-by: Richard Nugent III <richard.nugent.3@gmail.com>
  • Loading branch information
Brennan1994 and rnugent3 authored Nov 26, 2024
1 parent 495dd90 commit 0a64557
Show file tree
Hide file tree
Showing 29 changed files with 1,183 additions and 843 deletions.
6 changes: 3 additions & 3 deletions HEC.FDA.Model/alternatives/Alternative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private AlternativeResults RunAnnualizationCompute(List<int> analysisYears, doub
{
//To keep track of which results have yet to be processed
//I think this allows us to handle situations where we have uneven numbers of results
List<IContainImpactAreaScenarioResults> futureYearResultsList = new();
List<ImpactAreaScenarioResults> futureYearResultsList = new();
foreach (ImpactAreaScenarioResults futureYearImpactAreaScenarioResults in computedResultsFutureYear.ResultsList.Cast<ImpactAreaScenarioResults>())
{
futureYearResultsList.Add(futureYearImpactAreaScenarioResults);
Expand Down Expand Up @@ -114,7 +114,7 @@ private AlternativeResults RunAnnualizationCompute(List<int> analysisYears, doub
return alternativeResults;
}

private double ProcessBaseAndFutureYearScenarioResults(List<int> analysisYears, double discountRate, int periodOfAnalysis, ScenarioResults computedResultsBaseYear, ScenarioResults computedResultsFutureYear, AlternativeResults alternativeResults, List<IContainImpactAreaScenarioResults> futureYearResultsList, double quantityOFDamCatAssetCatImpactAreaCombos)
private double ProcessBaseAndFutureYearScenarioResults(List<int> analysisYears, double discountRate, int periodOfAnalysis, ScenarioResults computedResultsBaseYear, ScenarioResults computedResultsFutureYear, AlternativeResults alternativeResults, List<ImpactAreaScenarioResults> futureYearResultsList, double quantityOFDamCatAssetCatImpactAreaCombos)
{
double progressTicker = 0;
foreach (ImpactAreaScenarioResults baseYearResults in computedResultsBaseYear.ResultsList.Cast<ImpactAreaScenarioResults>())
Expand Down Expand Up @@ -190,7 +190,7 @@ private double ProcessBaseAndFutureYearScenarioResults(List<int> analysisYears,


private void ProcessUnmatchedFutureResults(List<int> analysisYears, double discountRate, int periodOfAnalysis, ScenarioResults computedResultsBaseYear, AlternativeResults alternativeResults,
List<IContainImpactAreaScenarioResults> futureYearResultsList, CancellationToken cancellationToken)
List<ImpactAreaScenarioResults> futureYearResultsList, CancellationToken cancellationToken)
{
foreach (ImpactAreaScenarioResults futureYearResults in futureYearResultsList.Cast<ImpactAreaScenarioResults>())
{
Expand Down
2 changes: 1 addition & 1 deletion HEC.FDA.Model/compute/ImpactAreaScenarioSimulation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ public static ImpactAreaScenarioSimulation ReadFromXML(XElement xElement)
GraphicalUncertainPairedData frequencyStage = GraphicalUncertainPairedData.ReadFromXML(xElement.Element(FREQUENCY_STAGE_ELEMENT_NAME));
UncertainPairedData interiorExterior = UncertainPairedData.ReadFromXML(xElement.Element(INTERIOR_EXTERIOR_ELEMENT_NAME));
UncertainPairedData systemResponse = UncertainPairedData.ReadFromXML(xElement.Element(SYSTEM_RESPONSE_ELEMENT_NAME));
IContainImpactAreaScenarioResults impactAreaScenarioResults = ImpactAreaScenarioResults.ReadFromXML(xElement.Element(IMPACT_AREA_SCENARIO_RESULTS_ELEMENT_NAME));
ImpactAreaScenarioResults impactAreaScenarioResults = ImpactAreaScenarioResults.ReadFromXML(xElement.Element(IMPACT_AREA_SCENARIO_RESULTS_ELEMENT_NAME));
List<UncertainPairedData> stageDamageList = new();
foreach (XElement stageDamageElement in xElement.Element(STAGE_DAMAGE_LIST_ELEMENT_NAME).Elements())
{
Expand Down
10 changes: 0 additions & 10 deletions HEC.FDA.Model/metrics/IContainImpactAreaScenarioResults.cs

This file was deleted.

3 changes: 1 addition & 2 deletions HEC.FDA.Model/metrics/ImpactAreaScenarioResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace HEC.FDA.Model.metrics
{
public class ImpactAreaScenarioResults : IContainImpactAreaScenarioResults
public class ImpactAreaScenarioResults
{
#region Properties
public PerformanceByThresholds PerformanceByThresholds { get; set; } //exposed publicly for testing
Expand Down Expand Up @@ -40,7 +40,6 @@ private ImpactAreaScenarioResults(PerformanceByThresholds performanceByThreshold
IsNull = false;
}
#endregion

#region Methods
public double MeanAEP(int thresholdID)
{
Expand Down
12 changes: 6 additions & 6 deletions HEC.FDA.Model/metrics/ScenarioResults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ScenarioResults : ValidationErrorLogger
public string ComputeDate { get; set; }
public string SoftwareVersion { get; set; }

public List<IContainImpactAreaScenarioResults> ResultsList { get; } = new List<IContainImpactAreaScenarioResults>();
public List<ImpactAreaScenarioResults> ResultsList { get; } = new List<ImpactAreaScenarioResults>();

#endregion

Expand All @@ -38,7 +38,7 @@ public List<int> GetImpactAreaIDs()
List<int> impactAreaIDs = new();
if (ResultsList.Count != 0)
{
foreach (IContainImpactAreaScenarioResults containImpactAreaScenarioResults in ResultsList)
foreach (ImpactAreaScenarioResults containImpactAreaScenarioResults in ResultsList)
{
foreach (AggregatedConsequencesBinned consequenceResult in containImpactAreaScenarioResults.ConsequenceResults.ConsequenceResultList)
{
Expand All @@ -57,7 +57,7 @@ public List<string> GetAssetCategories()
List<string> assetCats = new();
if (ResultsList.Count != 0)
{
foreach (IContainImpactAreaScenarioResults containImpactAreaScenarioResults in ResultsList)
foreach (ImpactAreaScenarioResults containImpactAreaScenarioResults in ResultsList)
{
foreach (AggregatedConsequencesBinned consequenceResult in containImpactAreaScenarioResults.ConsequenceResults.ConsequenceResultList)
{
Expand All @@ -77,7 +77,7 @@ public List<string> GetDamageCategories()
List<string> damCats = new();
if (ResultsList.Count != 0)
{
foreach (IContainImpactAreaScenarioResults containImpactAreaScenarioResults in ResultsList)
foreach (ImpactAreaScenarioResults containImpactAreaScenarioResults in ResultsList)
{
foreach (AggregatedConsequencesBinned consequenceResult in containImpactAreaScenarioResults.ConsequenceResults.ConsequenceResultList)
{
Expand Down Expand Up @@ -356,7 +356,7 @@ public Empirical GetConsequencesDistribution(int impactAreaID = utilities.Intege
return Empirical.StackEmpiricalDistributions(empiricalDistsToStack, Empirical.Sum);
}
}
public void AddResults(IContainImpactAreaScenarioResults resultsToAdd)
public void AddResults(ImpactAreaScenarioResults resultsToAdd)
{
ResultsList.Add(resultsToAdd);
}
Expand Down Expand Up @@ -423,7 +423,7 @@ public static ScenarioResults ReadFromXML(XElement xElement)

foreach (XElement element in xElement.Elements())
{
IContainImpactAreaScenarioResults impactAreaScenarioResults = ImpactAreaScenarioResults.ReadFromXML(element);
ImpactAreaScenarioResults impactAreaScenarioResults = ImpactAreaScenarioResults.ReadFromXML(element);
scenarioResults.AddResults(impactAreaScenarioResults);
}

Expand Down
2 changes: 1 addition & 1 deletion HEC.FDA.Model/utilities/IntegerGlobalConstants.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace HEC.FDA.Model.utilities
{
internal class IntegerGlobalConstants
public class IntegerGlobalConstants
{
public const int DEFAULT_MISSING_VALUE = -999;
}
Expand Down
Loading

0 comments on commit 0a64557

Please sign in to comment.