- Timestamp:
- 03/05/08 20:56:34 (17 years ago)
- Location:
- trunk/sources/HeuristicLab.Operators
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Operators/HeuristicLab.Operators.csproj
r44 r46 58 58 <SubType>Code</SubType> 59 59 </Compile> 60 <Compile Include=" MultiHeuristicBranch.cs" />60 <Compile Include="StochasticMultiBranch.cs" /> 61 61 <Compile Include="SubScopesMixer.cs" /> 62 62 <Compile Include="DataCollector.cs" /> -
trunk/sources/HeuristicLab.Operators/StochasticMultiBranch.cs
r45 r46 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Text; … … 6 27 7 28 namespace HeuristicLab.Operators { 8 public class MultiHeuristicBranch: OperatorBase { 9 public MultiHeuristicBranch() 29 public class StochasticMultiBranch : OperatorBase { 30 public override string Description { 31 get { return @"TODO\r\nOperator description still missing ..."; } 32 } 33 34 public StochasticMultiBranch() 10 35 : base() { 11 12 36 AddVariableInfo(new VariableInfo("Probabilities", "The probabilities, that define how likely each suboperator/graph is executed. This array must sum to 1", typeof(DoubleArrayData), VariableKind.In)); 13 37 AddVariableInfo(new VariableInfo("Random", "The pseudo random-generator, used for any random-decision.", typeof(IRandom), VariableKind.In)); … … 18 42 DoubleArrayData probabilities = GetVariableValue<DoubleArrayData>("Probabilities", scope, true); 19 43 if(probabilities.Data.Length != SubOperators.Count) { 20 throw new InvalidOperationException(" MultiHeuristicBranch: The list of probabilities has to match the number of operators");44 throw new InvalidOperationException("StochasticMultiBranch: The list of probabilities has to match the number of operators"); 21 45 } 22 46 double sum = 0; … … 35 59 } 36 60 if(successor == null) { 37 throw new InvalidOperationException(" MultiHeuristicBranch: There was a problem with the list of probabilities");61 throw new InvalidOperationException("StochasticMultiBranch: There was a problem with the list of probabilities"); 38 62 } 39 63 return new AtomicOperation(successor, scope);
Note: See TracChangeset
for help on using the changeset viewer.