21 package org.matsim.facilities.algorithms;
23 import java.util.Iterator;
37 System.out.println(
" running " + this.getClass().getName() +
" algorithm...");
42 double min_coordX = Double.POSITIVE_INFINITY;
43 double min_coordY = Double.POSITIVE_INFINITY;
44 double max_coordX = Double.NEGATIVE_INFINITY;
45 double max_coordY = Double.NEGATIVE_INFINITY;
47 int caps[] = {0 , 0, 0, 0, 0};
48 int unlimit_cap_cnt = 0;
51 if (f.getCoord().getX() > max_coordX) { max_coordX=f.getCoord().getX(); }
52 if (f.getCoord().getY() > max_coordY) { max_coordY=f.getCoord().getY(); }
53 if (f.getCoord().getX() < min_coordX) { min_coordX=f.getCoord().getX(); }
54 if (f.getCoord().getY() < min_coordY) { min_coordY=f.getCoord().getY(); }
56 Iterator<? extends ActivityOption> a_it = f.getActivityOptions().values().iterator();
57 while (a_it.hasNext()) {
61 if (a.
getType().equals(
"home")) {
64 else if (a.
getType().equals(
"work")) {
67 else if (a.
getType().equals(
"education")) {
70 else if (a.
getType().equals(
"shop")) {
73 else if (a.
getType().equals(
"leisure")) {
78 " in run(Facilities facilities):" +
79 " do not know type = " + a.
getType());
87 System.out.println(
" Number of Facilities: " + f_cnt);
88 System.out.println(
" Number of Activities: " + act_cnt);
89 System.out.println(
" Min Coord: " + min_coordX +
" " + min_coordY );
90 System.out.println(
" Max Coord: " + max_coordX +
" " + max_coordY ) ;
91 System.out.println(
" total home cap: " + caps[0]);
92 System.out.println(
" total work cap: " + caps[1]);
93 System.out.println(
" total education cap: " + caps[2]);
94 System.out.println(
" total shop cap: " + caps[3]);
95 System.out.println(
" total leisure cap: " + caps[4]);
96 System.out.println(
" total acts with unlimited cap: " + unlimit_cap_cnt);
98 System.out.println(
" done.");
Map< Id< ActivityFacility >, ? extends ActivityFacility > getFacilities()
final double getCapacity()
void run(ActivityFacilities facilities)