From df753d104158c58d93cf0789f6295d51beec7066 Mon Sep 17 00:00:00 2001 From: "Singh, Dhirendra (Data61, Clayton)" Date: Thu, 22 Feb 2024 08:27:27 +1100 Subject: [PATCH] test: working example using new mode for MATSim agent (though BDI counterpart knows only how to evacuate by car currently) --- ees/scenarios/grid/ar-1b-mat.xml | 2 ++ ees/scenarios/grid/ar-1b-pop.xml | 2 +- .../github/agentsoz/ees/matsim/MonitorPersonsInDangerZone.java | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ees/scenarios/grid/ar-1b-mat.xml b/ees/scenarios/grid/ar-1b-mat.xml index 7f822002..2b5d21a4 100644 --- a/ees/scenarios/grid/ar-1b-mat.xml +++ b/ees/scenarios/grid/ar-1b-mat.xml @@ -52,6 +52,8 @@ + + diff --git a/ees/scenarios/grid/ar-1b-pop.xml b/ees/scenarios/grid/ar-1b-pop.xml index ade2f81c..981a1840 100644 --- a/ees/scenarios/grid/ar-1b-pop.xml +++ b/ees/scenarios/grid/ar-1b-pop.xml @@ -47,7 +47,7 @@ - + diff --git a/ees/src/main/java/io/github/agentsoz/ees/matsim/MonitorPersonsInDangerZone.java b/ees/src/main/java/io/github/agentsoz/ees/matsim/MonitorPersonsInDangerZone.java index 0756261a..0cc2f033 100644 --- a/ees/src/main/java/io/github/agentsoz/ees/matsim/MonitorPersonsInDangerZone.java +++ b/ees/src/main/java/io/github/agentsoz/ees/matsim/MonitorPersonsInDangerZone.java @@ -69,7 +69,8 @@ public void setFloodZone(Set> 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);