}
private void loadTrafficDensities(String filename)
throws FileNotFoundException, IOException {
try {
TrafficProperties traffic = new TrafficProperties(model);
StringTokenizer tokenizer = this.openFile(filename);
//ignore header fields
tokenizer.nextToken();
tokenizer.nextToken();
tokenizer.nextToken();
while (tokenizer.hasMoreTokens()) {
int dense12 = Integer.parseInt(tokenizer.nextToken());
int from = Integer.parseInt(tokenizer.nextToken());
int to = Integer.parseInt(tokenizer.nextToken());
for (int time = from; time < to; time++) {
traffic.putTrafficDensity(time, (byte)dense12);
}
}
model.setTrafficProperties(traffic);
}