Skip to content

Commit

Permalink
jDEECoAgent update
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Kit committed Jun 16, 2014
1 parent b3e17c1 commit 04326f3
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ public JDEECoAgent(Id id, Id currentLinkId, MATSimInput input) {
*/
updateNextLink();
}

public JDEECoAgent(Id id, Id currentLinkId) {
this.id = id;
this.currentLinkId = currentLinkId;
/**
* Initialize next link id
*/
updateNextLink();
}

public void setSimulation(Netsim simulation) {
this.simulation = simulation;
Expand All @@ -53,7 +62,7 @@ public void abort(double now) {
}

public void endActivityAndComputeNextState(double now) {
if (now == input.activityEndTime) {
if (input != null && now == input.activityEndTime) {
this.simulation.getEventsManager().processEvent(
this.simulation
.getEventsManager()
Expand Down Expand Up @@ -108,6 +117,7 @@ public Id getCurrentLinkId() {

public Id getDestinationLinkId() {
// Log.i(id.toString() + " getDestination " + input.destination);
//We assume here input not being null.
return input.destination;
}

Expand Down

0 comments on commit 04326f3

Please sign in to comment.