Free cookie consent management tool by TermsFeed Policy Generator

Changeset 361 for trunk/sources


Ignore:
Timestamp:
07/03/08 09:52:15 (16 years ago)
Author:
mkofler
Message:

Set default timespan in the ScheduleInjector to Int32.MaxVal. Fixed issue with overwritten time slots (occurred when the processing time was zero).

Location:
trunk/sources/HeuristicLab.Scheduling.JSSP
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Scheduling.JSSP/ScheduleInjector.cs

    r77 r361  
    4343      AddVariableInfo(new VariableInfo("Timespan", "Desired timespan for the schedule", typeof(IntData), VariableKind.In));
    4444      GetVariableInfo("Timespan").Local = true;
    45       AddVariable(new Variable("Timespan", new IntData(10000)));
     45      AddVariable(new Variable("Timespan", new IntData(Int32.MaxValue)));
    4646      AddVariableInfo(new VariableInfo("Schedule", "Schedule", typeof(Schedule), VariableKind.New));
    4747    }
  • trunk/sources/HeuristicLab.Scheduling.JSSP/ScheduleTree.cs

    r2 r361  
    110110
    111111    private bool FitsIntoEmptySlot(TimeSlot slot, int start, int duration) {
    112       return ((slot.free >= duration) && (slot.start <= start) && (slot.end >= start + duration));
     112      // beware of operations with processing time zero --> check operation != null
     113      return ((slot.free >= duration) && (slot.start <= start) && (slot.end >= start + duration) && (slot.operation == null));
    113114    }
    114115
     
    133134      }
    134135      if(IsLeaf(slot)) {
    135         // fits exactly into slot
    136         if((slot.Data.start == op.Start) && (slot.Data.end == end)) {
     136        // fits exactly into slot; beware of operations with processing time 0 --> check operation != null
     137        if((slot.Data.start == op.Start) && (slot.Data.end == end) && (slot.Data.operation == null)) {
    137138          slot.Data = new TimeSlot(op);
    138139          UpdateMaxFreeSlot(slot);
Note: See TracChangeset for help on using the changeset viewer.