MATSIM
PtCountsLoadCurveGraphCreator.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * PtCountsLoadCurveGraphCreator.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2010 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
24 package org.matsim.pt.counts;
25 
26 import java.util.Iterator;
27 import java.util.List;
28 import java.util.Vector;
29 
30 import org.matsim.api.core.v01.Id;
37 
39 
43  public PtCountsLoadCurveGraphCreator(String sectionTitle) {
44  super(sectionTitle);
45  }
46  @Override
47  public List<CountsGraph> createGraphs(List<CountSimComparison> ccl,
48  int iteration) {
49  List<CountsGraph> graphList=new Vector<CountsGraph>();
50 
51  Iterator<CountSimComparison> l_it = ccl.iterator();
52  CountSimComparison cc_last=null;
53  while (l_it.hasNext()) {
54  CountsLoadCurveGraph lcg=new CountsLoadCurveGraph(ccl, iteration, "dummy");
55  if (cc_last!=null) {
56  lcg.add2LoadCurveDataSets(cc_last);
57  }
58  CountSimComparison cc= l_it.next();
59  Id<Link> stopId = cc.getId();
60  while (cc.getId().equals(stopId)) {
61  if (l_it.hasNext()) {
62  lcg.add2LoadCurveDataSets(cc);
63  cc= l_it.next();
64  }
65  else {
66  lcg.add2LoadCurveDataSets(cc);
67  break;
68  }
69  }
70  lcg.setChartTitle("Stop "+stopId);
71  lcg.setFilename("stop"+stopId);
72  lcg.setLinkId(stopId.toString());
73  lcg.createChart(0);
74  graphList.add(lcg);
75  this.section.addURL(new MyURL("stop"+stopId+".html", "stop"+stopId));
76  cc_last=cc;
77  }//while
78 
79 
80  return graphList;
81  }
82 
83 }
void setChartTitle(final String chartTitle)
List< CountsGraph > createGraphs(List< CountSimComparison > ccl, int iteration)