Skip to content

Commit

Permalink
jDEECoAgent fix - simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Kit committed Sep 28, 2014
1 parent a727809 commit fd3f16a
Showing 1 changed file with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cz.cuni.mff.d3s.deeco.simulation.matsim;

import java.util.LinkedList;
import java.util.List;

import org.matsim.api.core.v01.Id;
Expand Down Expand Up @@ -98,20 +99,7 @@ public void setRoute(List<Id> route) {
if (index < 0) {
this.route = route;
} else {
boolean isPartOf = true;
int nextIndex;
for (Id lId: this.route) {
nextIndex = route.indexOf(lId);
if (index + 1 == nextIndex) {
index = nextIndex;
} else {
isPartOf = false;
break;
}
}
if (!isPartOf) {
this.route = route;
}
this.route = new LinkedList<Id>(route.subList(index + 1, route.size()));
}
}

Expand Down

0 comments on commit fd3f16a

Please sign in to comment.