Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Deltares.DamEngine.Data.csproj
===================================================================
diff -u -r1691 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Data/Deltares.DamEngine.Data.csproj (.../Deltares.DamEngine.Data.csproj) (revision 1691)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/Deltares.DamEngine.Data.csproj (.../Deltares.DamEngine.Data.csproj) (revision 1732)
@@ -159,13 +159,13 @@
Resources.resx
-
+
-
+
Fisheye: Tag 1732 refers to a dead (removed) revision in file `DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RegionalScenariosCalculation.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: DamEngine/trunk/src/Deltares.DamEngine.Interface/EngineInterface.cs
===================================================================
diff -u -r1640 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Interface/EngineInterface.cs (.../EngineInterface.cs) (revision 1640)
+++ DamEngine/trunk/src/Deltares.DamEngine.Interface/EngineInterface.cs (.../EngineInterface.cs) (revision 1732)
@@ -186,7 +186,7 @@
switch (DamProjectData.DamProjectType)
{
case DamProjectType.AssessmentRegional:
- var regionalScenariosCalculator = new RegionalScenariosCalculation();
+ var regionalScenariosCalculator = new RegionalAssessmentCalculator();
regionalScenariosCalculator.RegisterProgress(progressDelegate);
regionalScenariosCalculator.Execute(DamProjectData);
regionalScenariosCalculator.GetResults();
Index: DamEngine/trunk/src/Deltares.DamEngine.Data/RegionalAssessmentResults/RegionalScenarioResult.cs
===================================================================
diff -u -r1221 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Data/RegionalAssessmentResults/RegionalScenarioResult.cs (.../RegionalScenarioResult.cs) (revision 1221)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/RegionalAssessmentResults/RegionalScenarioResult.cs (.../RegionalScenarioResult.cs) (revision 1732)
@@ -38,7 +38,7 @@
private CalculationResult calculationResult = CalculationResult.NoRun;
private ScenarioType scenarioType = ScenarioType.Scenario01;
- private IList regionalScenarioProfileResults = new List();
+ private IList regionalScenarioProfileResults = new List();
///
/// Gets or sets the calculation result.
@@ -66,7 +66,7 @@
///
/// The regional scenario profile results.
///
- public IList RegionalScenarioProfileResults
+ public IList RegionalScenarioProfileResults
{
get { return regionalScenarioProfileResults; }
set { regionalScenarioProfileResults = value; }
Fisheye: Tag 1732 refers to a dead (removed) revision in file `DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/RegionalScenariosCalculationTests.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Interfaces/IKernelWrapper.cs
===================================================================
diff -u -r1217 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Interfaces/IKernelWrapper.cs (.../IKernelWrapper.cs) (revision 1217)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/KernelWrappers/Interfaces/IKernelWrapper.cs (.../IKernelWrapper.cs) (revision 1732)
@@ -83,7 +83,7 @@
///
/// Interface to implement external failure mechanisms
///
- public interface IKernelWrapper : ICalculation
+ public interface IKernelWrapper
{
///
/// Prepares the failure mechanism input based on general dam kernel input.
Index: DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/FillXmlOutputFromDamTests.cs
===================================================================
diff -u -r1558 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/FillXmlOutputFromDamTests.cs (.../FillXmlOutputFromDamTests.cs) (revision 1558)
+++ DamEngine/trunk/src/Deltares.DamEngine.Interface.Tests/FillXmlOutputFromDamTests.cs (.../FillXmlOutputFromDamTests.cs) (revision 1732)
@@ -203,8 +203,8 @@
regionalScenarioResult.ScenarioType = ScenarioType.Scenario03;
regionalScenarioResult.UpliftType = UpliftType.Uplift;
- regionalScenarioResult.RegionalScenarioProfileResults = new List();
- var regionalScenarioProfileResult = new RegionalScenarioProfileResult(location, soilGeometryProbability);
+ regionalScenarioResult.RegionalScenarioProfileResults = new List();
+ var regionalScenarioProfileResult = new RegionalScenarioProfileJob(location, soilGeometryProbability);
regionalScenarioProfileResult.BaseFileName = "base " + (i * 3);
regionalScenarioProfileResult.DikeDrySensitivity = DikeDrySensitivity.None;
regionalScenarioProfileResult.FailureMechanismType = FailureMechanismSystemType.Piping;
Index: DamEngine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlOutput.cs
===================================================================
diff -u -r1567 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlOutput.cs (.../FillDamFromXmlOutput.cs) (revision 1567)
+++ DamEngine/trunk/src/Deltares.DamEngine.Interface/FillDamFromXmlOutput.cs (.../FillDamFromXmlOutput.cs) (revision 1732)
@@ -329,7 +329,7 @@
ScenarioType = ConversionHelper.ConvertToScenarioType(outPutRegionalScenarioResult.ScenarioType),
UpliftType = ConversionHelper.ConvertToUpliftType(outPutRegionalScenarioResult.UpliftType)
};
- var regionalScenarioProfileResults = new List();
+ var regionalScenarioProfileResults = new List();
foreach (var outPutRegionalScenarioProfileResult in outPutRegionalScenarioResult.RegionalScenarioProfileResults)
{
@@ -339,7 +339,7 @@
var soilGeometryProbability = location.Segment.SoilProfileProbabilities.FirstOrDefault(s => ((s.SegmentFailureMechanismType == null) ||
(s.SegmentFailureMechanismType.Value == FailureMechanismSystemType.StabilityInside)) &&
(s.SoilProfile1DName == spName));
- var regionalScenarioProfileResult = new RegionalScenarioProfileResult(location, soilGeometryProbability)
+ var regionalScenarioProfileResult = new RegionalScenarioProfileJob(location, soilGeometryProbability)
{
LoadSituation = ConversionHelper.ConvertToLoadSituation(outPutRegionalScenarioProfileResult.LoadSituation),
DikeDrySensitivity = ConversionHelper.ConvertToDikeDrySensitivity(outPutRegionalScenarioProfileResult.DikeDrySensitivity),
Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj
===================================================================
diff -u -r1674 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 1674)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/Deltares.DamEngine.Calculators.csproj (.../Deltares.DamEngine.Calculators.csproj) (revision 1732)
@@ -98,7 +98,7 @@
-
+
Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/DikeJob.cs
===================================================================
diff -u -r877 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Data/General/DikeJob.cs (.../DikeJob.cs) (revision 877)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/DikeJob.cs (.../DikeJob.cs) (revision 1732)
@@ -21,39 +21,14 @@
namespace Deltares.DamEngine.Data.General
{
+ ///
+ /// Class holding Dike Job
+ ///
+ ///
public class DikeJob : CompositeJob
{
- public DikeJob()
- {
- }
-
public DikeJob(object subject) : base(subject)
{
- }
-
- public Dike Dike
- {
- get
- {
- return this.Subject as Dike;
- }
- set
- {
- this.Subject = value;
- }
- }
-
- public bool AreAllLocationWaterLevelTimeSeriesAssigned()
- {
- bool areAssigned = true;
- foreach (DamJob damJob in Jobs)
- {
- if (damJob.GetType() == typeof(LocationJob))
- {
- areAssigned = areAssigned && (((LocationJob)damJob).WaterLevelTimeSerie != null);
- }
- }
- return areAssigned;
- }
+ }
}
}
Fisheye: Tag 1732 refers to a dead (removed) revision in file `DamEngine/trunk/src/Deltares.DamEngine.Data/RegionalAssessmentResults/RegionalScenarioProfileResult.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: DamEngine/trunk/src/Deltares.DamEngine.Data/RegionalAssessmentResults/RegionalScenarioProfileResult.cs
===================================================================
diff -u -r1575 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Data/RegionalAssessmentResults/RegionalScenarioProfileResult.cs (.../RegionalScenarioProfileResult.cs) (revision 1575)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/RegionalAssessmentResults/RegionalScenarioProfileResult.cs (.../RegionalScenarioProfileJob.cs) (revision 1732)
@@ -30,7 +30,7 @@
///
/// Class for results of one particular regional scenario per profile
///
- public class RegionalScenarioProfileResult: RegionalResult
+ public class RegionalScenarioProfileJob: RegionalResult
{
private FailureMechanismSystemType failureMechanismType = FailureMechanismSystemType.StabilityInside;
private DikeDrySensitivity dikeDrySensitivity = DikeDrySensitivity.None;
@@ -47,11 +47,11 @@
private string baseFileName = "";
///
- /// Initializes a new instance of the class.
+ /// Initializes a new instance of the class.
///
/// The location.
/// The soil geometry probability.
- public RegionalScenarioProfileResult(Location location, SoilGeometryProbability soilGeometryProbability)
+ public RegionalScenarioProfileJob(Location location, SoilGeometryProbability soilGeometryProbability)
{
this.location = location;
this.soilGeometryProbability = soilGeometryProbability;
Index: DamEngine/trunk/src/Deltares.DamEngine.Data/RegionalAssessmentResults/EvaluationJob.cs
===================================================================
diff -u -r1120 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Data/RegionalAssessmentResults/EvaluationJob.cs (.../EvaluationJob.cs) (revision 1120)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/RegionalAssessmentResults/EvaluationJob.cs (.../EvaluationJob.cs) (revision 1732)
@@ -26,61 +26,68 @@
namespace Deltares.DamEngine.Data.RegionalAssessmentResults
{
+ ///
+ /// Class holding evaluation job
+ ///
public class EvaluationJob
{
private string dikeName = "";
private List locations = new List();
private List failedEvaluatedLocations = new List();
private List results = new List();
-
+
+ ///
+ /// Gets or sets the name of the dike.
+ ///
+ ///
+ /// The name of the dike.
+ ///
public string DikeName
{
get { return dikeName; }
set { dikeName = value; }
}
+ ///
+ /// Gets or sets the locations.
+ ///
+ ///
+ /// The locations.
+ ///
public List Locations
{
get { return locations; }
set { locations = value; }
}
+ ///
+ /// Gets or sets the results.
+ ///
+ ///
+ /// The results.
+ ///
public List Results
{
get { return results; }
set { results = value; }
}
- // public string XML
-// {
-// get
-// {
-// XmlSerializer serializer = new XmlSerializer();
-// return serializer.SerializeToString(this);
-// }
-// set
-// {
-// XmlDeserializer deserializer = new XmlDeserializer();
-// EvaluationJob job = (EvaluationJob)deserializer.XmlDeserializeFromString(value, typeof(EvaluationJob));
-//
-// this.DikeName = job.DikeName;
-//
-// this.Locations.Clear();
-// this.Locations.AddRange(job.Locations);
-//
-// this.Results.Clear();
-// this.Results.AddRange(job.Results);
-// this.schematizationFactorResults.Clear();
-// this.schematizationFactorResults.AddRange(job.schematizationFactorResults);
-// }
-// }
-
+ ///
+ /// Gets or sets the failed evaluated locations.
+ ///
+ ///
+ /// The failed evaluated locations.
+ ///
public List FailedEvaluatedLocations
{
get { return failedEvaluatedLocations; }
set { failedEvaluatedLocations = value; }
}
+ ///
+ /// Attaches the results.
+ ///
+ /// The location jobs.
public void AttachResults(IEnumerable locationJobs)
{
foreach (LocationJob locationJob in locationJobs)
@@ -104,15 +111,6 @@
{
locationJob.LocationResult.RegionalScenariosResult = this.results[this.locations.IndexOf(location)];
}
-
-
-// foreach (RWScenarioResult scenarioResult in locationJob.LocationResult.RegionalScenariosResult.RegionalScenarioResults)
-// {
-// foreach (RWScenarioProfileResult scenarioProfileResult in scenarioResult.RegionalScenarioProfileResults)
-// {
-// scenarioProfileResult.Location = locationJob.Location;
-// }
-// } #Bka: if this is really needed, location must be added as non serializeable object.
}
}
}
Index: DamEngine/trunk/src/Deltares.DamEngine.Data/General/LocationJob.cs
===================================================================
diff -u -r1290 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Data/General/LocationJob.cs (.../LocationJob.cs) (revision 1290)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/General/LocationJob.cs (.../LocationJob.cs) (revision 1732)
@@ -19,31 +19,17 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using System.Collections.Generic;
-using System.Linq;
using Deltares.DamEngine.Data.General.Results;
using Deltares.DamEngine.Data.General.TimeSeries;
-using Deltares.DamEngine.Data.RegionalAssessmentResults;
using Deltares.DamEngine.Data.Standard.Validation;
namespace Deltares.DamEngine.Data.General
{
///
- /// Interface for location job
- ///
- public interface ILocationJob
- {
- Location Location { get; }
- IEnumerable RegionalScenarioResults { get; }
- bool HasRegionalScenarioResults { get; }
- }
-
- ///
/// Class holding LocationJob data
///
///
- ///
- public class LocationJob : DamJob, ILocationJob
+ public class LocationJob : DamJob
{
private TimeSerie waterLevelTimeSerie = new TimeSerie();
private LocationResult locationResult = new LocationResult();
@@ -78,49 +64,6 @@
}
///
- /// Gets or sets the water level time serie.
- ///
- ///
- /// The water level time serie.
- ///
- public TimeSerie WaterLevelTimeSerie
- {
- get { return waterLevelTimeSerie; }
- set
- {
- waterLevelTimeSerie = value;
- }
- }
-
- ///
- /// Gets the regional scenario results.
- ///
- ///
- /// The regional scenario results.
- ///
- public virtual IEnumerable RegionalScenarioResults
- {
- get
- {
- return !HasRegionalScenarioResults ?
- new List() : locationResult.RegionalScenariosResult.RegionalScenarioResults;
- }
- }
-
- ///
- /// Gets a value indicating whether this instance has regional scenario results.
- ///
- ///
- /// true if this instance has regional scenario results; otherwise, false.
- ///
- public bool HasRegionalScenarioResults
- {
- get { return locationResult != null && locationResult.RegionalScenariosResult != null &&
- locationResult.RegionalScenariosResult.RegionalScenarioResults.Any();
- }
- }
-
- ///
/// Gets or sets the location result.
///
///
Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj
===================================================================
diff -u -r1586 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj (.../Deltares.DamEngine.Calculators.Tests.csproj) (revision 1586)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/Deltares.DamEngine.Calculators.Tests.csproj (.../Deltares.DamEngine.Calculators.Tests.csproj) (revision 1732)
@@ -69,7 +69,7 @@
-
+
Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RegionalScenarioSelector.cs
===================================================================
diff -u -r1575 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RegionalScenarioSelector.cs (.../RegionalScenarioSelector.cs) (revision 1575)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RegionalScenarioSelector.cs (.../RegionalScenarioSelector.cs) (revision 1732)
@@ -48,9 +48,9 @@
/// The location.
/// The soil geometry probability.
///
- public RegionalScenarioProfileResult[] GetScenarios(Location location, SoilGeometryProbability soilGeometryProbability)
+ public RegionalScenarioProfileJob[] GetScenarios(Location location, SoilGeometryProbability soilGeometryProbability)
{
- List scenarios = new List();
+ List scenarios = new List();
Evaluator[] evaluators = new Evaluator[]
{
@@ -182,10 +182,10 @@
return scenarios.ToArray();
}
- private RegionalScenarioProfileResult GetScenario(ScenarioType scenarioType, Enum[] choices, Location location,
+ private RegionalScenarioProfileJob GetScenario(ScenarioType scenarioType, Enum[] choices, Location location,
SoilGeometryProbability soilGeometryProbability, FailureMechanismSystemType failureMechanismType, MStabModelType modelOption)
{
- var scenario = new RegionalScenarioProfileResult(location, soilGeometryProbability)
+ var scenario = new RegionalScenarioProfileJob(location, soilGeometryProbability)
{
FailureMechanismType = failureMechanismType,
MstabModelOption = modelOption,
@@ -212,10 +212,10 @@
return scenario;
}
- private RegionalScenarioProfileResult GetScenario(ScenarioType scenarioType, Enum[] choices, Location location,
+ private RegionalScenarioProfileJob GetScenario(ScenarioType scenarioType, Enum[] choices, Location location,
SoilGeometryProbability soilGeometryProbability, FailureMechanismSystemType failureMechanismType, PipingModelType pipingModelType)
{
- var scenario = new RegionalScenarioProfileResult(location, soilGeometryProbability)
+ var scenario = new RegionalScenarioProfileJob(location, soilGeometryProbability)
{
FailureMechanismType = failureMechanismType,
MstabModelOption = MStabModelType.Bishop,
Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/RegionalScenariosCalculationTests.cs
===================================================================
diff -u -r1575 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/RegionalScenariosCalculationTests.cs (.../RegionalScenariosCalculationTests.cs) (revision 1575)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/RegionalAssessment/RegionalScenariosCalculationTests.cs (.../RegionalAssessmentCalculatorTests.cs) (revision 1732)
@@ -28,7 +28,7 @@
namespace Deltares.DamEngine.Calculators.Tests.RegionalAssessment
{
[TestFixture]
- public class RegionalScenariosCalculationTests
+ public class RegionalAssessmentCalculatorTests
{
private const double tolerance = 0.0005;
Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/Calculation/ICalculation.cs
===================================================================
diff -u -r1119 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/Calculation/ICalculation.cs (.../ICalculation.cs) (revision 1119)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/Calculation/ICalculation.cs (.../CalculationResult.cs) (revision 1732)
@@ -33,11 +33,4 @@
RunFailed = 6,
UnexpectedError = 7
}
-
- public interface ICalculation
- {
- //CalculationResult RegisterProgress(ProgressDelegate aProgressDelegate);
- //CalculationResult RegisterGetValues(GetValuesDelegate aGetValuesDelegate);
- //CalculationResult RegisterSetValues(SetValuesDelegate setValuesDelegate);
- }
}
\ No newline at end of file
Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RegionalScenariosCalculation.cs
===================================================================
diff -u -r1714 -r1732
--- DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RegionalScenariosCalculation.cs (.../RegionalScenariosCalculation.cs) (revision 1714)
+++ DamEngine/trunk/src/Deltares.DamEngine.Calculators/DikesAssessmentRegional/RegionalScenariosCalculation.cs (.../RegionalAssessmentCalculator.cs) (revision 1732)
@@ -39,28 +39,24 @@
namespace Deltares.DamEngine.Calculators.DikesAssessmentRegional
{
///
- /// Exception for RegionalScenariosCalculation class
+ /// Exception for RegionalAssessmentCalculator class
///
- public class RegionalScenariosCalculationException : ApplicationException
+ public class RegionalAssessmentCalculatorException : ApplicationException
{
- public RegionalScenariosCalculationException() { }
- public RegionalScenariosCalculationException(string message) : base(message) { }
+ public RegionalAssessmentCalculatorException(string message) : base(message) { }
}
///
/// Class to perform the calculation of reginal scenarios
///
- ///
- public class RegionalScenariosCalculation : ICalculation
+ public class RegionalAssessmentCalculator
{
private DamProjectData damProjectData;
private EvaluationJob evaluationJob;
- private GetValuesDelegate getValuesDelegate;
private ProgressDelegate progressDelegate;
- private SendMessageDelegate sendMessageDelegate;
private int maxCalculationCores = 255;
- private readonly Dictionary runningJobs = new Dictionary();
+ private readonly Dictionary runningJobs = new Dictionary();
private bool isSkipStabilityCalculation;
private PipingModelType pipingModelType;
@@ -82,6 +78,7 @@
}
maxCalculationCores = damProjectData.MaxCalculationCores;
pipingModelType = damProjectData.DamProjectCalculationSpecification.CurrentSpecification.PipingModelType;
+ // Next line seems nonsense but is needed to properly initialize all jobs. So the unused dj can NOT be removed.
var dj = damProjectData.DikeJob;
foreach (var locationJob in damProjectData.LocationJobs)
{
@@ -92,8 +89,6 @@
evaluationJob.AttachResults(aDamProjectData.LocationJobs);
}
- #region ICalculation Members
-
///
/// Gets the results.
///
@@ -102,19 +97,8 @@
{
return evaluationJob;
}
-
+
///
- /// Registers the get values.
- ///
- /// The get values delegate.
- ///
- public CalculationResult RegisterGetValues(GetValuesDelegate aGetValuesDelegate)
- {
- getValuesDelegate = aGetValuesDelegate;
- return CalculationResult.Succeeded;
- }
-
- ///
/// Registers the progress.
///
/// The progress delegate.
@@ -126,47 +110,6 @@
}
///
- /// Registers the send debug information.
- ///
- /// The send debug information delegate.
- ///
- public CalculationResult RegisterSendDebugInfo(SendDebugInfodelegate sendDebugInfoDelegate)
- {
- return CalculationResult.Succeeded;
- }
-
- ///
- /// Registers the send message.
- ///
- /// The send message delegate.
- ///
- public CalculationResult RegisterSendMessage(SendMessageDelegate aSendMessageDelegate)
- {
- sendMessageDelegate = aSendMessageDelegate;
- return CalculationResult.Succeeded;
- }
-
- ///
- /// Registers the set values.
- ///
- /// The set values delegate.
- ///
- public CalculationResult RegisterSetValues(SetValuesDelegate setValuesDelegate)
- {
- return CalculationResult.Succeeded;
- }
-
- ///
- /// Registers the user abort.
- ///
- /// The user abort delegate.
- ///
- public CalculationResult RegisterUserAbort(UserAbortDelegate userAbortDelegate)
- {
- return CalculationResult.Succeeded;
- }
-
- ///
/// Runs this instance.
///
///
@@ -175,7 +118,7 @@
try
{
- List tasks = FillQueue();
+ List tasks = FillQueue();
General.Parallel.Run(tasks, RunTask, progressDelegate, maxCalculationCores);
FillResults(tasks);
@@ -184,34 +127,12 @@
}
catch(Exception exception)
{
- SendMessage(new LogMessage(LogMessageType.Warning, null, "Unexpected error:" + exception.Message));
+ StoreMessage(new LogMessage(LogMessageType.Warning, null, "Unexpected error:" + exception.Message));
throw;
}
}
///
- /// Validates this instance.
- ///
- ///
- public CalculationResult Validate()
- {
- return CalculationResult.Succeeded;
- }
-
- #endregion
-
- ///
- /// Gets the version.
- ///
- ///
- /// The version.
- ///
- public string Version
- {
- get { return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); }
- }
-
- ///
/// Gets or sets a value indicating whether this instance is skip stability calculation.
/// Only used for test puposes.
///
@@ -224,9 +145,9 @@
set { isSkipStabilityCalculation = value; }
}
- private List FillQueue()
+ private List FillQueue()
{
- List tasks = new List();
+ List tasks = new List();
evaluationJob.FailedEvaluatedLocations = new List();
foreach (var location in evaluationJob.Locations)
@@ -238,7 +159,7 @@
{
evaluationJob.FailedEvaluatedLocations.Add(location);
var locationHasNoSegment = LocalizationManager.GetTranslatedText(GetType(), "LocationHasNoSegment");
- SendMessage(new LogMessage(LogMessageType.Error, location, locationHasNoSegment));
+ StoreMessage(new LogMessage(LogMessageType.Error, location, locationHasNoSegment));
}
}
else
@@ -252,7 +173,7 @@
if (soilGeometryProbabilities.Count == 0)
{
evaluationJob.FailedEvaluatedLocations.Add(location);
- SendMessage(new LogMessage(LogMessageType.Warning, location, "Location has no soilprofiles: " +
+ StoreMessage(new LogMessage(LogMessageType.Warning, location, "Location has no soilprofiles: " +
string.Format("Segment: {0}", location.Segment.Name)));
}
@@ -263,15 +184,15 @@
if (soilGeometryProbability.SoilProfileType == SoilProfileType.ProfileType2D || soilGeometryProbability.SoilProfileType == SoilProfileType.ProfileTypeStiFile)
{
evaluationJob.FailedEvaluatedLocations.Add(location);
- SendMessage(new LogMessage(LogMessageType.Warning, location,
+ StoreMessage(new LogMessage(LogMessageType.Warning, location,
LocalizationManager.GetTranslatedText(this, "Geometry2DNotSupportedInRegionalAssessment") +
string.Format("Segment: {0}", location.Segment.Name)));
}
else
{
SoilProfile soilProfile = soilGeometryProbability.SoilProfile1D;
- IList regionalScenarios;
+ IList regionalScenarios;
try
{
regionalScenarios = GetRegionalScenarios(location, soilGeometryProbability);
@@ -283,14 +204,14 @@
if (evaluationJob.FailedEvaluatedLocations.IndexOf(location) < 0)
{
evaluationJob.FailedEvaluatedLocations.Add(location);
- SendMessage(new LogMessage(LogMessageType.Warning, location,
+ StoreMessage(new LogMessage(LogMessageType.Warning, location,
String.Format("Cannot generate scenarios: {0}", e.Message) +
String.Format("Soilprofile: {0}", soilProfile.Name)));
}
}
if (regionalScenarios != null)
{
- foreach (RegionalScenarioProfileResult job in regionalScenarios)
+ foreach (RegionalScenarioProfileJob job in regionalScenarios)
{
tasks.Add(job);
}
@@ -304,7 +225,7 @@
return tasks;
}
- private IList GetRegionalScenarios(Location location, SoilGeometryProbability soilGeometryProbability)
+ private IList GetRegionalScenarios(Location location, SoilGeometryProbability soilGeometryProbability)
{
RegionalScenarioSelector selector = new RegionalScenarioSelector()
{
@@ -315,7 +236,7 @@
private void RunTask(object task)
{
- var job = (RegionalScenarioProfileResult)task;
+ var job = (RegionalScenarioProfileJob)task;
try
{
@@ -331,15 +252,15 @@
catch (Exception e)
{
job.CalculationResult = CalculationResult.UnexpectedError;
- SendMessage(new LogMessage(LogMessageType.Warning, job, string.Format(job.LocationName + " Error: {0}", e.Message)));
+ StoreMessage(new LogMessage(LogMessageType.Warning, job, string.Format(job.LocationName + " Error: {0}", e.Message)));
}
}
///
/// Select which job processor to use, depending on failuremechanism
///
///
- private void ProcessJob(RegionalScenarioProfileResult job)
+ private void ProcessJob(RegionalScenarioProfileJob job)
{
Debug.WriteLine("Job {0}, Location {1}, Profile {2}, Scenario {3}, LoadSituation {4}", job.FailureMechanismType.ToString(), job.LocationName, job.SoilProfileName, job.ScenarioType.ToString(), job.LoadSituation.ToString());
switch (job.FailureMechanismType)
@@ -351,15 +272,15 @@
ProcessJobPiping(job);
break;
default:
- throw new RegionalScenariosCalculationException(String.Format("Failuremechanism {0} not yet implemented for scenario calculation", job.FailureMechanismType));
+ throw new RegionalAssessmentCalculatorException(String.Format("Failuremechanism {0} not yet implemented for scenario calculation", job.FailureMechanismType));
}
}
///
/// Process a job for failuremechanism Stability
///
///
- private void ProcessJobStability(RegionalScenarioProfileResult job)
+ private void ProcessJobStability(RegionalScenarioProfileJob job)
{
job.CurrentSpecification = damProjectData.DamProjectCalculationSpecification.CurrentSpecification.Clone();
job.CurrentSpecification.CalculationModel = job.MstabModelOption;
@@ -369,7 +290,7 @@
job.CurrentSpecification.AssessmentScenarioJobSettings.LoadSituation = job.LoadSituation;
job.CurrentSpecification.AssessmentScenarioJobSettings.DikeDrySensitivity = job.DikeDrySensitivity;
job.CurrentSpecification.AssessmentScenarioJobSettings.HydraulicShortcutType = job.HydraulicShortcutType;
- var calculator = CreateKernelWrapper(job.CurrentSpecification);
+ var kernelWrapper = CreateKernelWrapper(job.CurrentSpecification);
job.Hbp = job.Location.BoezemLevelHbp;
job.Lbp = job.Location.BoezemLevelLbp;
@@ -379,24 +300,24 @@
job.Hbp = job.Location.BoezemLevelTp;
job.Lbp = job.Location.BoezemLevelTp;
}
- PerformJob(job, calculator);
+ PerformJob(job, kernelWrapper);
}
///
/// Process a job for failuremechanism Piping
///
///
- private void ProcessJobPiping(RegionalScenarioProfileResult job)
+ private void ProcessJobPiping(RegionalScenarioProfileJob job)
{
if (job.Location.ModelFactors.UpliftCriterionPiping.HasValue)
{
- job.CurrentSpecification = damProjectData.DamProjectCalculationSpecification.CurrentSpecification.Clone(); // must this be a copy?
+ job.CurrentSpecification = damProjectData.DamProjectCalculationSpecification.CurrentSpecification.Clone();
job.CurrentSpecification.FailureMechanismSystemType = job.FailureMechanismType;
job.CurrentSpecification.PipingModelType = job.PipingModelOption;
job.CurrentSpecification.AssessmentScenarioJobSettings.LoadSituation = job.LoadSituation;
job.CurrentSpecification.AssessmentScenarioJobSettings.DikeDrySensitivity = job.DikeDrySensitivity;
job.CurrentSpecification.AssessmentScenarioJobSettings.HydraulicShortcutType = job.HydraulicShortcutType;
- var calculator = CreateKernelWrapper(job.CurrentSpecification);
+ var kernelWrapper = CreateKernelWrapper(job.CurrentSpecification);
// For piping waterlevel needs to be set here. Piping kernel only uses waterlevelhigh which is set from BoezemLevelHbp.
job.Hbp = job.Location.BoezemLevelHbp;
switch (job.LoadSituation)
@@ -408,11 +329,11 @@
job.Hbp = job.Location.BoezemLevelTp;
break;
}
- PerformJob(job, calculator);
+ PerformJob(job, kernelWrapper);
}
else
{
- throw new RegionalScenariosCalculationException(String.Format("Uplift criterion not defined for location {0}", job.Location.Name));
+ throw new RegionalAssessmentCalculatorException(String.Format("Uplift criterion not defined for location {0}", job.Location.Name));
}
}
@@ -428,14 +349,14 @@
return kernelWrapper;
}
- private void PerformJob(RegionalScenarioProfileResult job, IKernelWrapper calculator)
+ private void PerformJob(RegionalScenarioProfileJob job, IKernelWrapper kernelWrapper)
{
lock (runningJobs)
{
- runningJobs[calculator] = job;
+ runningJobs[kernelWrapper] = job;
}
- CreateKernelWrapperforJob(calculator, job);
+ PrepareKernelWrapperforJob(kernelWrapper, job, damProjectData.ProjectPath, damProjectData.CalculationMap);
var kernelDataInput = (job.KernelDataInput as IKernelDataInput);
var kernelDataOutput = (job.KernelDataOutput as IKernelDataOutput);
var damKernelInput = (job.DamKernelInput as DamKernelInput);
@@ -460,7 +381,7 @@
if (!errorFound && job.CalculationMessages.Count == 0)
{
List messages;
- calculator.Execute(kernelDataInput, kernelDataOutput, out messages);
+ kernelWrapper.Execute(kernelDataInput, kernelDataOutput, out messages);
job.CalculationResult = CalculationResult.Succeeded;
foreach (var logMessage in messages)
{
@@ -473,7 +394,7 @@
{
string resultMessage = "";
List results;
- calculator.PostProcess(damKernelInput, kernelDataOutput, null, resultMessage, out results);
+ kernelWrapper.PostProcess(damKernelInput, kernelDataOutput, null, resultMessage, out results);
job.Results = results;
var stbOutput = kernelDataOutput as DamMacroStabilityOutput;
if (stbOutput != null)
@@ -506,20 +427,19 @@
}
lock (runningJobs)
{
- runningJobs.Remove(calculator);
+ runningJobs.Remove(kernelWrapper);
}
}
- private void CreateKernelWrapperforJob(IKernelWrapper kernelWrapper, RegionalScenarioProfileResult job)
+ private void PrepareKernelWrapperforJob(IKernelWrapper kernelWrapper, RegionalScenarioProfileJob job, string projectPath, string calculationMap)
{
- // Todo Bka: eliminate damProjectData usages.
job.CalculationMessages = new List();
// Prepare input
job.DamKernelInput = new DamKernelInput();
- var projectPath = damProjectData.ProjectPath != "" ? damProjectData.ProjectPath : Directory.GetCurrentDirectory();
+ var locProjectPath = projectPath != "" ? projectPath : Directory.GetCurrentDirectory();
var damKernelInput = job.DamKernelInput as DamKernelInput;
- damKernelInput.ProjectDir = projectPath;
- damKernelInput.CalculationDir = Path.Combine(projectPath, damProjectData.CalculationMap);
+ damKernelInput.ProjectDir = locProjectPath;
+ damKernelInput.CalculationDir = Path.Combine(locProjectPath, calculationMap);
damKernelInput.Location = job.Location;
damKernelInput.SubSoilScenario = job.SoilGeometryProbability;
damKernelInput.DamFailureMechanismeCalculationSpecification = job.CurrentSpecification;
@@ -558,7 +478,7 @@
///
/// Fill the results for the scenarios
///
- private void FillResults(List tasks)
+ private void FillResults(List tasks)
{
// Fill scenariosResult structure with jobs just run
foreach (Location location in evaluationJob.Locations)
@@ -570,7 +490,7 @@
if (evaluationJob.FailedEvaluatedLocations.IndexOf(location) < 0)
{
// scenarios were succesfully created, so results are available
- foreach (RegionalScenarioProfileResult job in tasks)
+ foreach (RegionalScenarioProfileJob job in tasks)
{
if (job.LocationName.Equals(location.Name))
{
@@ -625,7 +545,7 @@
SafetyFactor = double.NaN
};
evaluationJob.Results.Add(scenariosResult);
- SendMessage(new LogMessage(LogMessageType.Warning, location,
+ StoreMessage(new LogMessage(LogMessageType.Warning, location,
string.Format("Error in location {0}: {1}", location.Name, e.Message)));
}
}
@@ -673,13 +593,9 @@
}
}
- private void SendMessage(LogMessage logMessage)
+ private void StoreMessage(LogMessage logMessage)
{
- damProjectData.CalculationMessages.Add(logMessage);
- if (sendMessageDelegate != null)
- {
- sendMessageDelegate(logMessage);
- }
+ damProjectData.CalculationMessages.Add(logMessage);
}
}
}
Fisheye: Tag 1732 refers to a dead (removed) revision in file `DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/Calculation/ICalculation.cs'.
Fisheye: No comparison available. Pass `N' to diff?