Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/24/12 17:23:21 (12 years ago)
Author:
abeham
Message:

#1614: worked on GQAP

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Operators/RandomSolutionCreator.cs

    r7373 r7407  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Encodings.IntegerVectorEncoding;
    26 using HeuristicLab.Optimization;
    27 using HeuristicLab.Parameters;
    2826using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2927
     
    3129  [Item("RandomSolutionCreator", "Creates a completely random solution to the Generalized Quadratic Assignment Problem.")]
    3230  [StorableClass]
    33   public class RandomSolutionCreator : GQAPSolutionCreator, IStochasticOperator {
    34 
    35     public ILookupParameter<IRandom> RandomParameter {
    36       get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
    37     }
     31  public class RandomSolutionCreator : GQAPStochasticSolutionCreator {
    3832
    3933    [StorableConstructor]
    4034    protected RandomSolutionCreator(bool deserializing) : base(deserializing) { }
    41     protected RandomSolutionCreator(RandomSolutionCreator original, Cloner cloner)
    42       : base(original, cloner) { }
    43     public RandomSolutionCreator()
    44       : base() {
    45       Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
    46     }
     35    protected RandomSolutionCreator(RandomSolutionCreator original, Cloner cloner) : base(original, cloner) { }
     36    public RandomSolutionCreator() : base() { }
    4737
    4838    public override IDeepCloneable Clone(Cloner cloner) {
     
    5040    }
    5141
    52     protected override IntegerVector CreateSolution(DoubleArray demands, DoubleArray capacities) {
    53       return UniformRandomIntegerVectorCreator.Apply(RandomParameter.ActualValue, demands.Length, 0, capacities.Length);
     42    protected override IntegerVector CreateRandomSolution(IRandom random, DoubleArray demands, DoubleArray capacities) {
     43      return UniformRandomIntegerVectorCreator.Apply(random, demands.Length, 0, capacities.Length);
    5444    }
    5545  }
Note: See TracChangeset for help on using the changeset viewer.