Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/18/08 16:00:00 (16 years ago)
Author:
swagner
Message:

Fixed ticket #67

  • adapted accessing of variables in operators due to changes of variable lookup and the new name aliasing mechanism (actual/formal name translations should not be done directly anymore; instead the new method Scope.TranslateName should be used)
Location:
trunk/sources/HeuristicLab.Scheduling.JSSP
Files:
5 edited

Legend:

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

    r2 r77  
    4646        IItem var = GetVariableValue<IItem>("Variable", s, false);
    4747        if(var != null) {
    48           if(scope.GetVariable(GetVariableInfo("Variable").ActualName) != null) {
    49             scope.RemoveVariable(GetVariableInfo("Variable").ActualName);
     48          if(scope.GetVariable(scope.TranslateName("Variable")) != null) {
     49            scope.RemoveVariable(scope.TranslateName("Variable"));
    5050          }
    51           scope.AddVariable(new Variable(GetVariableInfo("Variable").ActualName, var));
     51          scope.AddVariable(new Variable(scope.TranslateName("Variable"), var));
    5252          return null;
    5353        }
  • trunk/sources/HeuristicLab.Scheduling.JSSP/IsSchedulable.cs

    r2 r77  
    4040    public override IOperation Apply(IScope scope) {
    4141      Operation op = GetVariableValue<Operation>("Operation", scope, true);
    42       if(scope.GetVariable(GetVariableInfo("Schedulable").ActualName) != null) {
     42      if(scope.GetVariable(scope.TranslateName("Schedulable")) != null) {
    4343        BoolData isSchedulable = GetVariableValue<BoolData>("Schedulable", scope, false);
    4444        isSchedulable.Data = (op.Predecessors.Count == 0);
    4545      } else {
    46         scope.AddVariable(new Variable(GetVariableInfo("Schedulable").ActualName, new BoolData((op.Predecessors.Count == 0))));
     46        scope.AddVariable(new Variable(scope.TranslateName("Schedulable"), new BoolData((op.Predecessors.Count == 0))));
    4747      }
    4848      return null;
  • trunk/sources/HeuristicLab.Scheduling.JSSP/ItemListIndexer.cs

    r2 r77  
    4545      ItemList list = GetVariableValue<ItemList>("List", scope, true);
    4646      int index = GetVariableValue<IntData>("Index", scope, true).Data;
    47       if(scope.GetVariable(GetVariableInfo("Object").ActualName) != null) {
    48         scope.RemoveVariable(GetVariableInfo("Object").ActualName);
     47      if(scope.GetVariable(scope.TranslateName("Object")) != null) {
     48        scope.RemoveVariable(scope.TranslateName("Object"));
    4949      }
    5050      if((list != null) && (index < list.Count)) {
    51         scope.AddVariable(new Variable(GetVariableInfo("Object").ActualName, (IItem)list[index].Clone()));
     51        scope.AddVariable(new Variable(scope.TranslateName("Object"), (IItem)list[index].Clone()));
    5252      }
    5353      return null;
  • trunk/sources/HeuristicLab.Scheduling.JSSP/JSSPInjector.cs

    r2 r77  
    6666
    6767    public override IOperation Apply(IScope scope) {
    68       scope.AddVariable(new Variable(GetVariableInfo("Machines").ActualName, machines.Clone() as IntData));
    69       scope.AddVariable(new Variable(GetVariableInfo("Jobs").ActualName, jobs.Clone() as IntData));
    70       scope.AddVariable(new Variable(GetVariableInfo("Operations").ActualName, (ItemList)operations.Clone()));
     68      scope.AddVariable(new Variable(scope.TranslateName("Machines"), machines.Clone() as IntData));
     69      scope.AddVariable(new Variable(scope.TranslateName("Jobs"), jobs.Clone() as IntData));
     70      scope.AddVariable(new Variable(scope.TranslateName("Operations"), (ItemList)operations.Clone()));
    7171      return base.Apply(scope);
    7272    }
  • trunk/sources/HeuristicLab.Scheduling.JSSP/ScheduleInjector.cs

    r2 r77  
    5151      IntData timespan = GetVariableValue<IntData>("Timespan", scope, true);
    5252      schedule = new Schedule(machines.Data, timespan.Data);
    53       scope.AddVariable(new Variable(GetVariableInfo("Schedule").ActualName, schedule));
     53      scope.AddVariable(new Variable(scope.TranslateName("Schedule"), schedule));
    5454      return null;
    5555    }
Note: See TracChangeset for help on using the changeset viewer.