Skip to content

Commit b7012d5

Browse files
committed
Reduced min distance between waypoint.
Increased min distance between exit and entry waypoint. List of waypoints is now shuffled within waypointComponent. Experience may vary. Random element removed from flightplan generation itself, so aircraft with same entry-exit pair will all have same flightplan.
1 parent 611a5f0 commit b7012d5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ini-atc/src/seprini/controllers/components/FlightPlanComponent.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ArrayList<Waypoint> generate() {
3131
// Initialisation of parameters required by flightPlanWaypointGenerator.
3232
ArrayList<Waypoint> flightPlan = new ArrayList<Waypoint>();
3333
Waypoint entryWaypoint = setStartpoint();
34-
Waypoint lastWaypoint = setEndpoint(entryWaypoint, 500);
34+
Waypoint lastWaypoint = setEndpoint(entryWaypoint, 600);
3535
// entryWaypoint immediately added to aircrafts flightPlan.
3636
flightPlan.add(entryWaypoint);
3737

@@ -71,7 +71,7 @@ private ArrayList<Waypoint> flightPlanWaypointGenerator(
7171
// Call selectNextWaypoint.
7272
Waypoint nextWaypoint = selectNextWaypoint(currentWaypoint,
7373
lastWaypoint, flightPlan, normalVectorFromCurrentToLast,
74-
waypointSelectionList, 50, 300);
74+
waypointSelectionList, 30, 100);
7575
// Recurse with updated flightPlan and nextWaypoint.
7676
return flightPlanWaypointGenerator(flightPlan, nextWaypoint,
7777
lastWaypoint);
@@ -99,8 +99,6 @@ private static Waypoint selectNextWaypoint(Waypoint currentWaypoint,
9999
int minDistance) {
100100
Waypoint nextWaypoint = null;
101101

102-
Collections.shuffle(waypointSelectionList, new Random());
103-
104102
for (Waypoint waypoint : waypointSelectionList) {
105103
// Find normal vector from current item in waypointSelectionList to
106104
// lastWaypoint.

ini-atc/src/seprini/controllers/components/WaypointComponent.java

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package seprini.controllers.components;
22

33
import java.util.ArrayList;
4+
import java.util.Collections;
5+
import java.util.Random;
46

57
import seprini.controllers.AircraftController;
68
import seprini.controllers.SidebarController;
@@ -35,11 +37,13 @@ public WaypointComponent(AircraftController controller,
3537
createEntrypoint(0, 0);
3638
createEntrypoint(0, 720);
3739
createEntrypoint(1080, 360);
40+
createEntrypoint(540, 0);
3841

3942
// add exit waypoints to exitList
4043
createExitpoint(1080, 720);
4144
createExitpoint(1080, 0);
4245
createExitpoint(0, 420);
46+
createExitpoint(540, 720);
4347

4448
// add some waypoints
4549
createWaypoint(300, 200, true);
@@ -51,6 +55,8 @@ public WaypointComponent(AircraftController controller,
5155
createWaypoint(700, 500, true);
5256
createWaypoint(450, 100, true);
5357
createWaypoint(540, 360, true);
58+
59+
Collections.shuffle(permanentList, new Random());
5460
}
5561

5662
/**

0 commit comments

Comments
 (0)