Changeset 5566 for trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimizationMainLoop.cs
- Timestamp:
- 02/28/11 15:08:14 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimizationMainLoop.cs
r5560 r5566 126 126 UniformSubScopesProcessor evaluationProcessor = new UniformSubScopesProcessor(); 127 127 NeighborUpdater neighborUpdater = new NeighborUpdater(); 128 ISwarmUpdater swarmUpdater = new RealVectorSwarmUpdater();128 Placeholder swarmUpdater = new Placeholder(); 129 129 IntCounter currentIterationCounter = new IntCounter(); 130 130 Comparator currentIterationComparator = new Comparator(); 131 131 ConditionalBranch conditionalBranch = new ConditionalBranch(); 132 132 Placeholder velocityBoundsUpdaterPlaceholder = new Placeholder(); 133 Placeholder omegaUpdaterPlaceholder = new Placeholder();133 Placeholder inertiaUpdaterPlaceholder = new Placeholder(); 134 134 #endregion 135 135 136 136 #region Create operator graph 137 //OperatorGraph.InitialOperator = analyzerPlaceholder;137 OperatorGraph.InitialOperator = analyzerPlaceholder; 138 138 139 //analyzerPlaceholder.Name = "(Analyzer)";140 //analyzerPlaceholder.OperatorParameter.ActualName = "Analyzer";141 //analyzerPlaceholder.Successor = uniformSubScopeProcessor;139 analyzerPlaceholder.Name = "(Analyzer)"; 140 analyzerPlaceholder.OperatorParameter.ActualName = AnalyzerParameter.Name; 141 analyzerPlaceholder.Successor = uniformSubScopeProcessor; 142 142 143 //uniformSubScopeProcessor.Operator = particleUpdaterPlaceholder;144 //uniformSubScopeProcessor.Successor = evaluationProcessor;143 uniformSubScopeProcessor.Operator = particleUpdaterPlaceholder; 144 uniformSubScopeProcessor.Successor = evaluationProcessor; 145 145 146 //particleUpdaterPlaceholder.Name = "(ParticleUpdater)";147 //particleUpdaterPlaceholder.OperatorParameter.ActualName = "ParticleUpdater";146 particleUpdaterPlaceholder.Name = "(ParticleUpdater)"; 147 particleUpdaterPlaceholder.OperatorParameter.ActualName = ParticleUpdaterParameter.Name; 148 148 149 //evaluationProcessor.Parallel = new BoolValue(true);150 //evaluationProcessor.Operator = evaluatorPlaceholder;151 //evaluationProcessor.Successor = topologyUpdaterPlaceholder;149 evaluationProcessor.Parallel = new BoolValue(true); 150 evaluationProcessor.Operator = evaluatorPlaceholder; 151 evaluationProcessor.Successor = topologyUpdaterPlaceholder; 152 152 153 //evaluatorPlaceholder.Name = "(Evaluator)";154 //evaluatorPlaceholder.OperatorParameter.ActualName = "Evaluator";153 evaluatorPlaceholder.Name = "(Evaluator)"; 154 evaluatorPlaceholder.OperatorParameter.ActualName = EvaluatorParameter.Name; 155 155 156 //topologyUpdaterPlaceholder.Name = "(TopologyUpdater)";157 //topologyUpdaterPlaceholder.OperatorParameter.ActualName = "TopologyUpdater";158 //topologyUpdaterPlaceholder.Successor = neighborUpdater;156 topologyUpdaterPlaceholder.Name = "(TopologyUpdater)"; 157 topologyUpdaterPlaceholder.OperatorParameter.ActualName = TopologyUpdaterParameter.Name; 158 topologyUpdaterPlaceholder.Successor = swarmUpdater; 159 159 160 //neighborUpdater.Successor = uniformSubscopesProcessor2; 160 swarmUpdater.Name = "Swarm Updater"; 161 swarmUpdater.OperatorParameter.ActualName = "SwarmUpdater"; 162 swarmUpdater.Successor = currentIterationCounter; 161 163 162 //uniformSubscopesProcessor2.Operator = swarmUpdater; 163 //uniformSubscopesProcessor2.Successor = analyzerPlaceholder; 164 currentIterationCounter.Name = "CurrentIteration++"; 165 currentIterationCounter.ValueParameter.ActualName = "CurrentIteration"; 166 currentIterationCounter.Successor = inertiaUpdaterPlaceholder; 164 167 165 //analyzerPlaceholder.Name = "(Analyzer)";166 //analyzerPlaceholder.OperatorParameter.ActualName = "Analyzer";167 //analyzerPlaceholder.Successor = currentIterationCounter;168 inertiaUpdaterPlaceholder.Name = "(Inertia Updater)"; 169 inertiaUpdaterPlaceholder.OperatorParameter.ActualName = InertiaUpdaterParameter.ActualName; 170 inertiaUpdaterPlaceholder.Successor = currentIterationComparator; 168 171 169 //currentIterationCounter.Name = "CurrentIteration++"; 170 //currentIterationCounter.ValueParameter.ActualName = "CurrentIteration"; 171 //currentIterationCounter.Successor = omegaUpdaterPlaceholder; 172 currentIterationComparator.LeftSideParameter.ActualName = "CurrentIteration"; 173 currentIterationComparator.Comparison = new Comparison(ComparisonType.Less); 174 currentIterationComparator.RightSideParameter.ActualName = "MaxIterations"; 175 currentIterationComparator.ResultParameter.ActualName = "ContinueIteration"; 176 currentIterationComparator.Successor = conditionalBranch; 172 177 173 //omegaUpdaterPlaceholder.Name = "(Inertia Updater)"; 174 //omegaUpdaterPlaceholder.OperatorParameter.ActualName = "InertiaUpdater"; 175 //omegaUpdaterPlaceholder.Successor = velocityBoundsUpdaterPlaceholder; 176 177 //velocityBoundsUpdaterPlaceholder.Name = "(Velocity Bounds Updater)"; 178 //velocityBoundsUpdaterPlaceholder.OperatorParameter.ActualName = "VelocityBoundsUpdater"; 179 //velocityBoundsUpdaterPlaceholder.Successor = currentIterationComparator; 180 181 //currentIterationComparator.LeftSideParameter.ActualName = "CurrentIteration"; 182 //currentIterationComparator.Comparison = new Comparison(ComparisonType.Less); 183 //currentIterationComparator.RightSideParameter.ActualName = "MaxIterations"; 184 //currentIterationComparator.ResultParameter.ActualName = "ContinueIteration"; 185 //currentIterationComparator.Successor = conditionalBranch; 186 187 //conditionalBranch.Name = "ContinueIteration?"; 188 //conditionalBranch.ConditionParameter.ActualName = "ContinueIteration"; 189 //conditionalBranch.TrueBranch = uniformSubScopeProcessor; 178 conditionalBranch.Name = "ContinueIteration?"; 179 conditionalBranch.ConditionParameter.ActualName = "ContinueIteration"; 180 conditionalBranch.TrueBranch = uniformSubScopeProcessor; 190 181 #endregion 191 182 }
Note: See TracChangeset
for help on using the changeset viewer.