Changeset 6053 for trunk/sources
- Timestamp:
- 04/26/11 15:39:28 (14 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearch.cs
r6042 r6053 349 349 } 350 350 private void ParameterizeMainLoop() { 351 MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 352 MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 353 MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 351 if (Problem != null) { 352 MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 353 MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 354 MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 355 } 354 356 if (MoveEvaluator != null) 355 357 MainLoop.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName; 356 358 } 357 359 private void ParameterizeStochasticOperator(IOperator op) { 358 if (op is IStochasticOperator) 359 ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 360 if (op is IStochasticOperator) { 361 IStochasticOperator stOp = (IStochasticOperator)op; 362 stOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 363 stOp.RandomParameter.Hidden = true; 364 } 360 365 } 361 366 private void ParameterizeMoveGenerators() { 362 367 if (Problem != null) { 363 foreach (IMultiMoveGenerator generator in Problem.Operators.OfType<IMultiMoveGenerator>()) 368 foreach (IMultiMoveGenerator generator in Problem.Operators.OfType<IMultiMoveGenerator>()) { 364 369 generator.SampleSizeParameter.ActualName = SampleSizeParameter.Name; 370 generator.SampleSizeParameter.Hidden = true; 371 } 365 372 } 366 373 } … … 368 375 foreach (ISingleObjectiveMoveEvaluator op in Problem.Operators.OfType<ISingleObjectiveMoveEvaluator>()) { 369 376 op.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 377 op.QualityParameter.Hidden = true; 370 378 } 371 379 } … … 373 381 foreach (IMoveMaker op in Problem.Operators.OfType<IMoveMaker>()) { 374 382 op.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 375 if (MoveEvaluator != null) 383 op.QualityParameter.Hidden = true; 384 if (MoveEvaluator != null) { 376 385 op.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName; 386 op.MoveQualityParameter.Hidden = true; 387 } else { 388 op.MoveQualityParameter.Hidden = false; 389 } 377 390 } 378 391 } 379 392 private void ParameterizeAnalyzers() { 380 393 moveQualityAnalyzer.ResultsParameter.ActualName = "Results"; 394 moveQualityAnalyzer.ResultsParameter.Hidden = true; 381 395 if (Problem != null) { 382 396 moveQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 383 if (MoveEvaluator != null) 397 moveQualityAnalyzer.MaximizationParameter.Hidden = true; 398 if (MoveEvaluator != null) { 384 399 moveQualityAnalyzer.QualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName; 400 moveQualityAnalyzer.QualityParameter.Hidden = true; 401 } else moveQualityAnalyzer.QualityParameter.Hidden = false; 385 402 moveQualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 403 moveQualityAnalyzer.BestKnownQualityParameter.Hidden = true; 404 } else { 405 moveQualityAnalyzer.MaximizationParameter.Hidden = false; 406 moveQualityAnalyzer.BestKnownQualityParameter.Hidden = false; 386 407 } 387 408 } … … 390 411 foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) { 391 412 op.IterationsParameter.ActualName = "Iterations"; 413 op.IterationsParameter.Hidden = true; 392 414 op.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 415 op.MaximumIterationsParameter.Hidden = true; 393 416 } 394 417 } -
trunk/sources/HeuristicLab.Algorithms.SimulatedAnnealing/3.3/SimulatedAnnealing.cs
r5809 r6053 330 330 if (Problem != null) { 331 331 qualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 332 qualityAnalyzer.MaximizationParameter.Hidden = true; 332 333 qualityAnalyzer.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 333 334 qualityAnalyzer.QualityParameter.Depth = 0; 335 qualityAnalyzer.QualityParameter.Hidden = true; 334 336 qualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 337 qualityAnalyzer.BestKnownQualityParameter.Hidden = true; 338 } else { 339 qualityAnalyzer.MaximizationParameter.Hidden = false; 340 qualityAnalyzer.QualityParameter.Hidden = false; 341 qualityAnalyzer.BestKnownQualityParameter.Hidden = false; 335 342 } 336 343 } … … 371 378 } 372 379 private void ParameterizeMainLoop() { 373 MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 374 MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 375 MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 380 if (Problem != null) { 381 MainLoop.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 382 MainLoop.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 383 MainLoop.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 384 } 376 385 if (MoveEvaluator != null) 377 386 MainLoop.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName; 378 387 } 379 388 private void ParameterizeStochasticOperator(IOperator op) { 380 if (op is IStochasticOperator) 381 ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 389 if (op is IStochasticOperator) { 390 IStochasticOperator stOp = (IStochasticOperator)op; 391 stOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 392 stOp.RandomParameter.Hidden = true; 393 } 382 394 } 383 395 private void ParameterizeMoveEvaluators() { 384 396 foreach (ISingleObjectiveMoveEvaluator op in Problem.Operators.OfType<ISingleObjectiveMoveEvaluator>()) { 385 397 op.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 398 op.QualityParameter.Hidden = true; 386 399 } 387 400 } … … 389 402 foreach (IMoveMaker op in Problem.Operators.OfType<IMoveMaker>()) { 390 403 op.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 391 if (MoveEvaluator != null) 404 op.QualityParameter.Hidden = true; 405 if (MoveEvaluator != null) { 392 406 op.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName; 407 op.MoveQualityParameter.Hidden = true; 408 } else { 409 op.MoveQualityParameter.Hidden = false; 410 } 393 411 } 394 412 } … … 396 414 foreach (IDiscreteDoubleValueModifier op in AnnealingOperatorParameter.ValidValues) { 397 415 op.IndexParameter.ActualName = "Iterations"; 416 op.IndexParameter.Hidden = true; 398 417 op.StartIndexParameter.Value = new IntValue(0); 399 418 op.EndIndexParameter.ActualName = MaximumIterationsParameter.Name; 400 419 op.ValueParameter.ActualName = "Temperature"; 420 op.ValueParameter.Hidden = true; 401 421 op.StartValueParameter.ActualName = StartTemperatureParameter.Name; 422 op.StartValueParameter.Hidden = true; 402 423 op.EndValueParameter.ActualName = EndTemperatureParameter.Name; 424 op.EndValueParameter.Hidden = true; 403 425 ParameterizeStochasticOperator(op); 404 426 } … … 407 429 foreach (IMultiMoveGenerator op in Problem.Operators.OfType<IMultiMoveGenerator>()) { 408 430 op.SampleSizeParameter.ActualName = InnerIterationsParameter.Name; 431 op.SampleSizeParameter.Hidden = true; 409 432 } 410 433 } … … 413 436 foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) { 414 437 op.IterationsParameter.ActualName = "Iterations"; 438 op.IterationsParameter.Hidden = true; 415 439 op.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 440 op.MaximumIterationsParameter.Hidden = true; 416 441 } 417 442 } -
trunk/sources/HeuristicLab.Algorithms.TabuSearch/3.3/TabuSearch.cs
r5809 r6053 429 429 } 430 430 private void ParameterizeStochasticOperator(IOperator op) { 431 if (op is IStochasticOperator) 432 ((IStochasticOperator)op).RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 431 if (op is IStochasticOperator) { 432 IStochasticOperator stOp = (IStochasticOperator)op; 433 stOp.RandomParameter.ActualName = RandomCreator.RandomParameter.ActualName; 434 stOp.RandomParameter.Hidden = true; 435 } 433 436 } 434 437 private void ParameterizeMoveGenerators() { 435 438 if (Problem != null) { 436 foreach (IMultiMoveGenerator generator in Problem.Operators.OfType<IMultiMoveGenerator>()) 439 foreach (IMultiMoveGenerator generator in Problem.Operators.OfType<IMultiMoveGenerator>()) { 437 440 generator.SampleSizeParameter.ActualName = SampleSizeParameter.Name; 441 generator.SampleSizeParameter.Hidden = true; 442 } 438 443 } 439 444 } … … 441 446 foreach (ISingleObjectiveMoveEvaluator op in Problem.Operators.OfType<ISingleObjectiveMoveEvaluator>()) { 442 447 op.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 448 op.QualityParameter.Hidden = true; 443 449 } 444 450 } … … 446 452 foreach (IMoveMaker op in Problem.Operators.OfType<IMoveMaker>()) { 447 453 op.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 448 if (MoveEvaluator != null) 454 op.QualityParameter.Hidden = true; 455 if (MoveEvaluator != null) { 449 456 op.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName; 457 op.MoveQualityParameter.Hidden = true; 458 } else { 459 op.MoveQualityParameter.Hidden = false; 460 } 450 461 } 451 462 } … … 453 464 foreach (ITabuMaker op in Problem.Operators.OfType<ITabuMaker>()) { 454 465 op.QualityParameter.ActualName = Problem.Evaluator.QualityParameter.ActualName; 455 if (MoveEvaluator != null) 466 op.QualityParameter.Hidden = true; 467 if (MoveEvaluator != null) { 456 468 op.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName; 469 op.MoveQualityParameter.Hidden = true; 470 } else { 471 op.MoveQualityParameter.Hidden = false; 472 } 457 473 } 458 474 } 459 475 private void ParameterizeTabuChecker() { 460 476 foreach (ITabuChecker op in Problem.Operators.OfType<ITabuChecker>()) { 461 if (MoveEvaluator != null) 477 if (MoveEvaluator != null) { 462 478 op.MoveQualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName; 463 if (TabuChecker != null) 479 op.MoveQualityParameter.Hidden = true; 480 } else { 481 op.MoveQualityParameter.Hidden = false; 482 } 483 if (TabuChecker != null) { 464 484 op.MoveTabuParameter.ActualName = TabuChecker.MoveTabuParameter.ActualName; 485 op.MoveTabuParameter.Hidden = true; 486 } else { 487 op.MoveTabuParameter.Hidden = false; 488 } 465 489 } 466 490 } 467 491 private void ParameterizeAnalyzers() { 468 492 moveQualityAnalyzer.ResultsParameter.ActualName = "Results"; 493 moveQualityAnalyzer.ResultsParameter.Hidden = true; 469 494 tabuNeighborhoodAnalyzer.ResultsParameter.ActualName = "Results"; 495 tabuNeighborhoodAnalyzer.ResultsParameter.Hidden = true; 470 496 tabuNeighborhoodAnalyzer.PercentTabuParameter.ActualName = "PercentTabu"; 497 tabuNeighborhoodAnalyzer.PercentTabuParameter.Hidden = true; 471 498 if (Problem != null) { 472 499 moveQualityAnalyzer.MaximizationParameter.ActualName = Problem.MaximizationParameter.Name; 473 if (MoveEvaluator != null) 500 moveQualityAnalyzer.MaximizationParameter.Hidden = true; 501 if (MoveEvaluator != null) { 474 502 moveQualityAnalyzer.QualityParameter.ActualName = MoveEvaluator.MoveQualityParameter.ActualName; 503 moveQualityAnalyzer.QualityParameter.Hidden = true; 504 } else { 505 moveQualityAnalyzer.QualityParameter.Hidden = false; 506 } 475 507 moveQualityAnalyzer.BestKnownQualityParameter.ActualName = Problem.BestKnownQualityParameter.Name; 476 if (TabuChecker != null) 508 moveQualityAnalyzer.BestKnownQualityParameter.Hidden = true; 509 if (TabuChecker != null) { 477 510 tabuNeighborhoodAnalyzer.IsTabuParameter.ActualName = TabuChecker.MoveTabuParameter.ActualName; 511 tabuNeighborhoodAnalyzer.IsTabuParameter.Hidden = true; 512 } else { 513 tabuNeighborhoodAnalyzer.IsTabuParameter.Hidden = false; 514 } 515 } else { 516 moveQualityAnalyzer.MaximizationParameter.Hidden = false; 517 moveQualityAnalyzer.QualityParameter.Hidden = false; 518 moveQualityAnalyzer.BestKnownQualityParameter.Hidden = false; 519 tabuNeighborhoodAnalyzer.IsTabuParameter.Hidden = false; 478 520 } 479 521 } … … 482 524 foreach (IIterationBasedOperator op in Problem.Operators.OfType<IIterationBasedOperator>()) { 483 525 op.IterationsParameter.ActualName = "Iterations"; 526 op.IterationsParameter.Hidden = true; 484 527 op.MaximumIterationsParameter.ActualName = MaximumIterationsParameter.Name; 528 op.MaximumIterationsParameter.Hidden = true; 485 529 } 486 530 } -
trunk/sources/HeuristicLab.Problems.Knapsack/3.3/KnapsackProblem.cs
r6042 r6053 287 287 (KnapsackEvaluator)Evaluator; 288 288 knapsackEvaluator.BinaryVectorParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName; 289 knapsackEvaluator.BinaryVectorParameter.Hidden = true; 289 290 knapsackEvaluator.KnapsackCapacityParameter.ActualName = KnapsackCapacityParameter.Name; 291 knapsackEvaluator.KnapsackCapacityParameter.Hidden = true; 290 292 knapsackEvaluator.WeightsParameter.ActualName = WeightsParameter.Name; 293 knapsackEvaluator.WeightsParameter.Hidden = true; 291 294 knapsackEvaluator.ValuesParameter.ActualName = ValuesParameter.Name; 295 knapsackEvaluator.ValuesParameter.Hidden = true; 292 296 knapsackEvaluator.PenaltyParameter.ActualName = PenaltyParameter.Name; 297 knapsackEvaluator.PenaltyParameter.Hidden = true; 293 298 } 294 299 } 295 300 private void ParameterizeAnalyzer() { 296 301 BestKnapsackSolutionAnalyzer.MaximizationParameter.ActualName = MaximizationParameter.Name; 302 BestKnapsackSolutionAnalyzer.MaximizationParameter.Hidden = true; 297 303 BestKnapsackSolutionAnalyzer.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name; 304 BestKnapsackSolutionAnalyzer.BestKnownQualityParameter.Hidden = true; 298 305 BestKnapsackSolutionAnalyzer.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name; 306 BestKnapsackSolutionAnalyzer.BestKnownSolutionParameter.Hidden = true; 299 307 BestKnapsackSolutionAnalyzer.BinaryVectorParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName; 308 BestKnapsackSolutionAnalyzer.BinaryVectorParameter.Hidden = true; 300 309 BestKnapsackSolutionAnalyzer.KnapsackCapacityParameter.ActualName = KnapsackCapacityParameter.Name; 310 BestKnapsackSolutionAnalyzer.KnapsackCapacityParameter.Hidden = true; 301 311 BestKnapsackSolutionAnalyzer.WeightsParameter.ActualName = WeightsParameter.Name; 312 BestKnapsackSolutionAnalyzer.WeightsParameter.Hidden = true; 302 313 BestKnapsackSolutionAnalyzer.ValuesParameter.ActualName = ValuesParameter.Name; 303 BestKnapsackSolutionAnalyzer. ResultsParameter.ActualName = "Results";314 BestKnapsackSolutionAnalyzer.ValuesParameter.Hidden = true; 304 315 } 305 316 private void InitializeOperators() { … … 325 336 foreach (IBinaryVectorCrossover op in Operators.OfType<IBinaryVectorCrossover>()) { 326 337 op.ParentsParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName; 338 op.ParentsParameter.Hidden = true; 327 339 op.ChildParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName; 340 op.ChildParameter.Hidden = true; 328 341 } 329 342 foreach (IBinaryVectorManipulator op in Operators.OfType<IBinaryVectorManipulator>()) { 330 343 op.BinaryVectorParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName; 344 op.BinaryVectorParameter.Hidden = true; 331 345 } 332 346 foreach (IBinaryVectorMoveOperator op in Operators.OfType<IBinaryVectorMoveOperator>()) { 333 347 op.BinaryVectorParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName; 348 op.BinaryVectorParameter.Hidden = true; 334 349 } 335 350 foreach (IKnapsackMoveEvaluator op in Operators.OfType<IKnapsackMoveEvaluator>()) { 336 351 op.KnapsackCapacityParameter.ActualName = KnapsackCapacityParameter.Name; 352 op.KnapsackCapacityParameter.Hidden = true; 337 353 op.PenaltyParameter.ActualName = PenaltyParameter.Name; 354 op.PenaltyParameter.Hidden = true; 338 355 op.WeightsParameter.ActualName = WeightsParameter.Name; 356 op.WeightsParameter.Hidden = true; 339 357 op.ValuesParameter.ActualName = ValuesParameter.Name; 340 } 341 foreach (var op in Operators.OfType<IBinaryVectorMultiNeighborhoodShakingOperator>()) 358 op.ValuesParameter.Hidden = true; 359 } 360 foreach (var op in Operators.OfType<IBinaryVectorMultiNeighborhoodShakingOperator>()) { 342 361 op.BinaryVectorParameter.ActualName = SolutionCreator.BinaryVectorParameter.ActualName; 362 op.BinaryVectorParameter.Hidden = true; 363 } 343 364 } 344 365 #endregion
Note: See TracChangeset
for help on using the changeset viewer.