Skip to content

Commit

Permalink
Fix NPE, tweak DenvitPlanPreference, Add more time for getstoptimes
Browse files Browse the repository at this point in the history
  • Loading branch information
denysvitali committed Jun 11, 2018
1 parent 31280d7 commit 4ee2868
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ public PaginatedList<StopTimes> getStopTimesInBBoxBetween(BoundingBox boundingBo
.addPathSegment("in")
.addPathSegment(boundingBox.toString())
.build();
Response response = client.get(url, 20 * 1000);
Response response = client.get(url, 60 * 1000);
return getPaginatedStopTimes(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ public double destination_radius() {

@Override
public double max_waiting_time() {
return 25.0;
return Math.max(25, distance/(60*average_moving_speed));
}

@Override
public double w_walk() {
return 4 * PREF_WEIGHT;
return 40 * PREF_WEIGHT;
}

@Override
public double w_waiting() {
return 2 * PREF_WEIGHT;
return 1 * PREF_WEIGHT;
}

@Override
public double w_fast_change() {
return 6 * PREF_WEIGHT;
return 60 * PREF_WEIGHT;
}

@Override
public double w_change() {
return 5 * PREF_WEIGHT;
return 50 * PREF_WEIGHT;
}

@Override
Expand All @@ -65,12 +65,12 @@ public double w_moving() {

@Override
public double max_total_waiting_time() {
return max_waiting_time() + 10 * max_total_changes();
return max_waiting_time() + 40 * max_total_changes();
}

@Override
public int max_total_changes() {
return 6;
return Math.min(5, (int) Math.ceil(distance / 5000));
}

@Override
Expand Down
16 changes: 11 additions & 5 deletions src/main/ch/supsi/dti/i2b/shrug/optitravel/ui/MapController.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,21 @@ public void addComputedDirections(PlanSegment ps) {
e.getCoordinate().getLng())).toArray());
PolylineOptions line_opts = new PolylineOptions();

String color = ps.getTrip().getRoute().getColor();
RouteType rc = ps.getTrip().getRoute().getType();
if(rc != null) {
String color = null;
RouteType rc = null;

if(ps.getTrip().getRoute() != null) {
color = ps.getTrip().getRoute().getColor();
rc = ps.getTrip().getRoute().getType();
}

if (rc != null) {
rc = rc.getRouteCategory();
} else {
rc = RouteType.BUS_SERVICE;
}
if(color == null){
switch(rc){
if (color == null) {
switch (rc) {
case RAILWAY_SERVICE:
color = "#f44336";
break;
Expand Down

0 comments on commit 4ee2868

Please sign in to comment.