Changeset 9258 for trunk/sources/HeuristicLab.Problems.TestFunctions
- Timestamp:
- 02/28/13 15:38:12 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
r8720 r9258 20 20 #endregion 21 21 22 using System;23 using System.Collections.Generic;24 using System.Linq;25 22 using HeuristicLab.Analysis; 26 23 using HeuristicLab.Common; … … 32 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 33 30 using HeuristicLab.PluginInfrastructure; 31 using System; 32 using System.Collections.Generic; 33 using System.Linq; 34 34 35 35 namespace HeuristicLab.Problems.TestFunctions { … … 125 125 public override IDeepCloneable Clone(Cloner cloner) { 126 126 return new SingleObjectiveTestFunctionProblem(this, cloner); 127 }128 129 private bool IsNotFieldReferenced(IOperator x) {130 return !(x == strategyVectorCreator131 || x == strategyVectorCrossover132 || x == strategyVectorManipulator);133 127 } 134 128 … … 337 331 } 338 332 private void ParameterizeOperators() { 339 foreach ( IRealVectorCrossover op in Operators.OfType<IRealVectorCrossover>()) {333 foreach (var op in Operators.OfType<IRealVectorCrossover>()) { 340 334 op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 341 335 op.ParentsParameter.Hidden = true; … … 345 339 op.BoundsParameter.Hidden = true; 346 340 } 347 foreach ( IRealVectorManipulator op in Operators.OfType<IRealVectorManipulator>()) {341 foreach (var op in Operators.OfType<IRealVectorManipulator>()) { 348 342 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 349 343 op.RealVectorParameter.Hidden = true; … … 351 345 op.BoundsParameter.Hidden = true; 352 346 } 353 foreach ( IRealVectorMoveOperator op in Operators.OfType<IRealVectorMoveOperator>()) {354 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 355 op.RealVectorParameter.Hidden = true; 356 } 357 foreach ( IRealVectorMoveGenerator op in Operators.OfType<IRealVectorMoveGenerator>()) {347 foreach (var op in Operators.OfType<IRealVectorMoveOperator>()) { 348 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 349 op.RealVectorParameter.Hidden = true; 350 } 351 foreach (var op in Operators.OfType<IRealVectorMoveGenerator>()) { 358 352 op.BoundsParameter.ActualName = BoundsParameter.Name; 359 353 op.BoundsParameter.Hidden = true; 360 354 } 361 foreach ( ISingleObjectiveTestFunctionAdditiveMoveEvaluator op in Operators.OfType<ISingleObjectiveTestFunctionAdditiveMoveEvaluator>()) {355 foreach (var op in Operators.OfType<ISingleObjectiveTestFunctionAdditiveMoveEvaluator>()) { 362 356 op.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName; 363 357 op.QualityParameter.Hidden = true; … … 365 359 op.RealVectorParameter.Hidden = true; 366 360 } 367 foreach ( IRealVectorParticleCreator op in Operators.OfType<IRealVectorParticleCreator>()) {361 foreach (var op in Operators.OfType<IRealVectorParticleCreator>()) { 368 362 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 369 363 op.RealVectorParameter.Hidden = true; … … 373 367 op.ProblemSizeParameter.Hidden = true; 374 368 } 375 foreach ( IRealVectorParticleUpdater op in Operators.OfType<IRealVectorParticleUpdater>()) {369 foreach (var op in Operators.OfType<IRealVectorParticleUpdater>()) { 376 370 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 377 371 op.RealVectorParameter.Hidden = true; … … 379 373 op.BoundsParameter.Hidden = true; 380 374 } 381 foreach ( IRealVectorSwarmUpdater op in Operators.OfType<IRealVectorSwarmUpdater>()) {375 foreach (var op in Operators.OfType<IRealVectorSwarmUpdater>()) { 382 376 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 383 377 op.RealVectorParameter.Hidden = true; … … 385 379 op.MaximizationParameter.Hidden = true; 386 380 } 387 foreach ( IRealVectorMultiNeighborhoodShakingOperator op in Operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>()) {388 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 389 op.RealVectorParameter.Hidden = true; 390 } 391 foreach ( ISingleObjectiveImprovementOperator op in Operators.OfType<ISingleObjectiveImprovementOperator>()) {381 foreach (var op in Operators.OfType<IRealVectorMultiNeighborhoodShakingOperator>()) { 382 op.RealVectorParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 383 op.RealVectorParameter.Hidden = true; 384 } 385 foreach (var op in Operators.OfType<ISingleObjectiveImprovementOperator>()) { 392 386 op.SolutionParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 393 387 op.SolutionParameter.Hidden = true; 394 388 } 395 foreach ( ISingleObjectivePathRelinker op in Operators.OfType<ISingleObjectivePathRelinker>()) {389 foreach (var op in Operators.OfType<ISingleObjectivePathRelinker>()) { 396 390 op.ParentsParameter.ActualName = SolutionCreator.RealVectorParameter.ActualName; 397 391 op.ParentsParameter.Hidden = true; 398 392 } 399 foreach ( SingleObjectiveTestFunctionSimilarityCalculator op in Operators.OfType<SingleObjectiveTestFunctionSimilarityCalculator>()) {393 foreach (var op in Operators.OfType<SingleObjectiveTestFunctionSimilarityCalculator>()) { 400 394 op.SolutionVariableName = SolutionCreator.RealVectorParameter.ActualName; 401 395 op.QualityVariableName = Evaluator.QualityParameter.ActualName; … … 404 398 } 405 399 private void UpdateStrategyVectorBounds() { 406 DoubleMatrixstrategyBounds = (DoubleMatrix)Bounds.Clone();400 var strategyBounds = (DoubleMatrix)Bounds.Clone(); 407 401 for (int i = 0; i < strategyBounds.Rows; i++) { 408 402 if (strategyBounds[i, 0] < 0) strategyBounds[i, 0] = 0;
Note: See TracChangeset
for help on using the changeset viewer.