Changeset 3415 for trunk/sources
- Timestamp:
- 04/19/10 20:49:12 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/HeuristicLab.Algorithms.ParticleSwarmOptimization-3.3.csproj
r3384 r3415 86 86 <Compile Include="PermutationToRealVectorEncoder.cs" /> 87 87 <Compile Include="Properties\AssemblyInfo.cs" /> 88 <Compile Include="RealVectorToRealVectorEncoder.cs" /> 88 89 </ItemGroup> 89 90 <ItemGroup> -
trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimization.cs
r3376 r3415 48 48 set { base.Problem = value; } 49 49 } 50 public IRealVectorEncoder Encoder { 51 get { return EncoderParameter.Value; } 52 set { EncoderParameter.Value = value; } 53 } 50 54 #endregion 51 55 … … 84 88 Parameters.Add(new OptionalConstrainedValueParameter<IRealVectorEncoder>("Encoder", "The operator used to encode solutions as position vector.")); 85 89 //Parameters.Add(new ConstrainedValueParameter<IManipulator>("Mutator", "The operator used to mutate solutions.")); 86 87 90 RandomCreator randomCreator = new RandomCreator(); 88 91 SolutionsCreator solutionsCreator = new SolutionsCreator(); 92 UniformSubScopesProcessor uniformSubScopesProcessor = new UniformSubScopesProcessor(); 93 VariableCreator variableCreator = new VariableCreator(); 94 variableCreator.CollectedValues.Add(new ValueParameter<RealVector>("Velocity", new RealVector())); 89 95 //solutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreator.Name; 90 mainLoop = new ParticleSwarmOptimizationMainLoop();96 //mainLoop = new ParticleSwarmOptimizationMainLoop(); 91 97 OperatorGraph.InitialOperator = randomCreator; 92 98 … … 99 105 100 106 solutionsCreator.NumberOfSolutionsParameter.ActualName = SwarmSizeParameter.Name; 101 solutionsCreator.Successor = mainLoop; 107 solutionsCreator.Successor = variableCreator; 108 variableCreator.Successor = uniformSubScopesProcessor; 109 102 110 103 mainLoop.EncoderParameter.ActualName = EncoderParameter.Name; 111 //evaluator.Successor = mainLoop; 112 //mainLoop.EncoderParameter.ActualName = EncoderParameter.Name; 104 113 105 114 Initialize(); 106 115 } 107 116 117 [StorableHook(HookType.AfterDeserialization)] 108 118 private void Initialize() { 109 119 EncoderParameter.ValueChanged += new EventHandler(EncoderParameter_ValueChanged); 110 120 } 111 121 … … 136 146 base.OnProblemChanged(); 137 147 } 148 149 private void EncoderParameter_ValueChanged(object sender, EventArgs e) { 150 ((UniformSubScopesProcessor)((SolutionsCreator)((RandomCreator)OperatorGraph.InitialOperator).Successor).Successor).Operator = EncoderParameter.Value; 151 } 138 152 #endregion 139 153 … … 152 166 } 153 167 } 168 154 169 #endregion 155 170 } -
trunk/sources/HeuristicLab.Algorithms.ParticleSwarmOptimization/3.3/ParticleSwarmOptimizationMainLoop.cs
r3376 r3415 24 24 get { return (ValueLookupParameter<IOperator>)Parameters["Encoder"]; } 25 25 } 26 public ValueLookupParameter<IOperator> EvaluatorParameter {27 get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; }28 }26 //public ValueLookupParameter<IOperator> EvaluatorParameter { 27 // get { return (ValueLookupParameter<IOperator>)Parameters["Evaluator"]; } 28 //} 29 29 #endregion 30 30 … … 40 40 Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored.")); 41 41 Parameters.Add(new ValueLookupParameter<IOperator>("Encoder", "The encoding operator that maps a solution to a position vector.")); 42 Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions."));42 //Parameters.Add(new ValueLookupParameter<IOperator>("Evaluator", "The operator used to evaluate solutions.")); 43 43 #endregion 44 44 … … 53 53 encoder.OperatorParameter.ActualName = EncoderParameter.Name; 54 54 55 evaluator.Name = "Evaluator (placeholder)";56 evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name;55 //evaluator.Name = "Evaluator (placeholder)"; 56 //evaluator.OperatorParameter.ActualName = EvaluatorParameter.Name; 57 57 #endregion 58 58 … … 61 61 variableCreator.Successor = uniformSubScopesProcessor; 62 62 uniformSubScopesProcessor.Operator = encoder; 63 uniformSubScopesProcessor.Successor = evaluator;63 //uniformSubScopesProcessor.Successor = evaluator; 64 64 #endregion 65 65 }
Note: See TracChangeset
for help on using the changeset viewer.