MATSIM
CountsGEHCurveGraphCreator.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * CountsGEHCurveGraphCreator.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2007 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 
21 package org.matsim.counts.algorithms.graphs;
22 
23 import java.util.ArrayList;
24 import java.util.Iterator;
25 import java.util.List;
26 
27 import org.matsim.api.core.v01.Id;
31 
33 
34  public CountsGEHCurveGraphCreator(final String sectionTitle) {
35  super(sectionTitle);
36  }
37 
38  @Override
39  public List<CountsGraph> createGraphs(final List<CountSimComparison> ccl, final int iteration) {
40 
41  List<CountsGraph> graphList = new ArrayList<>();
42 
43  Iterator<CountSimComparison> l_it = ccl.iterator();
44  CountSimComparison cc_last = null;
45  while (l_it.hasNext()) {
46  CountsGEHCurveGraph lcg = new CountsGEHCurveGraph(ccl, iteration, "dummy");
47 
48  if (cc_last!=null) {
49  lcg.add2LoadCurveDataSets(cc_last);
50  }
51 
52  CountSimComparison cc= l_it.next();
53  Id<Link> linkId = cc.getId();
54  while (cc.getId().equals(linkId)) {
55  if (l_it.hasNext()) {
56  lcg.add2LoadCurveDataSets(cc);
57  cc= l_it.next();
58  }
59  else {
60  lcg.add2LoadCurveDataSets(cc);
61  break;
62  }
63  }
64  lcg.setChartTitle("Link " + linkId);
65  lcg.setFilename("link" + linkId);
66  lcg.setLinkId(linkId.toString());
67  lcg.createChart(0);
68  graphList.add(lcg);
69  this.section.addURL(new MyURL("link" + linkId + ".html", "link" + linkId));
70  cc_last = cc;
71  }//while
72 
73  return graphList;
74  }
75 }
void setChartTitle(final String chartTitle)
List< CountsGraph > createGraphs(final List< CountSimComparison > ccl, final int iteration)