Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/09/11 12:42:41 (12 years ago)
Author:
mkofler
Message:

#852: PSO code refactoring. Cleanup and minor improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimizationMainLoop.cs

    r5592 r5643  
    7171      get { return (IValueLookupParameter<ResultCollection>)Parameters["Results"]; }
    7272    }
     73    public LookupParameter<IntValue> EvaluatedSolutionsParameter {
     74      get { return (LookupParameter<IntValue>)Parameters["EvaluatedSolutions"]; }
     75    }
    7376    public IValueLookupParameter<IOperator> EvaluatorParameter {
    7477      get { return (IValueLookupParameter<IOperator>)Parameters["Evaluator"]; }
     
    112115
    113116      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The variable collection where results should be stored."));
     117      Parameters.Add(new LookupParameter<IntValue>("EvaluatedSolutions", "The number of times solutions have been evaluated."));
    114118
    115119      Parameters.Add(new ValueLookupParameter<ISwarmUpdater>("SwarmUpdater", "The encoding-specific swarm updater."));
     
    126130      UniformSubScopesProcessor uniformSubscopesProcessor2 = new UniformSubScopesProcessor();
    127131      UniformSubScopesProcessor evaluationProcessor = new UniformSubScopesProcessor();
    128       NeighborUpdater neighborUpdater = new NeighborUpdater();
    129132      Placeholder swarmUpdater = new Placeholder();
    130133      IntCounter currentIterationCounter = new IntCounter();
     
    133136      Placeholder velocityBoundsUpdaterPlaceholder = new Placeholder();
    134137      Placeholder inertiaUpdaterPlaceholder = new Placeholder();
     138      SubScopesCounter subScopesCounter = new SubScopesCounter();
    135139      #endregion
    136140
     
    138142      OperatorGraph.InitialOperator = resultsCollector;
    139143      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Iterations", null, "CurrentIteration"));
    140       //resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Current Inertia", null, "Inertia"));
    141       //resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
     144      resultsCollector.CollectedValues.Add(new LookupParameter<DoubleValue>("Current Inertia", null, "CurrentInertia"));
     145      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>("Evaluated Solutions", null, "EvaluatedSolutions"));
    142146      resultsCollector.ResultsParameter.ActualName = "Results";
    143147      resultsCollector.Successor = swarmUpdaterPlaceholer1;
     
    159163      evaluationProcessor.Parallel = new BoolValue(true);
    160164      evaluationProcessor.Operator = evaluatorPlaceholder;
    161       evaluationProcessor.Successor = topologyUpdaterPlaceholder;
     165      evaluationProcessor.Successor = subScopesCounter;
    162166
    163167      evaluatorPlaceholder.Name = "(Evaluator)";
    164168      evaluatorPlaceholder.OperatorParameter.ActualName = EvaluatorParameter.Name;
     169
     170      subScopesCounter.Name = "Increment EvaluatedSolutions";
     171      subScopesCounter.ValueParameter.ActualName = EvaluatedSolutionsParameter.Name;
     172      subScopesCounter.Successor = topologyUpdaterPlaceholder;
    165173
    166174      topologyUpdaterPlaceholder.Name = "(TopologyUpdater)";
Note: See TracChangeset for help on using the changeset viewer.