@Override public boolean isInRange(Count<Link> count) { Link l = network.getLinks().get(count.getId()); if (l == null) { log.warn("Cannot find requested link: " + count.getId().toString()); return false; } double dist = CoordUtils.calcEuclideanDistance(l.getCoord(), centerCoord); return dist < distance; }
public void add( Count<Measurement> cnt, double lowerBound ) { Measurement mea = new Measurement( cnt.getId(), lowerBound ) ; map.put( mea.getId(), mea ) ; set.add( mea ) ; }
@Override public void startCount(final Count count, final BufferedWriter out) throws IOException { out.write("\t<count"); out.write(" loc_id=\"" + count.getId() + "\""); out.write(" cs_id=\"" + count.getCsLabel() + "\""); if (count.getCoord() != null) { final Coord coord = coordinateTransformation.transform( count.getCoord() ); out.write(" x=\"" + coord.getX() + "\""); out.write(" y=\"" + coord.getY() + "\""); } out.write(">\n"); }
/** * Creates the List with the counts vs sim values stored in the * countAttribute Attribute of this class. */ private void compare() { for (Count<Link> count : this.counts.getCounts().values()) { if (!distanceFilter.isInRange(count)) { continue; } double[] volumes = this.volumesPerLinkPerHour.getVolumesForStop(Id.create(count.getId(), TransitStopFacility.class)); if (volumes == null || volumes.length == 0) { log.warn("No volumes for count location: " + count.getId().toString()); continue; } for (int hour = 1; hour <= 24; hour++) { Volume volume = count.getVolume(hour); if (volume != null) { double countValue = volume.getValue(); double simValue=volumes[hour-1]; simValue *= this.countsScaleFactor; this.result.add(new CountSimComparisonImpl(count.getId(), count.getCsLabel(), hour, countValue, simValue)); } } } }
public void calculateComparison() { double countValue; for (Count count : this.counts.getCounts().values()) { Id stopId = count.getId(); if (!isInRange(count.getCoord())) { continue;
while (c_it.hasNext()) { Count c = c_it.next(); Assert.assertNotNull(c.getId());