Changeset 15504 for branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/SolutionCreators/GQAPSolutionCreator.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/SolutionCreators/GQAPSolutionCreator.cs
r7523 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. … … 31 31 [Item("GQAPSolutionCreator", "Base class for solution creators of the Generalized Quadratic Assignment Problem.")] 32 32 [StorableClass] 33 public abstract class GQAPSolutionCreator : SingleSuccessorOperator, I DemandsAwareGQAPOperator, ICapacitiesAwareGQAPOperator, IGQAPSolutionCreator {33 public abstract class GQAPSolutionCreator : SingleSuccessorOperator, IProblemInstanceAwareGQAPOperator, IGQAPSolutionCreator { 34 34 35 35 #region Parameter Descriptions … … 37 37 #endregion 38 38 39 public ILookupParameter<IntegerVector> AssignmentParameter {40 get { return (ILookupParameter<IntegerVector>)Parameters[" Assignment"]; }39 public ILookupParameter<IntegerVector> IntegerVectorParameter { 40 get { return (ILookupParameter<IntegerVector>)Parameters["IntegerVector"]; } 41 41 } 42 public ILookupParameter< DoubleArray> DemandsParameter {43 get { return (ILookupParameter< DoubleArray>)Parameters["Demands"]; }42 public ILookupParameter<GQAPInstance> ProblemInstanceParameter { 43 get { return (ILookupParameter<GQAPInstance>)Parameters["ProblemInstance"]; } 44 44 } 45 public ILookupParameter<DoubleArray> CapacitiesParameter { 46 get { return (ILookupParameter<DoubleArray>)Parameters["Capacities"]; } 45 public IValueLookupParameter<IntValue> LengthParameter { 46 get { return (IValueLookupParameter<IntValue>)Parameters["Length"]; } 47 } 48 public IValueLookupParameter<IntMatrix> BoundsParameter { 49 get { return (IValueLookupParameter<IntMatrix>)Parameters["Bounds"]; } 47 50 } 48 51 … … 53 56 public GQAPSolutionCreator() 54 57 : base() { 55 Parameters.Add(new LookupParameter<IntegerVector>("Assignment", AssignmentDescription)); 56 Parameters.Add(new LookupParameter<DoubleArray>("Demands", GeneralizedQuadraticAssignmentProblem.DemandsDescription)); 57 Parameters.Add(new LookupParameter<DoubleArray>("Capacities", GeneralizedQuadraticAssignmentProblem.CapacitiesDescription)); 58 Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", AssignmentDescription)); 59 Parameters.Add(new LookupParameter<GQAPInstance>("ProblemInstance", GQAP.ProblemInstanceDescription)); 60 Parameters.Add(new ValueLookupParameter<IntValue>("Length", "The length of the vector.") { Hidden = true }); 61 Parameters.Add(new ValueLookupParameter<IntMatrix>("Bounds", "") { Hidden = true }); 58 62 } 59 63 60 64 public override IOperation Apply() { 61 AssignmentParameter.ActualValue = CreateSolution(DemandsParameter.ActualValue, CapacitiesParameter.ActualValue);65 IntegerVectorParameter.ActualValue = CreateSolution(ProblemInstanceParameter.ActualValue); 62 66 return base.Apply(); 63 67 } 64 68 65 protected abstract IntegerVector CreateSolution( DoubleArray demands, DoubleArray capacities);69 protected abstract IntegerVector CreateSolution(GQAPInstance problemInstance); 66 70 } 67 71 }
Note: See TracChangeset
for help on using the changeset viewer.