Examples of Shift


Examples of de.t68.utils.keyboard.icons.Shift

                else
                    button.setModel(keyboard.getAltgrModel());
                break;
            case SHIFT: // left shift
                toggleButton = new ToggleKeyboardButton(fontName, keyFontSize, getKeyCode(), getKeyChar());
                toggleButton.setIcon(new Shift(32, 32));
                toggleButton.addVirtualKeyListener(vkListener);
                button = toggleButton;
                if (keyboard.getShiftModel() == null)
                    keyboard.setShiftModel(button.getModel());
                else
View Full Code Here

Examples of hu.u_szeged.nbo.res_alloc.model.type.Shift

    HashMap<Task, Vector<Shift>> ID = new HashMap<Task, Vector<Shift>>();
    HashMap<Task, Integer> l = new HashMap<Task, Integer>();
    HashMap<Task, Integer> k = new HashMap<Task, Integer>();
    while (!M.isEmpty()) {
      // 1st step
      Shift efs = getefs();    // Earliest free shift
      if (efs == null) {
        log += (new Date()).toString() + ": nincs tobb szabad eroforras\n";
        return;
      }
      // 2nd step
      Vector<Task> L = loadL(M, efs, l, k);
      if (L.isEmpty()) {
        log += (new Date()).toString() + ": nincs kompartibilis munka\n";
        efs.setNotUsable(true);
        continue;
      }
      else
      {
        log += (new Date()).toString() + ": L feltoltve, elemszam: " + L.size() + "\n";
      }
    // step 3
      sortLAndID(efs, ID, L, l, k);
      if (L.isEmpty()) {
        log += (new Date()).toString() + ": nincs elvegezheto munka\n";
        efs.setNotUsable(true);
        continue;
      }
    // step 4
      Task cTask = minimizeL(L, ID, l)// Chosen task
      log += (new Date()).toString() + ": " + cTask.getId() + ". munka beutemezese\n";
View Full Code Here

Examples of hu.u_szeged.nbo.res_alloc.model.type.Shift

    model.NormalizeOutputs();
  }
 
  /** for step 1 */
  private Shift getefs() {
    Shift efs = null;
    int tau = Integer.MAX_VALUE;
   
    for (int i = 1; i <= model.getShiftContainer().getShiftNum(); i++) {
      Shift iShift = model.getShiftContainer().getShiftById(i);
      if (iShift.isNotUsable() == false && iShift.getDisengagingTime() < tau) {
        tau = iShift.getDisengagingTime();
        efs = iShift;
      }
    }
    return efs;
  }
View Full Code Here

Examples of hu.u_szeged.nbo.res_alloc.model.type.Shift

        ID.put(task, v);
      }
      if (ig > 1) {
        Vector<Shift> shiftVector = new Vector<Shift>();
        for (int j = 1; j <= model.getShiftContainer().getShiftNum(); j++) {
          Shift s = model.getShiftContainer().getShiftById(j);
          int a = k.get(task);
          int b = s.getDisengagingTime() + traffic.getDistance(s.getActualPlace(), task.getPlace(),
              s.getDisengagingTime());
          int c = l.get(task) + traffic.getDistance(task.getPlace(), s.getEndPlace(), l.get(task));
          int d = s.getTime().getEnd() + s.getOvertime();
          if (s.isNotUsable() == false && a >= b && c <= d) {
            shiftVector.add(s);
          }
        }
        if (shiftVector.size() < task.getResourceDemandNum())
        {
View Full Code Here

Examples of hu.u_szeged.nbo.res_alloc.model.type.Shift

  private void minShiftVector(Vector<Shift> v, Task t, int l) {
    while (v.size() > t.getResourceDemandNum()) {
      int maxIndex = -1;
      int max = Integer.MIN_VALUE;
      for (int i = 0; i < v.size(); i++) {
        Shift s = v.get(i);
        int x = traffic.getDistance(s.getActualPlace(), t.getPlace(), s.getDisengagingTime())
          + traffic.getDistance(t.getPlace(), s.getEndPlace(), l);
        if (x > max) {
          max = x;
          maxIndex = i;
        }
      }
View Full Code Here

Examples of hu.u_szeged.nbo.res_alloc.model.type.Shift

  }
 
  private int computeC_U() {
    int C_U = 0;
    for (int i = 1; i <= shiftContainer.getShiftNum(); i++) {
      Shift s = shiftContainer.getShiftById(i);
      if (s.getParent() == null) {
        Place actualPlace = s.getBeginPlace();
        int actualTime = s.getTime().getBegin();
        for (int j = 0; j < s.getAssignedTasks().size(); j++) {
          Task t = s.getAssignedTasks().get(j);
          int traveltime = trafficProperties.getDistance(actualPlace,
              t.getPlace(), actualTime);
          C_U += s.getResource().getFare() * traveltime;
          actualPlace = t.getPlace();
          actualTime = t.getCompletionTime().getEnd();
        }
        C_U += s.getResource().getFare() *
          trafficProperties.getDistance(actualPlace, s.getEndPlace(),
              actualTime);
      }
    }
    return C_U;
  }
View Full Code Here

Examples of hu.u_szeged.nbo.res_alloc.model.type.Shift

  }

  private int computeC_A() {
    int C_A = 0;
    for (int i = 1; i <= shiftContainer.getShiftNum(); i++) {
      Shift s = shiftContainer.getShiftById(i);
      if (s.getParent() == null) {
        Place actualPlace = s.getBeginPlace();
        int actualTime = s.getTime().getBegin();
        int worktime = 0;
        for (int j = 0; j < s.getAssignedTasks().size(); j++) {
          Task t = s.getAssignedTasks().get(j);
          int time = t.getCompletionTime().getEnd() -
              t.getCompletionTime().getBegin()
          + trafficProperties.getDistance(actualPlace, t.getPlace(), actualTime);
          worktime += time;
          actualTime = t.getCompletionTime().getEnd();
          actualPlace = t.getPlace();
        }
        worktime += trafficProperties.getDistance(actualPlace, s.getEndPlace(), actualTime);
       
        int time;
        if (s.getAssignedTasks().isEmpty()) {
          time = s.getTime().getEnd() - s.getTime().getBegin();
        }
        else {
          Task t = s.getAssignedTasks().lastElement();
          int max1 = t.getCompletionTime().getEnd() + trafficProperties.getDistance(t.getPlace(),
              s.getEndPlace(), t.getCompletionTime().getEnd());
          int max2 = s.getTime().getEnd();
          int max = (max1 > max2) ? max1 : max2;
          time = max - s.getTime().getBegin();
        }
        if (time < worktime) {
//          System.out.println(s + "\ntime: " + time + "\nworktime: " + worktime + "\n");
        }
        C_A += (time - worktime) * s.getStandCost();
       
      }
    }
//    System.out.println("miva");
//    System.out.println(C_A);
 
View Full Code Here

Examples of hu.u_szeged.nbo.res_alloc.model.type.Shift

  }
 
  private int computeC_T() {
    int C_T = 0;
    for (int i = 1; i <= shiftContainer.getShiftNum(); i++) {
      Shift s = shiftContainer.getShiftById(i);
      if (s.getParent() == null && !s.getAssignedTasks().isEmpty()) {
        Task lastTask = s.getAssignedTasks().lastElement();
        int overtime = lastTask.getCompletionTime().getEnd() - s.getTime().getEnd();
        if (overtime > 0) {
          C_T += overtime * s.getOvertimeCost();
        }
      }
    }
    return C_T;
  }
View Full Code Here

Examples of hu.u_szeged.nbo.res_alloc.model.type.Shift

  }
 
  public void NormalizeOutputs() {
    int i;
    for (i = 1; i <= this.getShiftContainer().getShiftNum(); i++) {
      Shift s = this.getShiftContainer().getShiftById(i);
      if (s.getParent() == null) {
        s.sortAssignments();
      }
    }

    for (i = this.getShiftContainer().getShiftNum(); i > 0; i--) {
      Shift s = this.getShiftContainer().getShiftById(i);
      if (s.getParent() != null) {
        this.getShiftContainer().removeShiftById(i);
      }
    }

    // matching ResourceDemands with Shifts
View Full Code Here

Examples of hu.u_szeged.nbo.res_alloc.model.type.Shift

 
  /** for step 2 */
  private Vector<Shift> loadLM(Task cTask) {
    Vector<Shift> LM = new Vector<Shift>();
    for (int i = 1; i <= model.getShiftContainer().getShiftNum(); i++) {
      Shift s = model.getShiftContainer().getShiftById(i);
      if (s.isNotUsable() == false) {
        int max1 = s.getDisengagingTime() +
          traffic.getDistance(s.getActualPlace(), cTask.getPlace(),
          s.getDisengagingTime());
        int max2 = cTask.getPrefferedTimeInterval().getBegin();
        lj = ((max1 > max2) ? max1 : max2) + cTask.getNormTime();
        if (lj + traffic.getDistance(cTask.getPlace(), s.getEndPlace(), lj)
          <= s.getTime().getEnd() + s.getOvertime()) {
          LM.add(s);
        }
      }
    }
    return LM;   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.