本文整理汇总了Java中com.thales.ntis.subscriber.datex.TravelTimeData类的典型用法代码示例。如果您正苦于以下问题:Java TravelTimeData类的具体用法?Java TravelTimeData怎么用?Java TravelTimeData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TravelTimeData类属于com.thales.ntis.subscriber.datex包,在下文中一共展示了TravelTimeData类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractTrafficDataFromElaboratedData
import com.thales.ntis.subscriber.datex.TravelTimeData; //导入依赖的package包/类
private void extractTrafficDataFromElaboratedData(ElaboratedData dataItem) {
// Location is always specified as LocationByReference (referenced to a
// single Network Link)
LocationByReference location = (LocationByReference) dataItem.getBasicData().getPertinentLocation();
LOG.info("Data for Network Link: " + location.getPredefinedLocationReference().getId());
BasicData basicData = dataItem.getBasicData();
// Determine what class (type) of traffic data is contained in the basic
// data
if (TrafficSpeed.class.equals(basicData.getClass())) {
TrafficSpeed speed = (TrafficSpeed) basicData;
LOG.info("Average Speed: " + speed.getAverageVehicleSpeed().getSpeed());
} else if (TravelTimeData.class.equals(basicData.getClass())) {
TravelTimeData travelTimeData = (TravelTimeData) basicData;
LOG.info("Travel Time: " + travelTimeData.getTravelTime().getDuration());
LOG.info("Free Flow Travel Time: " + travelTimeData.getFreeFlowTravelTime().getDuration());
LOG.info("Normally Expected Travel Time: " + travelTimeData.getNormallyExpectedTravelTime().getDuration());
} else if (TrafficFlow.class.equals(basicData.getClass())) {
TrafficFlow flow = (TrafficFlow) basicData;
LOG.info("Traffic Flow: " + flow.getVehicleFlow().getVehicleFlowRate());
} else if (TrafficConcentration.class.equals(basicData.getClass())) {
TrafficConcentration concentration = (TrafficConcentration) basicData;
LOG.info("Occupancy (%age): " + concentration.getOccupancy().getPercentage());
} else if (TrafficHeadway.class.equals(basicData.getClass())) {
TrafficHeadway headway = (TrafficHeadway) basicData;
LOG.info("Headway: " + headway.getAverageTimeHeadway().getDuration());
} else {
LOG.error("Unexpected traffic data type contained in publication: " + dataItem.getClass().getSimpleName());
}
}
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:38,代码来源:FusedSensorOnlyTrafficDataServiceImpl.java
示例2: extractTravelTimesFromSiteMeasurements
import com.thales.ntis.subscriber.datex.TravelTimeData; //导入依赖的package包/类
private void extractTravelTimesFromSiteMeasurements(SiteMeasurements siteMeasurements) {
String anprRouteId = siteMeasurements.getMeasurementSiteReference().getId();
// Should only be one travel time value per SiteMeasurements
// element (index=0)
MeasuredValue value = siteMeasurements.getMeasuredValue().get(0).getMeasuredValue();
if (TravelTimeData.class.equals(value.getBasicData().getClass()))
{
TravelTimeData ttData = (TravelTimeData) value.getBasicData();
LOG.info("Travel Time for ANPR Route " + anprRouteId + " : " + ttData.getTravelTime().getDuration() + "s");
}
}
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:12,代码来源:ANPRTrafficDataServiceImpl.java
示例3: extractTrafficDataFromElaboratedData
import com.thales.ntis.subscriber.datex.TravelTimeData; //导入依赖的package包/类
private void extractTrafficDataFromElaboratedData(ElaboratedData dataItem) {
// Location is always specified as LocationByReference (referenced to a
// single Network Link)
LocationByReference location = (LocationByReference) dataItem.getBasicData().getPertinentLocation();
LOG.info("Data for Network Link: " + location.getPredefinedLocationReference().getId());
BasicData basicData = dataItem.getBasicData();
// Determine what class (type) of traffic data is contained in the basic data
if (TrafficSpeed.class.equals(basicData.getClass())) {
TrafficSpeed speed = (TrafficSpeed)basicData;
// There are 2 types of speed data - current and forecast, determined by
// whether a measurementOrCalculationTime element exists in the data item.
if(speed.getMeasurementOrCalculationTime() == null) {
LOG.info("Fused Average Speed: " + speed.getAverageVehicleSpeed().getSpeed());
LOG.info("FVD-Only Average Speed: " + speed.getTrafficSpeedExtension().getSpeedFvdOnly().getSpeed());
} else {
LOG.info("Fused Average Speed (forecast for " + speed.getMeasurementOrCalculationTime().toString() + "): "
+ speed.getAverageVehicleSpeed().getSpeed());
}
} else if (TravelTimeData.class.equals(basicData.getClass())) {
TravelTimeData travelTimeData = (TravelTimeData)basicData;
// There are 2 types of travel time data - current and forecast,
// determined by whether a measurementOrCalculationTime element
// exists in the data item.
if (travelTimeData.getMeasurementOrCalculationTime() == null) {
LOG.info("Travel Time: " + travelTimeData.getTravelTime().getDuration());
LOG.info("Free Flow Travel Time: " + travelTimeData.getFreeFlowTravelTime().getDuration());
LOG.info("Normally Expected Travel Time: " + travelTimeData.getNormallyExpectedTravelTime().getDuration());
} else {
LOG.info("Travel Time (forecast for " + travelTimeData.getMeasurementOrCalculationTime().toString() + "): "
+ travelTimeData.getTravelTime().getDuration());
}
} else {
LOG.error("Unexpected traffic data type contained in publication: " + dataItem.getClass().getSimpleName());
}
}
开发者ID:ntisservices,项目名称:ntis-java-web-services-Release3.2,代码行数:43,代码来源:FusedFvdAndSensorTrafficDataServiceImpl.java