MATSIM
CountsLoadCurveGraphCreator.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * CountsLoadCurveGraphCreator.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.Iterator;
24 import java.util.List;
25 import java.util.Vector;
26 
27 import org.matsim.api.core.v01.Id;
31 
33 
34 
35  public CountsLoadCurveGraphCreator(final String sectionTitle) {
36  super(sectionTitle);
37  }
38 
39 
40  @Override
41  public List<CountsGraph> createGraphs(final List<CountSimComparison> ccl, final int iteration) {
42 
43  List<CountsGraph> graphList=new Vector<CountsGraph>();
44 
45  Iterator<CountSimComparison> l_it = ccl.iterator();
46  CountSimComparison cc_last=null;
47  while (l_it.hasNext()) {
48  CountsLoadCurveGraph lcg=new CountsLoadCurveGraph(ccl, iteration, "dummy");
49  if (cc_last!=null) {
50  lcg.add2LoadCurveDataSets(cc_last);
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 
74  return graphList;
75  }
76 }
void setChartTitle(final String chartTitle)
List< CountsGraph > createGraphs(final List< CountSimComparison > ccl, final int iteration)