Skip to content

Commit

Permalink
test: working example using new mode for MATSim agent (though BDI cou…
Browse files Browse the repository at this point in the history
…nterpart knows only how to evacuate by car currently)
  • Loading branch information
dhixsingh committed Feb 21, 2024
1 parent 845573e commit df753d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions ees/scenarios/grid/ar-1b-mat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
</module>

<module name="qsim">
<param name="mainMode" value="car,van"/> <!-- ensure van mode is simulated on the network -->
<param name="usePersonIdForMissingVehicleId" value="true" /> <!-- need this true until BDI agents know how to van, not just driveTo by car -->
<!-- "start/endTime" of MobSim (00:00:00 == take earliest activity time/ run as long as active vehicles exist) -->
<param name="startTime" value="00:00:00" />
<!--<param name="endTime" value="00:59:59" />-->
Expand Down
2 changes: 1 addition & 1 deletion ees/scenarios/grid/ar-1b-pop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<activity type="home" x="0000.0" y="0000.0" end_time="01:00:00" />
<leg mode="van" />
<activity type="work" x="5000.0" y="5000.0" end_time="01:10:00" />
<leg mode="van" />
<leg mode="car" />
<activity type="home" x="0000.0" y="0000.0" />
</plan>
</person>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public void setFloodZone(Set<Id<Link>> linksWithin) {

@Override
public void handleEvent(LinkEnterEvent linkEnterEvent) {
PAAgent agent = agentManager.getAgent(linkEnterEvent.getVehicleId().toString());
// Get agent for vehicle IDs of the type 'id' or 'id_mode'
PAAgent agent = agentManager.getAgent(linkEnterEvent.getVehicleId().toString().split("_")[0]);
if (agent != null) { // only do this if this is a BDI-like agent
if(linksInFireBuffer.contains(linkEnterEvent.getLinkId())) {
PerceptContent pc = new PerceptContent(Constants.FIELD_OF_VIEW, Constants.SIGHTED_FIRE);
Expand Down

0 comments on commit df753d1

Please sign in to comment.