Ignore:
Timestamp:
06/26/12 13:12:48 (9 years ago)
Author:
gkronber
Message:

#1797 added an interface IConstrainedValueParameter, added a test case to check the name, visibility and type of the parameter-property for constrainedValueParameters, corrected all properties in IParameterizedItems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs

    r7999 r8121  
    5858      get { return (FixedValueParameter<BoolValue>)Parameters["SetSeedRandomly"]; }
    5959    }
    60     public ConstrainedValueParameter<ILocalImprovementOperator> LocalImprovementParameter {
    61       get { return (ConstrainedValueParameter<ILocalImprovementOperator>)Parameters["LocalImprovement"]; }
    62     }
    63     public ConstrainedValueParameter<IMultiNeighborhoodShakingOperator> ShakingOperatorParameter {
    64       get { return (ConstrainedValueParameter<IMultiNeighborhoodShakingOperator>)Parameters["ShakingOperator"]; }
     60    public IConstrainedValueParameter<ILocalImprovementOperator> LocalImprovementParameter {
     61      get { return (IConstrainedValueParameter<ILocalImprovementOperator>)Parameters["LocalImprovement"]; }
     62    }
     63    public IConstrainedValueParameter<IMultiNeighborhoodShakingOperator> ShakingOperatorParameter {
     64      get { return (IConstrainedValueParameter<IMultiNeighborhoodShakingOperator>)Parameters["ShakingOperator"]; }
    6565    }
    6666    private FixedValueParameter<IntValue> MaximumIterationsParameter {
     
    294294        LocalImprovementParameter.ValidValues.Clear();
    295295      } else {
    296         LocalImprovementParameter.ValidValues.RemoveWhere(x => !x.ProblemType.IsAssignableFrom(Problem.GetType()));
     296        foreach (var entry in LocalImprovementParameter.ValidValues.ToList()) {
     297          if (!entry.ProblemType.IsAssignableFrom(Problem.GetType())) {
     298            LocalImprovementParameter.ValidValues.Remove(entry);
     299          }
     300        }
    297301        foreach (ILocalImprovementOperator op in ApplicationManager.Manager.GetInstances<ILocalImprovementOperator>().Where(x => x.ProblemType.IsAssignableFrom(Problem.GetType()))) {
    298302          if (!LocalImprovementParameter.ValidValues.Any(x => x.GetType() == op.GetType()))
Note: See TracChangeset for help on using the changeset viewer.