Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/MStabParameters.cs =================================================================== diff -u -r3526 -r3625 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/MStabParameters.cs (.../MStabParameters.cs) (revision 3526) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/MStabParameters.cs (.../MStabParameters.cs) (revision 3625) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections; using System.ComponentModel; using System.Xml.Serialization; using Deltares.Standard.Attributes; @@ -626,7 +627,7 @@ } } - public class MStabParameters : ICloneable, IVisibleEnabled + public class MStabParameters : ICloneable, IVisibleEnabled, IDomain { private MStabGridPosition gridPosition; @@ -816,6 +817,40 @@ } } + /// + /// Gets the domain to ensure proper options for the search method depending on FailureMechanismSystemType and model. + /// + /// The property. + /// + public ICollection GetDomain(string property) + { + if (property == "SearchMethod") + { + if (SlipCircleDefinition.Specification.FailureMechanismSystemType == + FailureMechanismSystemType.StabilityInside && (Model == MStabModelType.UpliftVan || Model == MStabModelType.BishopUpliftVan)) + { + return new[] + {MStabSearchMethod.Grid, MStabSearchMethod.BeeSwarm}; + } + if (SlipCircleDefinition.Specification.FailureMechanismSystemType == + FailureMechanismSystemType.StabilityInside && Model == MStabModelType.Spencer) + { + return new[] + {MStabSearchMethod.Grid, MStabSearchMethod.GeneticAlgorithm}; + } + // Make sure that grid is reset and updated too when needed. + if (SearchMethod != MStabSearchMethod.Grid) + { + DataEventPublisher.BeforeChange(this, "SearchMethod"); + SearchMethod = MStabSearchMethod.Grid; + DataEventPublisher.AfterChange(this, "SearchMethod"); + } + + return new[] {MStabSearchMethod.Grid}; + } + return null; + } + #endregion } Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/ConversionHelper.cs =================================================================== diff -u -r3526 -r3625 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/ConversionHelper.cs (.../ConversionHelper.cs) (revision 3526) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DamEngineIo/ConversionHelper.cs (.../ConversionHelper.cs) (revision 3625) @@ -647,6 +647,11 @@ public const int InputSearchMethodGenetic = 1; /// + /// The input search method bee swarm + /// + public const int InputSearchMethodBeeSwarm = 2; + + /// /// Converts to input search method. /// /// The search method. @@ -679,6 +684,9 @@ }, { InputSearchMethodGenetic, MStabSearchMethod.GeneticAlgorithm + }, + { + InputSearchMethodBeeSwarm, MStabSearchMethod.BeeSwarm } }; return translationTable[searchMethod]; Index: DamClients/DamUI/trunk/src/Dam/Tests/DamEngineIo/ConversionHelperTests.cs =================================================================== diff -u -r3527 -r3625 --- DamClients/DamUI/trunk/src/Dam/Tests/DamEngineIo/ConversionHelperTests.cs (.../ConversionHelperTests.cs) (revision 3527) +++ DamClients/DamUI/trunk/src/Dam/Tests/DamEngineIo/ConversionHelperTests.cs (.../ConversionHelperTests.cs) (revision 3625) @@ -302,6 +302,7 @@ [Test] [TestCase(MStabSearchMethod.Grid, ConversionHelper.InputSearchMethodGrid)] [TestCase(MStabSearchMethod.GeneticAlgorithm, ConversionHelper.InputSearchMethodGenetic)] + [TestCase(MStabSearchMethod.BeeSwarm, ConversionHelper.InputSearchMethodBeeSwarm)] public void CanConvertToInputSearchMethod(MStabSearchMethod searchMethod, int inputSearchMethod) { Assert.AreEqual(inputSearchMethod, ConversionHelper.ConvertToInputSearchMethod(searchMethod)); @@ -310,6 +311,8 @@ [Test] [TestCase(ConversionHelper.InputSearchMethodGrid, MStabSearchMethod.Grid)] [TestCase(ConversionHelper.InputSearchMethodGenetic, MStabSearchMethod.GeneticAlgorithm)] + [TestCase(ConversionHelper.InputSearchMethodBeeSwarm, MStabSearchMethod.BeeSwarm)] + public void CanConvertToSearchMethod(int inputSearchMethod, MStabSearchMethod searchMethod) { Assert.AreEqual(searchMethod, ConversionHelper.ConvertToSearchMethod(inputSearchMethod)); Index: DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DAMEnumerations.cs =================================================================== diff -u -r3526 -r3625 --- DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DAMEnumerations.cs (.../DAMEnumerations.cs) (revision 3526) +++ DamClients/DamUI/trunk/src/DamClientsLibrary/Deltares.Dam.Data/DAMEnumerations.cs (.../DAMEnumerations.cs) (revision 3625) @@ -122,7 +122,8 @@ public enum MStabSearchMethod { Grid, - GeneticAlgorithm + GeneticAlgorithm, + BeeSwarm } public enum MStabGridPosition @@ -286,7 +287,7 @@ { Available, // Option is implemented and available NotAvailable, // Option is implemented and available (can be used when combination is in development, so it will be hidden) - NotImplemented // Option is not implemented (so also no available) + NotImplemented // Option is not implemented (so also not available) } public enum IntrusionVerticalWaterPressureType