Examples of TimeSpan


Examples of desmoj.core.simulator.TimeSpan

        myModel.busyVCQueue.insert(this);

        try {
          // prepare
          myModel.prepairingVCQueue.insert(this);
          hold(new TimeSpan(myModel.getPreparationTime()));
          myModel.prepairingVCQueue.remove(this);

          // service
          if (!nextTruck.hasCanceledWaiting()) {
            hold(new TimeSpan(myModel.getServiceTime()));
            // if (!nextTruck.hasCanceledWaiting()) {
            nextTruck.activate(new TimeSpan(0));
            // }
          }
        } catch (InterruptException e) {
          sendTraceNote("interrupted!");
          nextTruck.setQueuingPriority(nextTruck.getQueueingPriority() + 1);
View Full Code Here

Examples of desmoj.core.simulator.TimeSpan

    // create the TruckGeneratorEvent
    TruckGeneratorEvent truckGenerator = new TruckGeneratorEvent(this, "TruckGenerator", true);

    // schedule for start of simulation
    truckGenerator.schedule(new TimeSpan(0));
  }
View Full Code Here

Examples of desmoj.core.simulator.TimeSpan

      // create a new truck
      Truck truck = new Truck(model, "Truck", true);
      // create a new truck arrival event
      TruckArrivalEvent truckArrival = new TruckArrivalEvent(model, "TruckArrivalEvent", true);
      // and schedule it for the current point in time
      truckArrival.schedule(truck, new TimeSpan(0.0));
    }

    if (!(!produce && model.getTruckQueue().length() == 0)) {
      schedule(new TimeSpan(model.getTruckArrivalTime(), TimeUnit.MINUTES));
      // from inside to outside...
      // draw a new inter-arrival time value
      // wrap it in a TimeSpan object
      // and schedule this event for the current point in time + the
      // inter-arrival time
View Full Code Here

Examples of desmoj.core.simulator.TimeSpan

      // create a service end event
      ServiceEndEvent serviceEnd = new ServiceEndEvent(myModel, "ServiceEndEvent", true);

      // and place it on the event list
      serviceEnd.schedule(vanCarrier, truck, new TimeSpan(myModel.getServiceTime(), TimeUnit.MINUTES));

    }

  }
View Full Code Here

Examples of edu.ucla.sspace.util.TimeSpan

                "must specify a timespan duration for the semantic partition");
        }

        // Get the time span that will be used to group the documents
        String timespanStr = argOptions.getStringOption("timespan");
        TimeSpan timeSpan = new TimeSpan(timespanStr);

        if (argOptions.hasOption('v') || argOptions.hasOption("verbose")) {
            // Enable all the logging at the FINE level for the application
            Logger appRooLogger = Logger.getLogger("edu.ucla.sspace");
            Handler verboseHandler = new ConsoleHandler();
View Full Code Here

Examples of edu.ucla.sspace.util.TimeSpan

            new TreeMultiMap<Double,String>();

        // Create a second time span than is twice the duration.  We will use
        // this to check whether two partition's vectors were adjacent in the
        // slice by seeing wether the timestamps fall within this duration
        TimeSpan twoPartitions = new TimeSpan(partitionDuration.getYears() * 2,
                                              partitionDuration.getMonths() * 2,
                                              partitionDuration.getWeeks() * 2,
                                              partitionDuration.getDays() * 2,
                                              partitionDuration.getHours() * 2);
       
        // Once we have all the vectors for each word in each sspace,
        // calculate how much the vector has changed.
        for (Map.Entry<String,SortedMap<Long,double[]>> e :
                 wordToTemporalSemantics.entrySet()) {
            String word = e.getKey();
            SortedMap<Long,double[]> m = e.getValue();
           
            // Skip computing shifts for words without enough partitions
            if (m.size() < 2)
                continue;

            // Get the timestamps as a navigable map so we can identify the last
            // two keys in it more easly.
            NavigableMap<Long,double[]> timestampToVector =
                (e instanceof NavigableMap)
                ? (NavigableMap<Long,double[]>)m
                : new TreeMap<Long,double[]>(m);           

            Map.Entry<Long,double[]> mostRecent = timestampToVector.lastEntry();
            // Skip calculating the shift for words who most recent partition
            // was not the same as the most recent partition for TRI
            if (!mostRecent.getKey().equals(startOfMostRecentPartition))
                continue;
           
            Map.Entry<Long,double[]> secondMostRecent =
                timestampToVector.lowerEntry(mostRecent.getKey());
            // Skip calculating the shift for words where the two most recent
            // partitoins aren't contiguous.  Check for this using the custom
            // time span that covers two partitions
            if (!twoPartitions.insideRange(secondMostRecent.getKey(),
                                           mostRecent.getKey()))
                continue;

           
            // Compute the semantic shift of the two partitions
View Full Code Here

Examples of edu.ucla.sspace.util.TimeSpan

        String timeSpanProp =
            props.getProperty(SEMANTIC_PARTITION_DURATION_PROPERTY);

        partitionDuration = (timeSpanProp == null)
            ? DEFAULT_SEMANTIC_PARTITION_DURATION
            : new TimeSpan(timeSpanProp);
    }
View Full Code Here

Examples of info.bethard.timenorm.TimeSpan

   */
  public static Set<TemporalUnit> runTimexParser(String timex) {

    URL grammarURL = DurationEventTimeFeatureExtractor.class.getResource("/info/bethard/timenorm/en.grammar");
    TemporalExpressionParser parser = new TemporalExpressionParser(grammarURL);
    TimeSpan anchor = TimeSpan.of(2013, 12, 16);
    Try<Temporal> result = parser.parse(timex, anchor);

    Set<TemporalUnit> units = null;
    if (result.isSuccess()) {
      Temporal temporal = result.get();
View Full Code Here

Examples of io.fathom.auto.TimeSpan

        }
    }

    @Override
    public Lock buildLock() {
        TimeSpan lockTimeout = TimeSpan.minutes(10);
        TimeSpan lockPollInterval = TimeSpan.seconds(5);

        OpenstackPseudoLock lock = new OpenstackPseudoLock(this, lockTimeout, lockPollInterval);
        return lock;
    }
View Full Code Here

Examples of org.apache.uima.internal.util.TimeSpan

          XMLSerializer xmlSerializer = new XMLSerializer(outStream);
          XCASSerializer xcasSerializer = new XCASSerializer(MainFrame.this.cas.getTypeSystem());
          xcasSerializer.serialize(MainFrame.this.cas, xmlSerializer.getContentHandler());
          outStream.close();
          time = System.currentTimeMillis() - time;
          System.out.println("Time taken: " + new TimeSpan(time));
        } catch (IOException e) {
          handleException(e);
        } catch (SAXException e) {
          handleException(e);
        }
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.