Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/21/11 10:27:03 (13 years ago)
Author:
svonolfe
Message:

Added possibility to allow infeasible solutions (#1561)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Potvin/Manipulators/PotvinManipulator.cs

    r6449 r6459  
    3535    }
    3636
     37    public IValueParameter<BoolValue> AllowInfeasibleSolutions {
     38      get { return (IValueParameter<BoolValue>)Parameters["AllowInfeasibleSolutions"]; }
     39    }
     40
     41    [StorableHook(HookType.AfterDeserialization)]
     42    private void AfterDeserialization() {
     43      // BackwardsCompatibility3.3
     44      #region Backwards compatible code (remove with 3.4)
     45      if (!Parameters.ContainsKey("AllowInfeasibleSolutions")) {
     46        Parameters.Add(new ValueParameter<BoolValue>("AllowInfeasibleSolutions", "Indicates if infeasible solutions should be allowed.", new BoolValue(false)));
     47      }
     48      #endregion
     49    }
     50
    3751    [StorableConstructor]
    3852    protected PotvinManipulator(bool deserializing) : base(deserializing) { }
     
    4256    public PotvinManipulator() {
    4357      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators."));
     58      Parameters.Add(new ValueParameter<BoolValue>("AllowInfeasibleSolutions", "Indicates if infeasible solutions should be allowed.", new BoolValue(false)));
    4459    }
    4560
     
    7590    protected static bool FindInsertionPlace(PotvinEncoding individual, int city, int routeToAvoid,
    7691      DoubleArray dueTime, DoubleArray serviceTime, DoubleArray readyTime, DoubleArray demand,
    77       DoubleValue capacity, DistanceMatrix distMatrix,
     92      DoubleValue capacity, DistanceMatrix distMatrix,  bool allowInfeasible,
    7893      out int route, out int place) {
    7994      return individual.FindInsertionPlace(
    8095        dueTime, serviceTime, readyTime,
    8196        demand, capacity, distMatrix,
    82         city, routeToAvoid, out route, out place);
     97        city, routeToAvoid, allowInfeasible,
     98        out route, out place);
    8399    }
    84100     
Note: See TracChangeset for help on using the changeset viewer.