Menu

Commit [r17787]  Maximize  Restore  History

() Differentiating "insertAgentIntoMobsim" (aka "arrangeNextAgentState") into 

* insertAgentIntoMobsim(agent) // initialization

and

* reInsertAgentIntoMobsim(agent) // at end of agent.endXxxAndAssumeControl()

This is in an attempt to find an incremental path to getting rid of the self-reinsertion of the agent.

---

() In PersonDriverAgentImpl.chooseNextLinkId() there was:

if (this.cachedRouteLinkIds == null) {
   this.cachedRouteLinkIds = ((NetworkRoute) this.currentLeg.getRoute()).getLinkIds();
}

This could cause an error later if the execution logic got here with a leg that was non-car.  This seems not to have happened in the past, but it may happen if one starts to modify the logic which makes agents stay at the same location, with a dummy leg in between ... currently, this dummy leg is treated as a full car departure, which does not make sense.  Modified this to 

if (this.cachedRouteLinkIds == null) {
   if ( this.currentLeg.getRoute() instanceof NetworkRoute ) {
      this.cachedRouteLinkIds = ((NetworkRoute) this.currentLeg.getRoute()).getLinkIds();
   } else {
      return null ;
   }
}

I would argue that it makes sense to return null here if there is no route.

This _should_ not change anything but there is no guarantee.

---

() So far, an agent stuck event is thrown for ALL agents in the activity list.  This is because it is assumed that agents who are done with their plan are not re-inserted into the activity list.  In view of replanning, it seems to make more sense to keep them at the final activity, with activityEndTime = infty.  Thus, only agents at an activity with an activityEndTime < infty (and, for backwards compatibility, != Time.UNDEFINED_TIME), will throw a stuck event.

This _should_ not change anything but there is no guarantee.

vsp_nagel 2011-12-15

changed /playgrounds/trunk/michalm/src/main/java/playground/michalm/dynamic/DynAgent.java
changed /playgrounds/trunk/michalm/src/main/java/playground/taxicab/TaxicabAgent.java
changed /playgrounds/trunk/mzilske/src/main/java/playground/mzilske/withinday/AdapterAgent.java
/playgrounds/trunk/michalm/src/main/java/playground/michalm/dynamic/DynAgent.java Diff Switch to side-by-side view
Loading...
/playgrounds/trunk/michalm/src/main/java/playground/taxicab/TaxicabAgent.java Diff Switch to side-by-side view
Loading...
/playgrounds/trunk/mzilske/src/main/java/playground/mzilske/withinday/AdapterAgent.java Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.