Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/24/11 16:20:04 (14 years ago)
Author:
jhelm
Message:

#1329: Did some heavy refactoring.

Location:
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3
Files:
18 added
8 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3

    • Property svn:ignore
      •  

        old new  
        11Plugin.cs
         2bin
         3obj
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Analyzers/BestSchedulingSolutionAnalyzer.cs

    r6260 r6266  
    3636  [Item("BestSchedulingSolutionAnalyzer", "An operator for analyzing the best solution of Scheduling Problems given in schedule-representation.")]
    3737  [StorableClass]
    38   public sealed class BestSchedulingSolutionAnalyzer : JSSPOperator, IAnalyzer, IStochasticOperator {
     38  public sealed class BestSchedulingSolutionAnalyzer : SchedulingAnalyzer, IStochasticOperator {
    3939    [StorableConstructor]
    4040    private BestSchedulingSolutionAnalyzer(bool deserializing) : base(deserializing) { }
     
    4646    }
    4747
    48 
    4948    public ILookupParameter<IRandom> RandomParameter {
    5049      get { return (LookupParameter<IRandom>)Parameters["Random"]; }
     
    5453    }
    5554
    56 
    57     public LookupParameter<BoolValue> MaximizationParameter {
    58       get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; }
    59     }
    60     public ScopeTreeLookupParameter<DoubleValue> QualityParameter {
    61       get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; }
    62     }
    63     public LookupParameter<Schedule> BestSolutionParameter {
    64       get { return (LookupParameter<Schedule>)Parameters["BestSolution"]; }
    65     }
    66     public ValueLookupParameter<ResultCollection> ResultsParameter {
    67       get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
    68     }
    69     public LookupParameter<DoubleValue> BestKnownQualityParameter {
    70       get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
    71     }
    72     public LookupParameter<Schedule> BestKnownSolutionParameter {
    73       get { return (LookupParameter<Schedule>)Parameters["BestKnownSolution"]; }
    74     }
    75     public ScopeTreeLookupParameter<Schedule> SchedulingSolutionParameter {
    76       get { return (ScopeTreeLookupParameter<Schedule>)Parameters["DecodedSchedulingSolution"]; }
     55    public BestSchedulingSolutionAnalyzer () : base () {
     56      Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
    7757    }
    7858
    79 
    80 
    81     public BestSchedulingSolutionAnalyzer () {
    82       Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));
    83 
    84       Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
    85       Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the JSSP solutions which should be analyzed."));
    86       Parameters.Add(new ScopeTreeLookupParameter<Schedule>("DecodedSchedulingSolution", "The solutions from which the best solution has to be chosen from."));
    87       Parameters.Add(new LookupParameter<Schedule>("BestSolution", "The best JSSP solution."));
    88       Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best JSSP solution should be stored."));
    89       Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this JSSP instance."));
    90       Parameters.Add(new LookupParameter<Schedule>("BestKnownSolution", "The best known solution of this JSSP instance."));
    91     }
    92 
    93 
    9459    public override IOperation Apply() {
    95       ItemList<JSSPJob> jobs = Jobs;
    9660      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
    9761      ItemArray<Schedule> solutions = SchedulingSolutionParameter.ActualValue;
     
    12892      return base.Apply();
    12993    }
    130 
    13194  }
    13295}
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/MakespanEvaluator.cs

    r6260 r6266  
    3434  [Item("Makespan Evaluator", "Represents an evaluator using the maximum makespan of a schedule.")]
    3535  [StorableClass]
    36   public class MakespanEvaluator : JSSPEvaluator {
     36  public class MakespanEvaluator : SchedulingEvaluator {
    3737    [StorableConstructor]
    3838    protected MakespanEvaluator(bool deserializing) : base(deserializing) { }
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/HeuristicLab.Problems.Scheduling-3.3.csproj

    r6260 r6266  
    4949  <ItemGroup>
    5050    <Compile Include="Analyzers\BestSchedulingSolutionAnalyzer.cs" />
    51     <Compile Include="Encodings\JobSequenceMatrix\JSMDecodingErrorPolicyTypes.cs" />
    52     <Compile Include="Encodings\JobSequenceMatrix\Crossovers\JSMJOXCrossover.cs" />
    53     <Compile Include="Encodings\JobSequenceMatrix\Crossovers\JSMCrossover.cs" />
    54     <Compile Include="Encodings\JobSequenceMatrix\Crossovers\JSMOXCrossover.cs" />
    55     <Compile Include="Encodings\JobSequenceMatrix\Crossovers\JSMSXXCrossover.cs" />
    56     <Compile Include="Encodings\JobSequenceMatrix\JSMDecoder.cs" />
    57     <Compile Include="Encodings\JobSequenceMatrix\JSMForcingStrategyTypes.cs" />
    58     <Compile Include="Encodings\JobSequenceMatrix\JSMRandomCreator.cs" />
    59     <Compile Include="Encodings\JobSequenceMatrix\JSMEncoding.cs" />
    60     <Compile Include="Encodings\JobSequenceMatrix\Manipulators\JSMShiftChangeManipulator.cs" />
    61     <Compile Include="Encodings\JobSequenceMatrix\Manipulators\JSMManipulator.cs" />
    62     <Compile Include="Encodings\JobSequenceMatrix\Manipulators\JSMSwapManipulator.cs" />
    63     <Compile Include="Encodings\JSSPCrossover.cs" />
    64     <Compile Include="Encodings\JSSPDecoder.cs" />
    65     <Compile Include="Encodings\JSSPEncodingTypes.cs" />
    66     <Compile Include="Encodings\PermutationWithRepetition\Crossovers\PWRGOXCrossover.cs" />
    67     <Compile Include="Encodings\PermutationWithRepetition\Crossovers\PWRCrossover.cs" />
    68     <Compile Include="Encodings\PermutationWithRepetition\Crossovers\PWRPPXCrossover.cs" />
    69     <Compile Include="Encodings\PermutationWithRepetition\Manipulators\PWRUniformOnePositionManipulator.cs" />
    70     <Compile Include="Encodings\PermutationWithRepetition\Manipulators\PWRManipulator.cs" />
    71     <Compile Include="Encodings\PermutationWithRepetition\PWRDecoder.cs" />
    72     <Compile Include="Encodings\PermutationWithRepetition\PWREncoding.cs" />
    73     <Compile Include="Encodings\PermutationWithRepetition\PWRRandomCreator.cs" />
    74     <Compile Include="Encodings\PriorityRulesVector\Crossovers\PRVSinglePointCrossover.cs" />
    75     <Compile Include="Encodings\PriorityRulesVector\Crossovers\PRVDiscreteCrossover.cs" />
    76     <Compile Include="Encodings\PriorityRulesVector\Manipulators\PRVUniformOnePositionManipulator.cs" />
    77     <Compile Include="Encodings\PriorityRulesVector\PRVEncoding.cs" />
    78     <Compile Include="Interfaces\IJSSPDecoder.cs" />
     51    <Compile Include="Analyzers\SchedulingAnalyzer.cs" />
     52    <Compile Include="Encodings\JobShopScheduling\JSSPManipulator.cs" />
     53    <Compile Include="Encodings\JobShopScheduling\JSSPDecoder.cs" />
     54    <Compile Include="Encodings\JobShopScheduling\JSSPCrossover.cs" />
     55    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\JSMDecodingErrorPolicyTypes.cs" />
     56    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Crossovers\JSMJOXCrossover.cs" />
     57    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Crossovers\JSMCrossover.cs" />
     58    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Crossovers\JSMOXCrossover.cs" />
     59    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Crossovers\JSMSXXCrossover.cs" />
     60    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\JSMDecoder.cs" />
     61    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\JSMForcingStrategyTypes.cs" />
     62    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\JSMRandomCreator.cs" />
     63    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\JSMEncoding.cs" />
     64    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Manipulators\JSMShiftChangeManipulator.cs" />
     65    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Manipulators\JSMManipulator.cs" />
     66    <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Manipulators\JSMSwapManipulator.cs" />
     67    <Compile Include="Encodings\JobShopScheduling\JSSPCreator.cs" />
     68    <Compile Include="Encodings\SchedulingCrossover.cs" />
     69    <Compile Include="Encodings\SchedulingDecoder.cs" />
     70    <Compile Include="Encodings\JobShopScheduling\JSSPEncodingTypes.cs" />
     71    <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\Crossovers\PWRGOXCrossover.cs" />
     72    <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\Crossovers\PWRCrossover.cs" />
     73    <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\Crossovers\PWRPPXCrossover.cs" />
     74    <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\Manipulators\PWRUniformOnePositionManipulator.cs" />
     75    <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\Manipulators\PWRManipulator.cs" />
     76    <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\PWRDecoder.cs" />
     77    <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\PWREncoding.cs" />
     78    <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\PWRRandomCreator.cs" />
     79    <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\Crossovers\PRVSinglePointCrossover.cs" />
     80    <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\Crossovers\PRVDiscreteCrossover.cs" />
     81    <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\Manipulators\PRVUniformOnePositionManipulator.cs" />
     82    <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\PRVEncoding.cs" />
     83    <Compile Include="Evaluators\SchedulingEvaluatorType.cs" />
     84    <Compile Include="Evaluators\SchedulingEvaluatorTypes.cs" />
     85    <Compile Include="Evaluators\MeanTardinessEvaluator.cs" />
     86    <Compile Include="Interfaces\IJSSPEncoding.cs" />
     87    <Compile Include="Interfaces\ISchedulingDecoder.cs" />
    7988    <Compile Include="Interfaces\ISchedulingOperator.cs" />
    8089    <Compile Include="Interfaces\IPWROperator.cs" />
    8190    <Compile Include="Interfaces\IPRVOperator.cs" />
    82     <Compile Include="Interfaces\IJSSPEncoding.cs" />
    83     <Compile Include="Encodings\JSSPCreator.cs" />
    84     <Compile Include="Encodings\JSSPManipulator.cs" />
    85     <Compile Include="Encodings\PriorityRulesVector\Crossovers\PRVCrossover.cs" />
    86     <Compile Include="Encodings\PriorityRulesVector\PRVDecoder.cs" />
    87     <Compile Include="Encodings\PriorityRulesVector\PRVRandomCreator.cs" />
    88     <Compile Include="Encodings\PriorityRulesVector\Manipulators\PRVManipulator.cs" />
     91    <Compile Include="Interfaces\ISchedulingEncoding.cs" />
     92    <Compile Include="Encodings\SchedulingCreator.cs" />
     93    <Compile Include="Encodings\SchedulingManipulator.cs" />
     94    <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\Crossovers\PRVCrossover.cs" />
     95    <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\PRVDecoder.cs" />
     96    <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\PRVRandomCreator.cs" />
     97    <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\Manipulators\PRVManipulator.cs" />
    8998    <Compile Include="Evaluators\MakespanEvaluator.cs" />
    9099    <Compile Include="IndexedTaskList.cs" />
    91100    <Compile Include="Interfaces\IJSMOperator.cs" />
    92     <Compile Include="Interfaces\IJSSPCrossover.cs" />
    93     <Compile Include="Interfaces\IJSSPManipulator.cs" />
     101    <Compile Include="Interfaces\ISchedulingCrossover.cs" />
     102    <Compile Include="Interfaces\ISchedulingManipulator.cs" />
    94103    <Compile Include="Interfaces\ISchedulingCreator.cs" />
    95104    <Compile Include="Interfaces\ISchedulingEvaluator.cs" />
    96105    <Compile Include="Resource.cs" />
    97     <Compile Include="Evaluators\JSSPEvaluator.cs" />
     106    <Compile Include="Evaluators\SchedulingEvaluator.cs" />
    98107    <Compile Include="JSSPJob.cs" />
    99108    <Compile Include="JobShopSchedulingProblem.cs" />
    100109    <Compile Include="JSSPTask.cs" />
    101     <Compile Include="Encodings\JSSPOperator.cs" />
    102     <Compile Include="Evaluators\JSSPEvaluationAlgorithm.cs" />
     110    <Compile Include="Interfaces\IJSSPOperator.cs" />
     111    <Compile Include="Evaluators\SchedulingEvaluationAlgorithm.cs" />
    103112    <Compile Include="SchedulingProblem.cs" />
    104113    <Compile Include="Plugin.cs" />
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/IndexedTaskList.cs

    r6177 r6266  
    6565    #endregion
    6666
     67    public DoubleValue TotalDuration {
     68      get {
     69        double result = 0;
     70        foreach (JSSPTask t in Tasks) {
     71          if (t.EndTime.Value > result)
     72            result = t.EndTime.Value;
     73        }
     74        return new DoubleValue(result);
     75      }
     76    }
     77
    6778    public IndexedTaskList (IntValue index) : base (){
    6879      Parameters.Add(new ValueParameter<IntValue>("Index", "The index of the resource in the associated Scheduling Problem.", new IntValue()));
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/JSSPJob.cs

    r6260 r6266  
    3838    protected JSSPJob(JSSPJob original, Cloner cloner)
    3939      : base(original, cloner) {
     40        this.DueDate = cloner.Clone(original.DueDate);
    4041    }
    4142    public override IDeepCloneable Clone(Cloner cloner) {
     
    4344    }
    4445
    45     public JSSPJob(IntValue index) : base (index) {}
     46    public DoubleValue DueDate { get; set; }
     47
     48    public JSSPJob(IntValue index, DoubleValue dueDate) : base (index) {
     49      if (dueDate != null)
     50        DueDate = (DoubleValue)dueDate.Clone();
     51      else
     52        DueDate = null;
     53    }
    4654
    4755    public override string ToString() {
     
    5159        sb.Append(t.ToString () + " ");
    5260      }
     61      if (DueDate != null)
     62        sb.Append("{" + DueDate.Value + "} ");
    5363      sb.Append("]");
    5464      return sb.ToString();
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/JobShopSchedulingProblem.cs

    r6260 r6266  
    3434using HeuristicLab.Problems.Scheduling.Evaluators;
    3535using HeuristicLab.Parameters;
    36 using HeuristicLab.Problems.Scheduling.Encodings.JobSequenceMatrix;
    3736using HeuristicLab.Encodings.PermutationEncoding;
    3837using HeuristicLab.Problems.Scheduling.Analyzers;
    3938using HeuristicLab.PluginInfrastructure;
    40 using HeuristicLab.Problems.Scheduling.Encodings.JobSequenceMatrix.Manipulators;
    41 using HeuristicLab.Problems.Scheduling.Encodings.JobSequenceMatrix.Crossovers;
    4239using HeuristicLab.Problems.Scheduling.Interfaces;
    43 using HeuristicLab.Problems.Scheduling.Encodings.PriorityRulesVector;
    4440using HeuristicLab.Encodings.IntegerVectorEncoding;
    45 using HeuristicLab.Problems.Scheduling.Encodings.PermutationWithRepetition;
     41using HeuristicLab.Problems.Scheduling.Encodings.JobShopScheduling;
     42using HeuristicLab.Problems.Scheduling.Encodings.JobShopScheduling.JobSequenceMatrix;
     43using HeuristicLab.Problems.Scheduling.Encodings.JobShopScheduling.PriorityRulesVector;
     44using HeuristicLab.Problems.Scheduling.Encodings.JobShopScheduling.PermutationWithRepetition;
    4645
    4746namespace HeuristicLab.Problems.Scheduling {
     
    5453    private JobShopSchedulingProblem(JobShopSchedulingProblem original, Cloner cloner)
    5554      : base(original, cloner) {
    56         this.encodingType = original.encodingType;
     55      this.encodingType = original.encodingType;
     56      this.Jobs = cloner.Clone(original.Jobs);
     57      this.EvaluatorType = cloner.Clone(original.EvaluatorType);
    5758        AttachEventHandlers();
    5859    }
     
    6667      get { return (ValueParameter<ItemList<JSSPJob>>)Parameters["Jobs"]; }
    6768    }
     69    public ValueParameter<SchedulingEvaluatorType> EvaluatorTypeParameter {
     70      get { return (ValueParameter<SchedulingEvaluatorType>)Parameters["EvaluatorType"]; }
     71    }
    6872    public OptionalValueParameter<Schedule> BestKnownSolutionParameter {
    6973      get { return (OptionalValueParameter<Schedule>)Parameters["BestKnownSolution"]; }
    7074    }
     75
    7176    #endregion
    7277
     
    7681      set { JobsParameter.Value = value; }
    7782    }
     83    public SchedulingEvaluatorType EvaluatorType {
     84      get { return EvaluatorTypeParameter.Value; }
     85      set { EvaluatorTypeParameter.Value = value; }
     86    }
    7887    public Schedule BestKnownSolution {
    7988      get { return BestKnownSolutionParameter.Value; }
     
    8695
    8796    public JobShopSchedulingProblem()
    88       : base(new JSSPEvaluationAlgorithm (), new JSMRandomCreator ()) {
    89         Parameters.Add(new ValueParameter<ItemList<JSSPJob>>("Jobs", "Jobdata defining the precedence relationships and the duration of the tasks in this JSSP-Instance.", new ItemList<JSSPJob>()));
    90         Parameters.Add(new OptionalValueParameter<Schedule>("BestKnownSolution", "The best known solution of this JSSP instance."));
     97      : base(new SchedulingEvaluationAlgorithm (), new JSMRandomCreator ()) {
     98      Parameters.Add(new ValueParameter<ItemList<JSSPJob>>("Jobs", "Jobdata defining the precedence relationships and the duration of the tasks in this JSSP-Instance.", new ItemList<JSSPJob>()));
     99      Parameters.Add(new ValueParameter<SchedulingEvaluatorType>("EvaluatorType", "Type of the evaluator used to determine the quality of an individual.", new SchedulingEvaluatorType (SchedulingEvaluatorTypes.MakespanEvaluator)));
     100      Parameters.Add(new OptionalValueParameter<Schedule>("BestKnownSolution", "The best known solution of this JSSP instance."));
    91101        encodingType = JSSPEncodingTypes.JSMEncoding;
    92102        InitializeOperators();
     
    119129
    120130    private void ApplyEncoding() {
    121       if (encodingType == JSSPEncodingTypes.JSMEncoding) {
    122         Operators.AddRange(ApplicationManager.Manager.GetInstances<IJSMOperator>());
    123         ((JSSPEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<JSMEncoding>(new JSMDecoder(), new MakespanEvaluator());
     131      if (EvaluatorType.Value == SchedulingEvaluatorTypes.MakespanEvaluator) {
     132        if (encodingType == JSSPEncodingTypes.JSMEncoding) {
     133          Operators.AddRange(ApplicationManager.Manager.GetInstances<IJSMOperator>());
     134          ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<JSMEncoding>(new JSMDecoder(), new MakespanEvaluator());
     135        } else {
     136          if (encodingType == JSSPEncodingTypes.PRVEncoding) {
     137            Operators.AddRange(ApplicationManager.Manager.GetInstances<IPRVOperator>());
     138            ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PRVEncoding>(new PRVDecoder(), new MakespanEvaluator());
     139          } else {
     140            if (encodingType == JSSPEncodingTypes.PWREncoding) {
     141              Operators.AddRange(ApplicationManager.Manager.GetInstances<IPWROperator>());
     142              ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PWREncoding>(new PWRDecoder(), new MakespanEvaluator());
     143            }
     144          }
     145        }
    124146      } else {
    125         if (encodingType == JSSPEncodingTypes.PRVEncoding) {
    126           Operators.AddRange(ApplicationManager.Manager.GetInstances<IPRVOperator>());
    127           ((JSSPEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PRVEncoding>(new PRVDecoder(), new MakespanEvaluator());
     147        if (encodingType == JSSPEncodingTypes.JSMEncoding) {
     148          Operators.AddRange(ApplicationManager.Manager.GetInstances<IJSMOperator>());
     149          ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<JSMEncoding>(new JSMDecoder(), new MeanTardinessEvaluator());
    128150        } else {
    129           if (encodingType == JSSPEncodingTypes.PWREncoding) {
    130             Operators.AddRange(ApplicationManager.Manager.GetInstances<IPWROperator>());
    131             ((JSSPEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PWREncoding>(new PWRDecoder(), new MakespanEvaluator());
     151          if (encodingType == JSSPEncodingTypes.PRVEncoding) {
     152            Operators.AddRange(ApplicationManager.Manager.GetInstances<IPRVOperator>());
     153            ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PRVEncoding>(new PRVDecoder(), new MeanTardinessEvaluator());
     154          } else {
     155            if (encodingType == JSSPEncodingTypes.PWREncoding) {
     156              Operators.AddRange(ApplicationManager.Manager.GetInstances<IPWROperator>());
     157              ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PWREncoding>(new PWRDecoder(), new MeanTardinessEvaluator());
     158            }
    132159          }
    133160        }
     
    183210        if (data.Count > 0 && ((int)data[0][0] >= 48 && (int)data[0][0] <= 57)) {
    184211          int jobCount = 0;
    185           //data[0] = nrOfJobs
    186           //data[1] = nrOfResources
     212          //data[0] = nrOfJobs (int)
     213          //data[1] = nrOfResources (int)
     214          //data[2] = bestKnownQuality (double)
     215          //data[3] = dueDates (0|1)
     216          bool withDueDates = false;
    187217          if (data.Count > 2)
    188218            BestKnownQualityParameter.ActualValue = new DoubleValue(Double.Parse (data[2]));
     219          if (data.Count > 3 && data[3] == "1")
     220            withDueDates = true;
    189221          line = problemFile.ReadLine();
    190222          data = SplitString(line);
    191223          while (!problemFile.EndOfStream && data.Count > 0 && ((int)data[0][0] >= 48 && (int)data[0][0] <= 57)) {
    192             JSSPJob j = new JSSPJob(new IntValue(jobCount));
    193             for (int i = 0; i < data.Count; i++) {
     224            DoubleValue dueDate = null;
     225            int dataCount = data.Count;
     226            if (withDueDates) {
     227              dueDate = new DoubleValue(Double.Parse(data[data.Count - 1]));
     228              dataCount--;
     229            }
     230            JSSPJob j = new JSSPJob(new IntValue(jobCount), dueDate);
     231            for (int i = 0; i < dataCount; i++) {
    194232              JSSPTask t = new JSSPTask(new IntValue (i / 2), new IntValue(Int32.Parse(data[i])), new DoubleValue(Double.Parse(data[i + 1])), new IntValue (jobCount));
    195233              if (j.Tasks.Count > 0) {
  • branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Resource.cs

    r6260 r6266  
    4343    }
    4444
    45     public DoubleValue TotalDuration {
    46       get {
    47         double result = 0;
    48         foreach (JSSPTask t in Tasks) {
    49           if (t.EndTime.Value > result)
    50             result = t.EndTime.Value;
    51         }
    52         return new DoubleValue (result);
    53       }
    54     }
    55 
    5645    public Resource(IntValue index) : base (index) { }
    5746
Note: See TracChangeset for help on using the changeset viewer.