All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.conveyal.gtfs.stats.model.PatternStatistic Maven / Gradle / Ivy

Go to download

A library to load and index GTFS feeds of arbitrary size using disk-backed storage

There is a newer version: 6.2.0
Show newest version
package com.conveyal.gtfs.stats.model;

import com.conveyal.gtfs.stats.PatternStats;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalTime;

/**
 * Created by landon on 10/11/16.
 */
public class PatternStatistic implements Serializable {

    public String pattern_id;
    public int headway;
    public Double avgSpeed;
    public long tripCount;
    public double stopSpacing;
//    public Double avgSpeedOffPeak;
//    private LocalDate calendarServiceEnd;
//    private LocalDate calendarStartDate;
//    private LocalDate calendarEndDate;
//    private Rectangle2D bounds;

    public PatternStatistic (PatternStats stats, String pattern_id, LocalDate date, LocalTime from, LocalTime to) {
        this.pattern_id = pattern_id;
        headway = stats.getHeadwayForPattern(this.pattern_id, date, from, to);
        avgSpeed = stats.getPatternSpeed(this.pattern_id, date, from, to);
        tripCount = stats.getTripCountForDate(this.pattern_id, date);
        stopSpacing = stats.getAverageStopSpacing(this.pattern_id);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy