GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Testing_code_mp_ped/TestSFPhases.java at main · Xutete/Testing_code_mp_ped

Expand file tree

/

TestSFPhases.java

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
122 lines (113 loc) · 6.3 KB
/

TestSFPhases.java

Copy path

File metadata and controls

122 lines (113 loc) · 6.3 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
package ped;
import util.Angle;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
public class TestSFPhases {
File sf_nodes_f;
File sf_links_f;
String controllerType;
Simulator sf_net_vehs;
Simulator sf_net_peds;
public TestSFPhases() {
String dataPath = "data/SiouxFalls/";
controllerType = "vehMP";
sf_net_vehs = new Simulator(dataPath, false, controllerType);
// sf_net_vehs = new Simulator(sf_nodes_f, sf_links_f, true, controllerType);
// sf_net.loadStaticDemand(new File("data/PQ3/trips_static_od_demand.txt"));
// sf_net.runSim(60*60, 60*60*10, Params.tolerance_time);
}
public void testVehFeasiblePhases() {
// TODO: read from conflictGroundTruth file and make sure we are consistent
System.out.println("\nTESTING : SiouxFalls FEASIBLE VEHICLE PHASES\n");
for (Intersection i : sf_net_vehs.getIntersectionSet()) {
int id = i.getId();
// System.out.println("Intersection " + id + ":");
// System.out.println("\tTurning movements: " + i.getVehicleTurningMovements());
switch (id) {
// case 1:
//// System.out.println("\tEXPECTED PHASES: []");
//// System.out.println("\tGENERATED PHASES: " + i.getFeasiblePhases());
// System.out.println("\tGENERATED PHASES: ");
// for (Phase p : i.getFeasiblePhases()) {
// System.out.println("\t\t" + p);
// }
// break;
// case 2:
//// System.out.println("\tEXPECTED PHASES: [[Turn124, Turn123]] (can also have [Turn124], [Turn123])");
// System.out.println("\tGENERATED PHASES: " + i.getFeasiblePhases());
// break;
// case 3:
//// System.out.println("\tEXPECTED PHASES: [[Turn234, Turn235]] (can also have [Turn235], [Turn234])");
// System.out.println("\tGENERATED PHASES: " + i.getFeasiblePhases());
// break;
// case 4:
//// System.out.println("\tEXPECTED PHASES: [[Turn345], [Turn245]]");
// System.out.println("\tGENERATED PHASES: " + i.getFeasiblePhases());
// break;
// case 5:
//// System.out.println("\tEXPECTED PHASES: " + "[[Turn356], [Turn456]]");
// System.out.println("\tGENERATED PHASES: " + i.getFeasiblePhases());
// break;
// case 6:
//// System.out.println("\tEXPECTED PHASES: [[Turn567]]");
// System.out.println("\tGENERATED PHASES: " + i.getFeasiblePhases());
// break;
// case 7:
//// System.out.println("\tEXPECTED PHASES: []");
// System.out.println("\tGENERATED PHASES: " + i.getFeasiblePhases());
// break;
default:
// System.out.println("\t???what is this intersection???");
// System.out.println("\tALL POSSIBLE PHASES: ");
// for (Phase p : i.getPossiblePhases()) {
// System.out.println("\t\t" + p);
// }
// System.out.println("\tGENERATED PHASES: ");
// for (Phase p : i.getFeasiblePhases()) {
// System.out.println("\t\t" + p);
// }
// System.out.println(i.getV2vConflicts());
// Set<TurningMovement> visited = new HashSet<>();
// for (TurningMovement t1: i.getV2vConflicts().keySet())
// {
// for (TurningMovement t2 : i.getV2vConflicts().get(t1).keySet())
// {
//// System.out.println("TM1: " + t1 + ", TM2: " + t2 + ", " + i.getV2vConflicts().get(t1).get(t2));
//
//// if (visited.contains(t2)) {
//// continue;
//// }
//
// String type = "";
// if (t1.getOutgoingLink().equals(t2.getOutgoingLink())) {
// type = "merge"; // conflict
//// System.out.println(type);
// assert i.getV2vConflicts().get(t1).get(t2) == 0;
// } else if (t1.getIncomingLink().equals(t2.getIncomingLink())) {
// type = "diverge"; // allowed
//// System.out.println(type);
// assert i.getV2vConflicts().get(t1).get(t2) == 1;
// } else if (t1.getOutgoingLink().getDest() == t2.getIncomingLink().getSource() && t2.getOutgoingLink().getDest() == t1.getIncomingLink().getSource()) {
// type = "complementaryLR"; // allowed
//// System.out.println(type);
//// System.out.println("TM1: " + t1 + ", TM2: " + t2 + ", " + i.getV2vConflicts().get(t1).get(t2) + ", type: " + type);
// assert i.getV2vConflicts().get(t1).get(t2) == 1;
// } else {
// System.out.println("TM1: " + t1 + ", TM2: " + t2 + ", " + i.getV2vConflicts().get(t1).get(t2));
//// System.out.println("\tTM1 incoming angle: " + Angle.bound(Math.PI*1 + t1.getIncomingLink().getAngle()) );
//// System.out.println("\tTM1 outgoing angle: " + Angle.bound(Math.PI*0 + t1.getOutgoingLink().getAngle()) );
//// System.out.println("\tTM2 incoming angle: " + Angle.bound(Math.PI*1 + t2.getIncomingLink().getAngle()) );
//// System.out.println("\tTM2 outgoing angle: " + Angle.bound(Math.PI*0 + t2.getOutgoingLink().getAngle()) );
// }
// }
// visited.add(t1);
// }
break;
}
}
}
public void testPedFeasiblePhases() {
System.out.println("TESTING FEASIBLE PHASES ON PQ3, including Pedestrians");
}
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.