Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/11/12 01:46:34 (12 years ago)
Author:
abeham
Message:

#1329:

  • Removed unnecessary DueDates parameter
  • Changed ValueParameter to FixedValueParameter for Jobs and Resources
  • Made Job and Task INotifyPropertyChanged
  • Added a JobView and TaskView
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Scheduling/3.3/JobShopSchedulingProblem.cs

    r8882 r8886  
    7979    }
    8080
    81     public ValueParameter<IntValue> JobsParameter {
    82       get { return (ValueParameter<IntValue>)Parameters["Jobs"]; }
    83     }
    84     public ValueParameter<IntValue> ResourcesParameter {
    85       get { return (ValueParameter<IntValue>)Parameters["Resources"]; }
     81    public IFixedValueParameter<IntValue> JobsParameter {
     82      get { return (IFixedValueParameter<IntValue>)Parameters["Jobs"]; }
     83    }
     84    public IFixedValueParameter<IntValue> ResourcesParameter {
     85      get { return (IFixedValueParameter<IntValue>)Parameters["Resources"]; }
    8686    }
    8787    public ValueParameter<SchedulingEvaluator> SolutionEvaluatorParameter {
    8888      get { return (ValueParameter<SchedulingEvaluator>)Parameters["SolutionEvaluator"]; }
    89     }
    90     public ValueParameter<BoolValue> DueDatesParameter {
    91       get { return (ValueParameter<BoolValue>)Parameters["DueDates"]; }
    9289    }
    9390    #endregion
     
    10299      set { BestKnownSolutionParameter.Value = value; }
    103100    }
    104     public IntValue Jobs {
    105       get { return JobsParameter.Value; }
    106       set { JobsParameter.Value = value; }
    107     }
    108     public IntValue Resources {
    109       get { return ResourcesParameter.Value; }
    110       set { ResourcesParameter.Value = value; }
     101    public int Jobs {
     102      get { return JobsParameter.Value.Value; }
     103      set { JobsParameter.Value.Value = value; }
     104    }
     105    public int Resources {
     106      get { return ResourcesParameter.Value.Value; }
     107      set { ResourcesParameter.Value.Value = value; }
    111108    }
    112109    public SchedulingEvaluator SolutionEvaluator {
    113110      get { return SolutionEvaluatorParameter.Value; }
    114111      set { SolutionEvaluatorParameter.Value = value; }
    115     }
    116     public BoolValue DueDates {
    117       get { return DueDatesParameter.Value; }
    118       set { DueDatesParameter.Value = value; }
    119112    }
    120113    public override Image ItemImage {
     
    129122      Parameters.Add(new OptionalValueParameter<Schedule>("BestKnownSolution", "The best known solution of this JSSP instance."));
    130123
    131       Parameters.Add(new ValueParameter<IntValue>("Jobs", "The number of jobs used in this JSSP instance.", new IntValue()));
    132       Parameters.Add(new ValueParameter<IntValue>("Resources", "The number of resources used in this JSSP instance.", new IntValue()));
    133       Parameters.Add(new ValueParameter<BoolValue>("DueDates", "Determines whether the problem instance uses due dates or not.", new BoolValue()));
     124      Parameters.Add(new FixedValueParameter<IntValue>("Jobs", "The number of jobs used in this JSSP instance.", new IntValue()));
     125      Parameters.Add(new FixedValueParameter<IntValue>("Resources", "The number of resources used in this JSSP instance.", new IntValue()));
    134126      Parameters.Add(new ValueParameter<SchedulingEvaluator>("SolutionEvaluator", "The evaluator used to determine the quality of a solution.", new MakespanEvaluator()));
    135127
     
    183175
    184176      JobData = jobData;
    185       Jobs = new IntValue(data.Jobs);
    186       Resources = new IntValue(data.Resources);
    187       DueDates = new BoolValue(data.DueDates != null);
     177      Jobs = data.Jobs;
     178      Resources = data.Resources;
    188179    }
    189180
     
    192183        Name = Name,
    193184        Description = Description,
    194         Jobs = Jobs.Value,
    195         Resources = Resources.Value,
    196         ProcessingTimes = new double[Jobs.Value, Resources.Value],
    197         Demands = new int[Jobs.Value, Resources.Value],
    198         DueDates = (DueDates.Value ? new double[Jobs.Value] : null)
     185        Jobs = Jobs,
     186        Resources = Resources,
     187        ProcessingTimes = new double[Jobs, Resources],
     188        Demands = new int[Jobs, Resources],
     189        DueDates = new double[Jobs]
    199190      };
    200191
    201192      foreach (var job in JobData) {
    202193        var counter = 0;
    203         if (DueDates.Value) result.DueDates[job.Index] = job.DueDate;
     194        result.DueDates[job.Index] = job.DueDate;
    204195        foreach (var task in job.Tasks) {
    205196          result.ProcessingTimes[task.JobNr, counter] = task.Duration;
Note: See TracChangeset for help on using the changeset viewer.