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;
49 for (ActivityFacility f : facilities.getFacilities().values()) {
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()) {
58 ActivityOptionImpl a = (ActivityOptionImpl) a_it.next();
60 if (a.getCapacity() != Integer.MAX_VALUE) {
61 if (a.getType().equals(
"home")) {
62 caps[0] += a.getCapacity();
64 else if (a.getType().equals(
"work")) {
65 caps[1] += a.getCapacity();
67 else if (a.getType().equals(
"education")) {
68 caps[2] += a.getCapacity();
70 else if (a.getType().equals(
"shop")) {
71 caps[3] += a.getCapacity();
73 else if (a.getType().equals(
"leisure")) {
74 caps[4] += a.getCapacity();
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.");