Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/11/12 22:57:09 (11 years ago)
Author:
abeham
Message:

#1329:

  • Moved decoders and evaluators from encoding to problem
  • Removed unnecessary state variables in operators
  • Introduced parameters in interfaces and added wiring code
  • Removed ConcreteScheduleManipulator as it does not perform any manipulation
  • Made ErrorPolicy and ForcingStrategy configurable and added views for them
  • Renamed the SchedulingEvaluationAlgorithm and also converted the AlgorithmOperator to a SingleSuccessorOperator
  • Fixed Plugin- and AssemblyFileVersion
  • Added missing license headers
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Crossovers/DirectScheduleGTCrossover.cs

    r8603 r8887  
    3030  [StorableClass]
    3131  public class DirectScheduleGTCrossover : DirectScheduleCrossover {
     32
     33    public IValueLookupParameter<DoubleValue> MutationProbabilityParameter {
     34      get { return (IValueLookupParameter<DoubleValue>)Parameters["MutationProbability"]; }
     35    }
     36
    3237    [StorableConstructor]
    3338    protected DirectScheduleGTCrossover(bool deserializing) : base(deserializing) { }
    34     protected DirectScheduleGTCrossover(DirectScheduleGTCrossover original, Cloner cloner)
    35       : base(original, cloner) {
     39    protected DirectScheduleGTCrossover(DirectScheduleGTCrossover original, Cloner cloner) : base(original, cloner) { }
     40    public DirectScheduleGTCrossover()
     41      : base() {
     42      Parameters.Add(new ValueLookupParameter<DoubleValue>("MutationProbability", "The probability that a task from the conflict set is chosen randomly instead of from one of the parents."));
    3643    }
     44
    3745    public override IDeepCloneable Clone(Cloner cloner) {
    3846      return new DirectScheduleGTCrossover(this, cloner);
    3947    }
    40     public DirectScheduleGTCrossover()
    41       : base() {
    42       Parameters.Add(new LookupParameter<PercentValue>("MutationProbability", "The probability that the mutation operator is applied on a solution."));
    43     }
    44 
    45 
    46     private LookupParameter<PercentValue> MutationProbabilityParameter {
    47       get { return (LookupParameter<PercentValue>)Parameters["MutationProbability"]; }
    48     }
    49 
    5048
    5149    public static Schedule Apply(IRandom random, Schedule parent1, Schedule parent2, ItemList<Job> jobData, double mutProp) {
    52       Schedule child = new Schedule(parent1.Resources.Count);
    53 
     50      var child = new Schedule(parent1.Resources.Count);
    5451
    5552      //Reset scheduled tasks in result
     
    7572        int progressOnResource = conflictedResource.Tasks.Count;
    7673        Task selectedTask = null;
    77         if (random.Next(100) < mutProp) {
     74        if (random.NextDouble() < mutProp) {
    7875          //Mutation
    7976          selectedTask = conflictSet[random.Next(conflictSet.Count)];
     
    9592    }
    9693
    97 
    9894    private static Task SelectTaskFromConflictSet(ItemList<Task> conflictSet, Schedule usedParent, int conflictedResourceNr, int progressOnResource) {
    9995      //Apply Crossover
     
    109105
    110106    public override Schedule Cross(IRandom random, Schedule parent1, Schedule parent2) {
    111       ItemList<Job> jobData = (ItemList<Job>)JobDataParameter.ActualValue.Clone();
    112       PercentValue mutProp = MutationProbabilityParameter.ActualValue;
     107      var jobData = (ItemList<Job>)JobDataParameter.ActualValue.Clone();
     108      var mutProp = MutationProbabilityParameter.ActualValue;
    113109      return Apply(random, parent1, parent2, jobData, mutProp.Value);
    114110    }
Note: See TracChangeset for help on using the changeset viewer.