- Timestamp:
- 11/25/15 23:24:01 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3
- Files:
-
- 3 added
- 19 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/HeuristicLab.Encodings.RealVectorEncoding-3.3.csproj
r11961 r13403 115 115 <ItemGroup> 116 116 <Compile Include="Creators\NormalDistributedRealVectorCreator.cs" /> 117 <Compile Include="Interfaces\IRealVectorAdditiveMoveQualityOperator.cs" /> 118 <Compile Include="Interfaces\IRealVectorBoundedOperator.cs" /> 117 119 <Compile Include="Interfaces\IRealVectorMultiNeighborhoodShakingOperator.cs" /> 120 <Compile Include="Interfaces\IRealVectorSolutionsOperator.cs" /> 121 <Compile Include="Interfaces\IRealVectorSolutionOperator.cs" /> 118 122 <Compile Include="ParticleOperators\RealVectorParticleCreator.cs" /> 119 123 <Compile Include="Crossovers\BlendAlphaBetaCrossover.cs" /> … … 157 161 <Compile Include="Interfaces\IRealVectorStdDevStrategyParameterManipulator.cs" /> 158 162 <Compile Include="Interfaces\IRealVectorStdDevStrategyParameterOperator.cs" /> 159 <Compile Include="Interfaces\I AdditiveRealVectorMoveOperator.cs" />163 <Compile Include="Interfaces\IRealVectorAdditiveMoveOperator.cs" /> 160 164 <Compile Include="Interfaces\IRealVectorBoundsChecker.cs" /> 161 165 <Compile Include="Interfaces\IRealVectorMoveGenerator.cs" /> -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorAdditiveMoveOperator.cs
r13402 r13403 23 23 24 24 namespace HeuristicLab.Encodings.RealVectorEncoding { 25 public interface I AdditiveRealVectorMoveOperator : IRealVectorMoveOperator {25 public interface IRealVectorAdditiveMoveOperator : IRealVectorMoveOperator { 26 26 ILookupParameter<AdditiveMove> AdditiveMoveParameter { get; } 27 27 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorAdditiveMoveQualityOperator.cs
r13393 r13403 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Data; 23 24 24 25 namespace HeuristicLab.Encodings.RealVectorEncoding { 25 public interface I AdditiveRealVectorMoveOperator : IRealVectorMoveOperator {26 ILookupParameter< AdditiveMove> AdditiveMoveParameter { get; }26 public interface IRealVectorAdditiveMoveQualityOperator : IRealVectorAdditiveMoveOperator { 27 ILookupParameter<DoubleValue> MoveQualityParameter { get; } 27 28 } 28 29 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorCreator.cs
r13361 r13403 28 28 /// An interface which represents an operator for creating vectors of real-valued data. 29 29 /// </summary> 30 public interface IRealVectorCreator : IRealVector Operator, ISolutionCreator<RealVector> {30 public interface IRealVectorCreator : IRealVectorSolutionOperator, IRealVectorBoundedOperator, ISolutionCreator<RealVector> { 31 31 IValueLookupParameter<IntValue> LengthParameter { get; } 32 IValueLookupParameter<DoubleMatrix> BoundsParameter { get; }33 ILookupParameter<RealVector> RealVectorParameter { get; }34 32 } 35 33 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorCrossover.cs
r12012 r13403 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Data;24 23 using HeuristicLab.Optimization; 25 24 … … 28 27 /// An interface which represents an operator for crossing vectors of real-valued data. 29 28 /// </summary> 30 public interface IRealVectorCrossover : IRealVector Operator, ICrossover {29 public interface IRealVectorCrossover : IRealVectorBoundedOperator, ICrossover { 31 30 ILookupParameter<ItemArray<RealVector>> ParentsParameter { get; } 32 31 ILookupParameter<RealVector> ChildParameter { get; } 33 IValueLookupParameter<DoubleMatrix> BoundsParameter { get; }34 32 } 35 33 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorManipulator.cs
r12012 r13403 20 20 #endregion 21 21 22 using HeuristicLab.Core;23 using HeuristicLab.Data;24 22 using HeuristicLab.Optimization; 25 23 … … 28 26 /// An interface which represents an operator for manipulating vectors of real-valued data. 29 27 /// </summary> 30 public interface IRealVectorManipulator : IRealVectorOperator, IManipulator { 31 ILookupParameter<RealVector> RealVectorParameter { get; } 32 IValueLookupParameter<DoubleMatrix> BoundsParameter { get; } 28 public interface IRealVectorManipulator : IRealVectorSolutionOperator, IRealVectorBoundedOperator, IManipulator { 33 29 } 34 30 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorMoveGenerator.cs
r12012 r13403 20 20 #endregion 21 21 22 using HeuristicLab.Core;23 using HeuristicLab.Data;24 22 using HeuristicLab.Optimization; 25 23 26 24 namespace HeuristicLab.Encodings.RealVectorEncoding { 27 public interface IRealVectorMoveGenerator : IRealVectorMoveOperator, IMoveGenerator { 28 IValueLookupParameter<DoubleMatrix> BoundsParameter { get; } 25 public interface IRealVectorMoveGenerator : IRealVectorMoveOperator, IRealVectorBoundedOperator, IMoveGenerator { 29 26 } 30 27 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorMoveOperator.cs
r12012 r13403 20 20 #endregion 21 21 22 using HeuristicLab.Core;23 22 using HeuristicLab.Optimization; 24 23 25 24 namespace HeuristicLab.Encodings.RealVectorEncoding { 26 public interface IRealVectorMoveOperator : IRealVectorOperator, IMoveOperator { 27 ILookupParameter<RealVector> RealVectorParameter { get; } 25 public interface IRealVectorMoveOperator : IRealVectorSolutionOperator, IMoveOperator { 28 26 } 29 27 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorMultiNeighborhoodShakingOperator.cs
r12012 r13403 20 20 #endregion 21 21 22 using HeuristicLab.Core;23 using HeuristicLab.Data;24 22 25 23 namespace HeuristicLab.Encodings.RealVectorEncoding { 26 public interface IRealVectorMultiNeighborhoodShakingOperator : IRealVectorOperator { 27 ILookupParameter<RealVector> RealVectorParameter { get; } 28 IValueLookupParameter<DoubleMatrix> BoundsParameter { get; } 24 public interface IRealVectorMultiNeighborhoodShakingOperator : IRealVectorSolutionOperator, IRealVectorBoundedOperator { 29 25 } 30 26 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleCreator.cs
r12012 r13403 20 20 #endregion 21 21 22 using HeuristicLab.Optimization;23 22 using HeuristicLab.Core; 24 23 using HeuristicLab.Data; 24 using HeuristicLab.Optimization; 25 25 26 26 namespace HeuristicLab.Encodings.RealVectorEncoding { 27 public interface IRealVectorParticleCreator : IParticleCreator, IRealVector Operator {27 public interface IRealVectorParticleCreator : IParticleCreator, IRealVectorSolutionOperator, IRealVectorBoundedOperator { 28 28 ILookupParameter<IntValue> ProblemSizeParameter { get; } 29 ILookupParameter<RealVector> RealVectorParameter { get; }30 29 ILookupParameter<RealVector> PersonalBestParameter { get; } 31 IValueLookupParameter<DoubleMatrix> BoundsParameter { get; }32 30 ILookupParameter<RealVector> VelocityParameter { get; } 33 31 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorParticleUpdater.cs
r12012 r13403 25 25 26 26 namespace HeuristicLab.Encodings.RealVectorEncoding { 27 public interface IRealVectorParticleUpdater : IParticleUpdater, IRealVector Operator {27 public interface IRealVectorParticleUpdater : IParticleUpdater, IRealVectorSolutionOperator, IRealVectorBoundedOperator { 28 28 ILookupParameter<RealVector> VelocityParameter { get; } 29 29 ILookupParameter<DoubleMatrix> CurrentVelocityBoundsParameter { get; } 30 ILookupParameter<RealVector> RealVectorParameter { get; }31 ILookupParameter<DoubleMatrix> BoundsParameter { get; }32 30 ILookupParameter<RealVector> PersonalBestParameter { get; } 33 31 ILookupParameter<RealVector> NeighborBestParameter { get; } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorStdDevStrategyParameterCreator.cs
r12012 r13403 25 25 26 26 namespace HeuristicLab.Encodings.RealVectorEncoding { 27 public interface IRealVectorStdDevStrategyParameterCreator : IRealVectorStdDevStrategyParameterOperator, IStrategyParameterCreator {27 public interface IRealVectorStdDevStrategyParameterCreator : IRealVectorStdDevStrategyParameterOperator, IStrategyParameterCreator, IRealVectorBoundedOperator { 28 28 ILookupParameter<RealVector> StrategyParameterParameter { get; } 29 29 IValueLookupParameter<IntValue> LengthParameter { get; } 30 IValueLookupParameter<DoubleMatrix> BoundsParameter { get; }31 30 } 32 31 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorStdDevStrategyParameterManipulator.cs
r12012 r13403 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Data;24 23 using HeuristicLab.Optimization; 25 24 26 25 namespace HeuristicLab.Encodings.RealVectorEncoding { 27 public interface IRealVectorStdDevStrategyParameterManipulator : IRealVectorStdDevStrategyParameterOperator, IStrategyParameterManipulator {26 public interface IRealVectorStdDevStrategyParameterManipulator : IRealVectorStdDevStrategyParameterOperator, IStrategyParameterManipulator, IRealVectorBoundedOperator { 28 27 ILookupParameter<RealVector> StrategyParameterParameter { get; } 29 IValueLookupParameter<DoubleMatrix> BoundsParameter { get; }30 28 } 31 29 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Interfaces/IRealVectorSwarmUpdater.cs
r12012 r13403 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Optimization; 23 using HeuristicLab.Optimization; 24 24 25 25 namespace HeuristicLab.Encodings.RealVectorEncoding { 26 public interface IRealVectorSwarmUpdater : ISwarmUpdater, IRealVector Operator {26 public interface IRealVectorSwarmUpdater : ISwarmUpdater, IRealVectorSolutionsOperator { 27 27 IScopeTreeLookupParameter<RealVector> NeighborBestParameter { get; } 28 28 IScopeTreeLookupParameter<RealVector> PersonalBestParameter { get; } 29 IScopeTreeLookupParameter<RealVector> RealVectorParameter { get; }30 29 } 31 30 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveGenerator.cs
r12012 r13403 31 31 [Item("AdditiveMoveGenerator", "Base class for all additive move generators.")] 32 32 [StorableClass] 33 public abstract class AdditiveMoveGenerator : SingleSuccessorOperator, I AdditiveRealVectorMoveOperator, IMoveGenerator, IStochasticOperator {33 public abstract class AdditiveMoveGenerator : SingleSuccessorOperator, IRealVectorAdditiveMoveOperator, IMoveGenerator, IStochasticOperator { 34 34 public override bool CanChangeName { 35 35 get { return false; } … … 43 43 public ILookupParameter<AdditiveMove> AdditiveMoveParameter { 44 44 get { return (LookupParameter<AdditiveMove>)Parameters["AdditiveMove"]; } 45 }46 protected ScopeParameter CurrentScopeParameter {47 get { return (ScopeParameter)Parameters["CurrentScope"]; }48 45 } 49 46 public IValueLookupParameter<DoubleMatrix> BoundsParameter { … … 59 56 Parameters.Add(new LookupParameter<RealVector>("RealVector", "The real vector for which moves should be generated.")); 60 57 Parameters.Add(new LookupParameter<AdditiveMove>("AdditiveMove", "The moves that should be generated in subscopes.")); 61 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes."));62 58 Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "A 2 column matrix specifying the lower and upper bound for each dimension. If there are less rows than dimension the bounds vector is cycled.")); 63 59 } … … 72 68 moveScopes[i].Variables.Add(new Variable(AdditiveMoveParameter.ActualName, moves[i])); 73 69 } 74 CurrentScopeParameter.ActualValue.SubScopes.AddRange(moveScopes);70 ExecutionContext.Scope.SubScopes.AddRange(moveScopes); 75 71 return base.Apply(); 76 72 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveMaker.cs
r12012 r13403 31 31 [Item("AdditiveMoveMaker", "Peforms an additive move on a given real vector and updates the quality.")] 32 32 [StorableClass] 33 public class AdditiveMoveMaker : SingleSuccessorOperator, I AdditiveRealVectorMoveOperator, IMoveMaker, ISingleObjectiveOperator {33 public class AdditiveMoveMaker : SingleSuccessorOperator, IRealVectorAdditiveMoveQualityOperator, IMoveMaker, ISingleObjectiveOperator { 34 34 public override bool CanChangeName { 35 35 get { return false; } … … 63 63 } 64 64 65 public static void Apply(RealVector realVector, AdditiveMove move) { 66 realVector[move.Dimension] += move.MoveDistance; 67 } 68 65 69 public override IOperation Apply() { 66 AdditiveMove move = AdditiveMoveParameter.ActualValue; 67 RealVector realVector = RealVectorParameter.ActualValue; 68 DoubleValue moveQuality = MoveQualityParameter.ActualValue; 69 DoubleValue quality = QualityParameter.ActualValue; 70 Apply(RealVectorParameter.ActualValue, AdditiveMoveParameter.ActualValue); 71 var moveQuality = MoveQualityParameter.ActualValue; 72 var quality = QualityParameter.ActualValue; 70 73 71 realVector[move.Dimension] += move.MoveDistance;72 74 quality.Value = moveQuality.Value; 73 75 -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuChecker.cs
r12012 r13403 32 32 [Item("AdditiveMoveTabuChecker", "Prevents falling back into ranges that have been moved over before.")] 33 33 [StorableClass] 34 public class AdditiveMoveTabuChecker : SingleSuccessorOperator, I AdditiveRealVectorMoveOperator, ITabuChecker {34 public class AdditiveMoveTabuChecker : SingleSuccessorOperator, IRealVectorAdditiveMoveQualityOperator, ITabuChecker { 35 35 public override bool CanChangeName { 36 36 get { return false; } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuMaker.cs
r12012 r13403 29 29 [Item("AdditiveMoveTabuMaker", "Sets the move tabu.")] 30 30 [StorableClass] 31 public class AdditiveMoveTabuMaker : TabuMaker, I AdditiveRealVectorMoveOperator {31 public class AdditiveMoveTabuMaker : TabuMaker, IRealVectorAdditiveMoveQualityOperator { 32 32 public ILookupParameter<AdditiveMove> AdditiveMoveParameter { 33 33 get { return (ILookupParameter<AdditiveMove>)Parameters["AdditiveMove"]; } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorParticleUpdater.cs
r12012 r13403 57 57 get { return (ILookupParameter<RealVector>)Parameters["RealVector"]; } 58 58 } 59 public I LookupParameter<DoubleMatrix> BoundsParameter {60 get { return (I LookupParameter<DoubleMatrix>)Parameters["Bounds"]; }59 public IValueLookupParameter<DoubleMatrix> BoundsParameter { 60 get { return (IValueLookupParameter<DoubleMatrix>)Parameters["Bounds"]; } 61 61 } 62 62 public ILookupParameter<DoubleMatrix> CurrentVelocityBoundsParameter { … … 124 124 Parameters.Add(new LookupParameter<RealVector>("BestRealVector", "Global best position.")); 125 125 Parameters.Add(new LookupParameter<RealVector>("NeighborBest", "Best neighboring solution.")); 126 Parameters.Add(new LookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds for each dimension of the position vector for the current problem."));126 Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "The lower and upper bounds for each dimension of the position vector for the current problem.")); 127 127 Parameters.Add(new LookupParameter<DoubleMatrix>("CurrentVelocityBounds", "Upper and lower bounds for the particle's velocity vector.")); 128 128 Parameters.Add(new LookupParameter<DoubleValue>("CurrentInertia", "The weight for the particle's velocity vector.")); -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/ParticleOperators/RealVectorSwarmUpdater.cs
r12012 r13403 54 54 get { return (IScopeTreeLookupParameter<DoubleValue>)Parameters["NeighborBestQuality"]; } 55 55 } 56 public IScopeTreeLookupParameter<RealVector> RealVector Parameter {57 get { return (IScopeTreeLookupParameter<RealVector>)Parameters["RealVector "]; }56 public IScopeTreeLookupParameter<RealVector> RealVectorsParameter { 57 get { return (IScopeTreeLookupParameter<RealVector>)Parameters["RealVectors"]; } 58 58 } 59 59 public IScopeTreeLookupParameter<RealVector> PersonalBestParameter { … … 131 131 set { NeighborBestQualityParameter.ActualValue = value; } 132 132 } 133 private ItemArray<RealVector> RealVector {134 get { return RealVector Parameter.ActualValue; }133 private ItemArray<RealVector> RealVectors { 134 get { return RealVectorsParameter.ActualValue; } 135 135 } 136 136 private ItemArray<RealVector> PersonalBest { … … 186 186 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("PersonalBestQuality", "Particles' personal best qualities.")); 187 187 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("NeighborBestQuality", "Best neighbor particles' qualities.")); 188 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("RealVector ", "Particles' positions."));188 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("RealVectors", "Particles' positions.")); 189 189 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("PersonalBest", "Particles' personal best positions.")); 190 190 Parameters.Add(new ScopeTreeLookupParameter<RealVector>("NeighborBest", "Neighborhood (or global in case of totally connected neighborhood) best particle positions.")); … … 288 288 SwarmBestQuality = new DoubleValue(); 289 289 SwarmBestQuality.Value = Maximization ? Quality.Max(v => v.Value) : Quality.Min(v => v.Value); 290 BestRealVector = (RealVector)RealVector [Quality.FindIndex(v => v.Value == SwarmBestQuality.Value)].Clone();290 BestRealVector = (RealVector)RealVectors[Quality.FindIndex(v => v.Value == SwarmBestQuality.Value)].Clone(); 291 291 } 292 292 … … 296 296 var neighborBestQuality = new ItemArray<DoubleValue>(Neighbors.Length); 297 297 for (int n = 0; n < Neighbors.Length; n++) { 298 var pairs = Quality.Zip(RealVector , (q, p) => new { Quality = q, Point = p })298 var pairs = Quality.Zip(RealVectors, (q, p) => new { Quality = q, Point = p }) 299 299 .Where((p, i) => i == n || Neighbors[n].Contains(i)); 300 300 var bestNeighbor = Maximization ? … … 312 312 if (PersonalBestQuality.Length == 0) 313 313 PersonalBestQuality = (ItemArray<DoubleValue>)Quality.Clone(); 314 for (int i = 0; i < RealVector .Length; i++) {314 for (int i = 0; i < RealVectors.Length; i++) { 315 315 if (Maximization && Quality[i].Value > PersonalBestQuality[i].Value || 316 316 !Maximization && Quality[i].Value < PersonalBestQuality[i].Value) { 317 317 PersonalBestQuality[i].Value = Quality[i].Value; 318 PersonalBest[i] = RealVector [i];318 PersonalBest[i] = RealVectors[i]; 319 319 } 320 320 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorEncoding.cs
r13396 r13403 171 171 typeof (IRealVectorBoundsChecker), 172 172 typeof (IRealVectorMoveOperator), 173 typeof (IRealVectorMoveGenerator) 173 typeof (IRealVectorMoveGenerator), 174 typeof (IRealVectorSolutionOperator), 175 typeof (IRealVectorSolutionsOperator), 176 typeof (IRealVectorBoundedOperator) 174 177 }; 175 178 } … … 209 212 ConfigureMoveGenerators(operators.OfType<IRealVectorMoveGenerator>()); 210 213 ConfigureMoveOperators(operators.OfType<IRealVectorMoveOperator>()); 211 ConfigureAdditiveMoveOperator(operators.OfType<IAdditiveRealVectorMoveOperator>()); 214 ConfigureAdditiveMoveOperator(operators.OfType<IRealVectorAdditiveMoveOperator>()); 215 ConfigureRealVectorSolutionOperators(operators.OfType<IRealVectorSolutionOperator>()); 216 ConfigureRealVectorSolutionsOperators(operators.OfType<IRealVectorSolutionsOperator>()); 217 ConfigureRealVectorBoundedOperators(operators.OfType<IRealVectorBoundedOperator>()); 212 218 } 213 219 … … 215 221 private void ConfigureCreators(IEnumerable<IRealVectorCreator> creators) { 216 222 foreach (var creator in creators) { 217 creator.RealVectorParameter.ActualName = Name;218 223 creator.LengthParameter.ActualName = LengthParameter.Name; 219 creator.BoundsParameter.ActualName = BoundsParameter.Name;220 224 } 221 225 } … … 224 228 crossover.ChildParameter.ActualName = Name; 225 229 crossover.ParentsParameter.ActualName = Name; 226 crossover.BoundsParameter.ActualName = BoundsParameter.Name;227 230 } 228 231 } 229 232 private void ConfigureManipulators(IEnumerable<IRealVectorManipulator> manipulators) { 230 233 foreach (var manipulator in manipulators) { 231 manipulator.RealVectorParameter.ActualName = Name;232 manipulator.BoundsParameter.ActualName = BoundsParameter.Name;233 manipulator.BoundsParameter.Hidden = true;234 234 var sm = manipulator as ISelfAdaptiveManipulator; 235 235 if (sm != null) { … … 272 272 } 273 273 private void ConfigureSwarmUpdaters(IEnumerable<IRealVectorSwarmUpdater> swarmUpdaters) { 274 foreach (var su in swarmUpdaters) { 275 su.RealVectorParameter.ActualName = Name; 276 } 274 // swarm updaters don't have additional parameters besides the solution parameter 277 275 } 278 276 private void ConfigureParticleCreators(IEnumerable<IRealVectorParticleCreator> particleCreators) { 279 277 foreach (var particleCreator in particleCreators) { 280 particleCreator.RealVectorParameter.ActualName = Name;281 particleCreator.BoundsParameter.ActualName = BoundsParameter.Name;282 278 particleCreator.ProblemSizeParameter.ActualName = LengthParameter.Name; 283 279 } 284 280 } 285 281 private void ConfigureParticleUpdaters(IEnumerable<IRealVectorParticleUpdater> particleUpdaters) { 286 foreach (var particleUpdater in particleUpdaters) { 287 particleUpdater.RealVectorParameter.ActualName = Name; 288 particleUpdater.BoundsParameter.ActualName = BoundsParameter.Name; 289 } 282 // particle updaters don't have additional parameters besides solution and bounds parameter 290 283 } 291 284 private void ConfigureShakingOperators(IEnumerable<IRealVectorMultiNeighborhoodShakingOperator> shakingOperators) { 292 foreach (var shakingOperator in shakingOperators) { 293 shakingOperator.RealVectorParameter.ActualName = Name; 294 shakingOperator.BoundsParameter.ActualName = BoundsParameter.Name; 295 } 285 // shaking operators don't have additional parameters besides solution and bounds parameter 296 286 } 297 287 private void ConfigureBoundsCheckers(IEnumerable<IRealVectorBoundsChecker> boundsCheckers) { … … 302 292 } 303 293 private void ConfigureMoveOperators(IEnumerable<IRealVectorMoveOperator> moveOperators) { 304 foreach (var moveOperator in moveOperators) 305 moveOperator.RealVectorParameter.ActualName = Name; 306 } 307 294 // move operators don't have additional parameters besides the solution parameter 295 } 308 296 private void ConfigureMoveGenerators(IEnumerable<IRealVectorMoveGenerator> moveGenerators) { 309 foreach (var moveGenerator in moveGenerators) 310 moveGenerator.BoundsParameter.ActualName = BoundsParameter.Name; 311 } 312 313 private void ConfigureAdditiveMoveOperator(IEnumerable<IAdditiveRealVectorMoveOperator> additiveMoveOperators) { 297 // move generators don't have additional parameters besides solution and bounds parameter 298 } 299 private void ConfigureAdditiveMoveOperator(IEnumerable<IRealVectorAdditiveMoveOperator> additiveMoveOperators) { 314 300 foreach (var additiveMoveOperator in additiveMoveOperators) { 315 301 additiveMoveOperator.AdditiveMoveParameter.ActualName = Name + ".AdditiveMove"; 302 } 303 } 304 private void ConfigureRealVectorSolutionOperators(IEnumerable<IRealVectorSolutionOperator> solutionOperators) { 305 foreach (var solutionOperator in solutionOperators) 306 solutionOperator.RealVectorParameter.ActualName = Name; 307 } 308 private void ConfigureRealVectorSolutionsOperators(IEnumerable<IRealVectorSolutionsOperator> solutionsOperators) { 309 foreach (var solutionsOperator in solutionsOperators) 310 solutionsOperator.RealVectorsParameter.ActualName = Name; 311 } 312 private void ConfigureRealVectorBoundedOperators(IEnumerable<IRealVectorBoundedOperator> boundedOperators) { 313 foreach (var boundedOperator in boundedOperators) { 314 boundedOperator.BoundsParameter.ActualName = BoundsParameter.Name; 316 315 } 317 316 }
Note: See TracChangeset
for help on using the changeset viewer.