Free cookie consent management tool by TermsFeed Policy Generator

Changeset 46


Ignore:
Timestamp:
03/05/08 20:56:34 (16 years ago)
Author:
swagner
Message:

Closed ticket #46

  • renamed MultiHeuristicBranch to StochasticMultiBranch
  • added description and license information
Location:
trunk/sources/HeuristicLab.Operators
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators/HeuristicLab.Operators.csproj

    r44 r46  
    5858      <SubType>Code</SubType>
    5959    </Compile>
    60     <Compile Include="MultiHeuristicBranch.cs" />
     60    <Compile Include="StochasticMultiBranch.cs" />
    6161    <Compile Include="SubScopesMixer.cs" />
    6262    <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
     22using System;
    223using System.Collections.Generic;
    324using System.Text;
     
    627
    728namespace 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()
    1035      : base() {
    11 
    1236      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));
    1337      AddVariableInfo(new VariableInfo("Random", "The pseudo random-generator, used for any random-decision.", typeof(IRandom), VariableKind.In));
     
    1842      DoubleArrayData probabilities = GetVariableValue<DoubleArrayData>("Probabilities", scope, true);
    1943      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");
    2145      }
    2246      double sum = 0;
     
    3559      }
    3660      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");
    3862      }
    3963      return new AtomicOperation(successor, scope);
Note: See TracChangeset for help on using the changeset viewer.