Changeset 15504 for branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/StochasticNMoveSingleMoveGenerator.cs
- Timestamp:
- 12/10/17 22:11:10 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/StochasticNMoveSingleMoveGenerator.cs
r7505 r15504 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2017 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 [Item("Stochastic N-Move SingleMoveGenerator", "Randomly samples a single N-Move.")] 33 33 [StorableClass] 34 public class StochasticNMoveSingleMoveGenerator : GQAPNMoveGenerator, ICapacitiesAwareGQAPOperator, IStochasticOperator, ISingleMoveGenerator { 35 36 public ILookupParameter<DoubleArray> CapacitiesParameter { 37 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 38 } 34 public class StochasticNMoveSingleMoveGenerator : GQAPNMoveGenerator, IStochasticOperator, ISingleMoveGenerator { 35 39 36 public ILookupParameter<IRandom> RandomParameter { 40 37 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } … … 47 44 : base() { 48 45 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator that should be used.")); 49 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription));50 46 } 51 47 … … 73 69 } 74 70 75 public override IEnumerable<NMove> GenerateMoves(IntegerVector assignment, int n ) {76 yield return GenerateUpToN(RandomParameter.ActualValue, assignment, n, CapacitiesParameter.ActualValue);71 public override IEnumerable<NMove> GenerateMoves(IntegerVector assignment, int n, GQAPInstance problemInstance) { 72 yield return GenerateUpToN(RandomParameter.ActualValue, assignment, n, problemInstance.Capacities); 77 73 } 78 74 }
Note: See TracChangeset
for help on using the changeset viewer.