Examples of TimeWindow


Examples of org.apache.uima.ducc.transport.event.common.TimeWindow

            // Mark the time the process ended initialization. It also
            // covers a case when the process terminates while initializing
                tw.setEnd(TimeStamp.getCurrentMillis());
           
              if ( duccEvent.getState().equals(ProcessState.Running)) {
                ITimeWindow twr = new TimeWindow();
                String millis;
                millis = TimeStamp.getCurrentMillis();
                // Mark the time the process started running
                processEntry.getValue().setTimeWindowRun(twr);
                twr.setStart(millis);
              }
          }
          }
          ManagedProcess deployedProcess = null;
          synchronized (monitor) {
View Full Code Here

Examples of org.apache.uima.ducc.transport.event.common.TimeWindow

          logger.info(methodName, workDuccId, "Agent [" + getIdentity().getIp()
                  + "] Deploying Process - DuccID:" + process.getDuccId().getFriendly()
                  + " Unique DuccID:" + process.getDuccId().getUnique() + " Node Assignment:"
                  + process.getNodeIdentity().getIp() + " Process Memory Assignment:"
                  + processMemoryAssignment + " MBs");
          TimeWindow tw = new TimeWindow();
          tw.setStart(TimeStamp.getCurrentMillis());
          tw.setEnd(null);
          process.setTimeWindowInit(tw);
          ManagedProcess managedProcess = new ManagedProcess(process, commandLine, this, logger,
                  processMemoryAssignment);
          managedProcess.setProcessInfo(info);
          managedProcess.setWorkDuccId(workDuccId);
View Full Code Here

Examples of org.apache.uima.ducc.transport.event.common.TimeWindow

        String itd0 = "<td align=\"right\">";
        String itd1 = "</td>";
        String isp0 = "<span>";
        String isp1 = "</span>";
        try {
          TimeWindow t = (TimeWindow) process.getTimeWindowInit();
          if(t != null) {
            long now = System.currentTimeMillis();
            String tS = t.getStart(""+now);
            String tE = t.getEnd(""+now);
            initTime = getDuration(jobid,tE,tS);
            if(t.isEstimated()) {
              isp0 = "<span title=\"estimated\" class=\"health_green\">";
            }
            else {
              isp0 = "<span class=\"health_black\">";
            }
          }
          boolean cluetips_disabled = true;
          if(cluetips_disabled) {
            if(!initTime.equals("00")) {
              String p_idJob = pname_idJob+"="+job.getDuccId().getFriendly();
              String p_idPro = pname_idPro+"="+process.getDuccId().getFriendly();
              initTime = "<a href=\""+duccUimaInitializationReport+"?"+p_idJob+"&"+p_idPro+"\" onclick=\"var newWin = window.open(this.href,'child','height=600,width=475,scrollbars');  newWin.focus(); return false;\">"+initTime+"</a>";
              loadme.append("");
            }
          }
          else {
            List<IUimaPipelineAEComponent> upcList = jp.getUimaPipelineComponents();
            if(upcList != null) {
              if(!upcList.isEmpty()) {
                String id = ""+process.getDuccId().getFriendly();
                initTime = "<a class=\"classLoad\" title=\""+id+"\" href=\"#loadme"+id+"\" rel=\"#loadme"+id+"\">"+initTime+"</a>";
                loadme.append("<div id=\"loadme"+id+"\">");
                loadme.append("<table>");
                loadme.append("<tr>");
                String ch1 = "Name";
                String ch2 = "State";
                String ch3 = "Time";
                loadme.append("<td>"+"<b>"+ch1+"</b>");
                loadme.append("<td>"+"<b>"+ch2+"</b>");
                loadme.append("<td>"+"<b>"+ch3+"</b>");
                Iterator<IUimaPipelineAEComponent> upcIterator = upcList.iterator();
                while(upcIterator.hasNext()) {
                  IUimaPipelineAEComponent upc = upcIterator.next();
                  String iName = upc.getAeName();
                  String iState = upc.getAeState().toString();
                  String iTime = FormatHelper.duration(upc.getInitializationTime());
                  loadme.append("<tr>");
                  loadme.append("<td>"+iName);
                  loadme.append("<td>"+iState);
                  loadme.append("<td>"+iTime);
                }
                loadme.append("</table>");
                loadme.append("</div>");
              }
            }
          }
        }
        catch(Exception e) {
          duccLogger.trace(location, jobid, "no worries", e);
        }
        catch(Throwable t) {
          duccLogger.trace(location, jobid, "no worries", t);
        }
        cbList[index].append(itd0);
        cbList[index].append(isp0);
        cbList[index].append(loadme);
        cbList[index].append(initTime);
        cbList[index].append(isp1);
        cbList[index].append(itd1);       
        break;
    }
    // Time:run
    index++; // jp.11
    String runTime = "00";
    String rtd0 = "<td align=\"right\">";
    String rtd1 = "</td>";
    String rsp0 = "<span>";
    String rsp1 = "</span>";
    // <UIMA-3351>
    boolean useTimeRun = true;
    switch(sType) {
    case SPC:
      break;
    case SPU:
      break;
    case MR:
      break;
    case JD:
      break
    case UIMA:
      if(!process.isAssignedWork()) {
        useTimeRun = false;
      }
      break
    default:
      break;
    }
    // </UIMA-3351>
    if(useTimeRun) {
      try {
        TimeWindow t = (TimeWindow) process.getTimeWindowRun();
        if(t != null) {
          long now = System.currentTimeMillis();
          String tS = t.getStart(""+now);
          String tE = t.getEnd(""+now);
          runTime = getDuration(jobid,tE,tS);
          if(t.isEstimated()) {
            rsp0 = "<span title=\"estimated\" class=\"health_green\">";
          }
          else {
            rsp0 = "<span class=\"health_black\">";
          }
View Full Code Here

Examples of org.jitterbit.integration.activity.client.TimeWindow

        return Lists.newArrayList(details);
    }

    @Override
    public boolean occurredWithinTimeWindow(Date start, Date end) {
        return new TimeWindow(start, end).isInside(statusTime);
    }
View Full Code Here

Examples of rinde.sim.util.TimeWindow

    final ScenarioBuilder sb = new ScenarioBuilder(PDPScenarioEvent.ADD_DEPOT,
        PDPScenarioEvent.ADD_PARCEL, PDPScenarioEvent.ADD_VEHICLE,
        PDPScenarioEvent.TIME_OUT);

    sb.addEvent(new AddVehicleEvent(100, new VehicleDTO(new Point(7, 7), 7d, 2,
        new TimeWindow(0, 1000L))));
    sb.addEvent(new AddDepotEvent(76, new Point(3, 3)));
    sb.addEvent(new AddVehicleEvent(125, new VehicleDTO(new Point(6, 9), 3d, 1,
        new TimeWindow(500, 10000L))));
    sb.addEvent(new AddParcelEvent(ParcelDTO
        .builder(new Point(0, 0), new Point(1, 1))
        .pickupTimeWindow(new TimeWindow(2500, 10000))
        .deliveryTimeWindow(new TimeWindow(5000, 10000))
        .neededCapacity(0)
        .arrivalTime(2400)
        .pickupDuration(200)
        .deliveryDuration(800)
        .build()));
    sb.addEvent(new TimedEvent(PDPScenarioEvent.TIME_OUT, 200000));

    final VanLon14Scenario s = sb
        .build(new ScenarioCreator<VanLon14Scenario>() {
          @Override
          public VanLon14Scenario create(List<TimedEvent> eventList,
              Set<Enum<?>> eventTypes) {
            return new VanLon14Scenario(eventList, new TimeWindow(0, 10),
                new Point(0, 0), new Point(10, 10), 1000L,
                VanLon14.ExperimentClass.HIGH_LARGE, 0);
          }
        });
View Full Code Here

Examples of rinde.sim.util.TimeWindow

    final ScenarioBuilder sb = new ScenarioBuilder(PDPScenarioEvent.ADD_DEPOT,
        PDPScenarioEvent.ADD_PARCEL, PDPScenarioEvent.ADD_VEHICLE,
        PDPScenarioEvent.TIME_OUT);

    sb.addEvent(new AddVehicleEvent(100, new VehicleDTO(new Point(7, 7), 7d, 2,
        new TimeWindow(0, 1000L))));
    sb.addEvent(new AddDepotEvent(76, new Point(3, 3)));
    sb.addEvent(new AddVehicleEvent(125, new VehicleDTO(new Point(6, 9), 3d, 1,
        new TimeWindow(500, 10000L))));
    sb.addEvent(new AddParcelEvent(new ParcelDTO(new Point(0, 0), new Point(1,
        1), new TimeWindow(2500, 10000), new TimeWindow(5000, 10000), 0, 2400,
        200, 800)));
    sb.addEvent(new TimedEvent(PDPScenarioEvent.TIME_OUT, 200000));

    final TestScenario s = sb.build(new ScenarioCreator<TestScenario>() {
      @Override
      public TestScenario create(List<TimedEvent> eventList,
          Set<Enum<?>> eventTypes) {
        return new TestScenario(eventList, new TimeWindow(0, 1000), 1000L, SI
            .MILLI(SI.SECOND), TestProblemClass.TEST);
      }
    });

    final String res = ScenarioIO.write(s);
View Full Code Here

Examples of rinde.sim.util.TimeWindow

  @Test
  public void overridingTest() {
    final ParcelDTO.Builder b = ParcelDTO.builder(new Point(0, 0),
        new Point(2, 2));

    final ParcelDTO dto1 = b.timeWindows(new TimeWindow(7, 10)).build();
    assertEquals(new TimeWindow(7, 10), dto1.pickupTimeWindow);
    assertEquals(new TimeWindow(7, 10), dto1.deliveryTimeWindow);

    final ParcelDTO dto2 = b.pickupTimeWindow(new TimeWindow(8, 11)).build();
    assertEquals(new TimeWindow(8, 11), dto2.pickupTimeWindow);
    assertEquals(new TimeWindow(7, 10), dto2.deliveryTimeWindow);

    final ParcelDTO dto3 = b.serviceDuration(560L).build();
    assertEquals(new TimeWindow(8, 11), dto3.pickupTimeWindow);
    assertEquals(new TimeWindow(7, 10), dto3.deliveryTimeWindow);
    assertEquals(560, dto3.pickupDuration);
    assertEquals(560, dto3.deliveryDuration);

    final ParcelDTO dto4 = b.pickupDuration(230L).build();
    assertEquals(230, dto4.pickupDuration);
View Full Code Here

Examples of rinde.sim.util.TimeWindow

   */
  @Test
  public void convertDecompositionTest() {
    final VehicleDTO vd1 = new VehicleDTO(
        new Point(5, 5), 30, 0,
        new TimeWindow(100L, 100000L));

    final ParcelDTO a = ParcelDTO.builder(new Point(0, 0), new Point(10, 10))
        .pickupTimeWindow(new TimeWindow(0, 30))
        .deliveryTimeWindow(new TimeWindow(70, 80))
        .pickupDuration(5000L)
        .deliveryDuration(10000L)
        .build();

    final ParcelDTO b = ParcelDTO.builder(new Point(5, 0), new Point(10, 7))
        .pickupTimeWindow(new TimeWindow(0, 30))
        .deliveryTimeWindow(new TimeWindow(70, 80))
        .pickupDuration(5000L)
        .deliveryDuration(10000L)
        .build();

    final ParcelDTO c = ParcelDTO.builder(new Point(3, 0), new Point(6, 7))
        .pickupTimeWindow(new TimeWindow(0, 30))
        .deliveryTimeWindow(new TimeWindow(70, 80))
        .pickupDuration(5000L)
        .deliveryDuration(10000L)
        .build();

    final ParcelDTO d = ParcelDTO.builder(new Point(3, 0), new Point(6, 2))
        .pickupTimeWindow(new TimeWindow(0, 30))
        .deliveryTimeWindow(new TimeWindow(70, 80))
        .pickupDuration(5000L)
        .deliveryDuration(10000L)
        .build();

    final ImmutableSet<ParcelDTO> availableParcels = ImmutableSet
View Full Code Here

Examples of rinde.sim.util.TimeWindow

  @Test
  public void testLoad1() {
    // distance is 1 km which is traveled in 2 minutes with 30km/h
    final ParcelDTO dto = ParcelDTO.builder(new Point(0, 0), new Point(0, 1))
        .pickupTimeWindow(new TimeWindow(0, 10))
        .deliveryTimeWindow(new TimeWindow(10, 20))
        .neededCapacity(0)
        .arrivalTime(0)
        .serviceDuration(5)
        .build();
View Full Code Here

Examples of rinde.sim.util.TimeWindow

  @Test
  public void testLoad2() {
    // distance is 10km which is travelled in 20 minutes with 30km/h
    final ParcelDTO dto = ParcelDTO.builder(new Point(0, 0), new Point(0, 10))
        .pickupTimeWindow(new TimeWindow(15, 15))
        .deliveryTimeWindow(new TimeWindow(15, 15))
        .neededCapacity(0)
        .arrivalTime(0)
        .serviceDuration(5)
        .build();
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.