Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 845573e

Browse files
committedFeb 20, 2024·
test: try new travel mode
1 parent fdf479d commit 845573e

File tree

6 files changed

+459
-145
lines changed

6 files changed

+459
-145
lines changed
 

‎ees/scenarios/grid/ar-1b-ees-fire.xml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--===========================================================================
4+
#%L
5+
BDI-ABM Integration Package
6+
%%
7+
Copyright (C) 2014 - 2016 by its authors. See AUTHORS file.
8+
%%
9+
This program is free software: you can redistribute it and/or modify
10+
it under the terms of the GNU Lesser General Public License as
11+
published by the Free Software Foundation, either version 3 of the
12+
License, or (at your option) any later version.
13+
14+
This program is distributed in the hope that it will be useful,
15+
but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
GNU General Lesser Public License for more details.
18+
19+
You should have received a copy of the GNU General Lesser Public
20+
License along with this program. If not, see
21+
<http://www.gnu.org/licenses/lgpl-3.0.html>.
22+
#L%
23+
============================================================================-->
24+
25+
<simulation
26+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
27+
xmlns="https://github.com/agentsoz/bdi-abm-integration"
28+
xsi:schemaLocation="https://github.com/agentsoz/bdi-abm-integration ../xsd/ees.xsd"
29+
version="v2.0">
30+
31+
<!-- global configuration sent to all models -->
32+
<global>
33+
<!-- random seed to be used for all models; set to -1 if not used -->
34+
<opt id="randomSeed">12345</opt>
35+
<!-- coordinate reference system in EPSG format to be used for all models; see http://spatialreference.org -->
36+
<opt id="crs">EPSG:28355</opt>
37+
<!-- simulation start time in HH:MM format -->
38+
<opt id="startHHMM">00:01</opt>
39+
</global>
40+
41+
<!-- model specific configuration -->
42+
<models>
43+
44+
<model id="bdi">
45+
<!-- Jill BDI engine configuration arguments; DO NOT CHANGE IF UNSURE -->
46+
<opt id="jPlanSelectionPolicy">FIRST</opt>
47+
<opt id="jAgents"></opt>
48+
<opt id="jLogLevel">WARN</opt>
49+
<opt id="jLogFile">test/output/io/github/agentsoz/ees/agents/archetype/ArchetypeAgentFireTestNewMode/test/archetype.log</opt>
50+
<opt id="jOutFile">test/output/io/github/agentsoz/ees/agents/archetype/ArchetypeAgentFireTestNewMode/test/archetype.out</opt>
51+
<!--<opt id="jNumThreads">1</opt>-->
52+
<!-- Output file for evacuation metrics -->
53+
<opt id="bdiMetricsFile">test/output/io/github/agentsoz/ees/agents/archetype/ArchetypeAgentFireTestNewMode/test/archetype.metrics.json</opt>
54+
<!-- Time bin size in seconds for collected evacuation metrics -->
55+
<opt id="bdiMetricsFrequencyInSeconds">600</opt>
56+
</model>
57+
58+
<model id="matsim">
59+
<!-- MATSim output directory relative to examples/bushfire directory (will overrule the setting in MATSim config) -->
60+
<opt id="outputDir">test/output/io/github/agentsoz/ees/agents/archetype/ArchetypeAgentFireTestNewMode/test/matsim</opt>
61+
<!-- MATSim XML config XML file relative to examples/bushfire directory -->
62+
<opt id="configXml">scenarios/grid/ar-1b-mat.xml</opt>
63+
<!-- Maximum distance at which the fire can be seen (in metres)-->
64+
<opt id="maxDistanceForFireVisual">1000</opt>
65+
<!-- Maximum distance at which smoke can be seen (in metres)-->
66+
<opt id="maxDistanceForSmokeVisual">0</opt>
67+
<!-- Fire avoidance buffer used for planning routes for regular vehicles (in metres)-->
68+
<opt id="fireAvoidanceBufferForVehicles">2000</opt>
69+
<!-- Fire avoidance buffer used for planning routes for emergency vehicles (in metres)-->
70+
<opt id="fireAvoidanceBufferForEmergencyVehicles">1000</opt>
71+
<!-- Congestion parameters used by vehicles to decide if they are stuck in congestion. See issues
72+
https://github.com/agentsoz/bdi-abm-integration/issues/8 and
73+
https://github.com/agentsoz/bdi-abm-integration/issues/35 -->
74+
<opt id="congestionEvaluationInterval">180</opt>
75+
<opt id="congestionToleranceThreshold">0.33</opt>
76+
<opt id="congestionReactionProbability">0.0</opt> <!-- disable congestion replanning -->
77+
</model>
78+
79+
<model id="phoenix">
80+
<!-- Phoenix start time in HH:MM format; used to calculate absolute values for hour_spot and hour_burnt -->
81+
<opt id="ignitionHHMM">01:00</opt>
82+
<!-- Phoenix grid GeoJSON file -->
83+
<opt id="gridGeoJson">scenarios/grid/gridfire.json</opt>
84+
<!-- Phoenix grid square size (in meteres) -->
85+
<opt id="gridSquareSideInMetres">180</opt>
86+
</model>
87+
88+
</models>
89+
90+
</simulation>

‎ees/scenarios/grid/ar-1b-mat.xml

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
#%L
4+
BDI-ABM Integration Package
5+
%%
6+
Copyright (C) 2014 - 2015 by its authors. See AUTHORS file.
7+
%%
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU Lesser General Public License as
10+
published by the Free Software Foundation, either version 3 of the
11+
License, or (at your option) any later version.
12+
13+
This program is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Lesser Public License for more details.
17+
18+
You should have received a copy of the GNU General Lesser Public
19+
License along with this program. If not, see
20+
<http://www.gnu.org/licenses/lgpl-3.0.html>.
21+
#L%
22+
-->
23+
24+
<!DOCTYPE config SYSTEM "http://www.matsim.org/files/dtd/config_v2.dtd">
25+
<config>
26+
27+
<module name="global">
28+
<param name="randomSeed" value="482564" />
29+
<param name="coordinateSystem" value="Atlantis" />
30+
</module>
31+
32+
<module name="network">
33+
<param name="inputNetworkFile" value="gridworld.xml" />
34+
<param name= "timeVariantNetwork" value= "false" />
35+
<!--<param name= "inputChangeEventsFile" value= "scenario_matsim_network_change_events.xml.gz" />-->
36+
</module>
37+
38+
<module name="plans">
39+
<param name="inputPlansFile" value="ar-1b-pop.xml" />
40+
</module>
41+
42+
<module name="controler">
43+
<param name="outputDirectory" value="output" />
44+
<param name="firstIteration" value="0" />
45+
<param name="lastIteration" value="0" />
46+
<param name="mobsim" value="qsim" />
47+
<param name = "snapshotFormat" value="googleearth"/> <!-- enable KML output; also must enable snapshotperiod -->
48+
</module>
49+
50+
<module name="controler">
51+
<param name= "routingAlgorithmType" value="FastAStarLandmarks" />
52+
</module>
53+
54+
<module name="qsim">
55+
<!-- "start/endTime" of MobSim (00:00:00 == take earliest activity time/ run as long as active vehicles exist) -->
56+
<param name="startTime" value="00:00:00" />
57+
<!--<param name="endTime" value="00:59:59" />-->
58+
59+
<param name = "snapshotperiod" value = "00:00:00"/> <!-- 00:00:00 means NO snapshot writing, 00:00:30 means every 30 secs -->
60+
61+
<param name= "flowCapacityFactor" value= "1.0" />
62+
<param name= "storageCapacityFactor" value= "1.0" />
63+
64+
</module>
65+
66+
<module name="planCalcScore">
67+
<param name="learningRate" value="1.0" />
68+
<param name="BrainExpBeta" value="2.0" />
69+
70+
<parameterset type="scoringParameters">
71+
<param name="lateArrival" value="-18" />
72+
<param name="earlyDeparture" value="-0" />
73+
<param name="performing" value="+6" />
74+
<param name="waiting" value="-0" />
75+
76+
<parameterset type="modeParams">
77+
<param name="mode" value="car"/>
78+
<param name="marginalUtilityOfTraveling_util_hr" value="-6.0" />
79+
</parameterset>
80+
<parameterset type="modeParams">
81+
<param name="mode" value="pt"/>
82+
</parameterset>
83+
84+
<parameterset type="activityParams">
85+
<param name="activityType" value="home" /> <!-- home -->
86+
<param name="priority" value="1" />
87+
<param name="typicalDuration" value="12:00:00" />
88+
<param name="minimalDuration" value="08:00:00" />
89+
</parameterset>
90+
<parameterset type="activityParams">
91+
<param name="activityType" value="work" /> <!-- work -->
92+
<param name="priority" value="1" />
93+
<param name="typicalDuration" value="08:00:00" />
94+
<param name="minimalDuration" value="06:00:00" />
95+
<param name="openingTime" value="07:00:00" />
96+
<param name="latestStartTime" value="09:00:00" />
97+
<param name="earliestEndTime" value="" />
98+
<param name="closingTime" value="18:00:00" />
99+
</parameterset>
100+
</parameterset>
101+
</module>
102+
103+
<module name="strategy">
104+
<param name="maxAgentPlanMemorySize" value="5" /> <!-- 0 means unlimited -->
105+
106+
<parameterset type="strategysettings">
107+
<param name="strategyName" value="BestScore"/>
108+
<param name="weight" value="0.9"/>
109+
</parameterset>
110+
111+
<parameterset type="strategysettings">
112+
<param name="strategyName" value="ReRoute"/>
113+
<param name="weight" value="0.1"/>
114+
</parameterset>
115+
</module>
116+
117+
</config>

‎ees/scenarios/grid/ar-1b-pop.xml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE population SYSTEM "http://www.matsim.org/files/dtd/population_v6.dtd">
3+
4+
<population>
5+
6+
<person id="0">
7+
<attributes>
8+
<attribute name="Age" class="java.lang.String" >80</attribute>
9+
<attribute name="AgentId" class="java.lang.String" >202021028P223</attribute>
10+
<attribute name="Archetype" class="java.lang.String" >Considered.Evacuator</attribute>
11+
<attribute name="Archetypes.Age" class="java.lang.String" >75 years +</attribute>
12+
<attribute name="Archetypes.Household" class="java.lang.String" >Couple without dependents living at home</attribute>
13+
<attribute name="BDIAgentType" class="java.lang.String" >io.github.agentsoz.ees.agents.archetype.ArchetypeAgent</attribute>
14+
<attribute name="EZI_ADD" class="java.lang.String" >17 BUCKLEY STREET HARCOURT 3453</attribute>
15+
<attribute name="EvacLocationPreference" class="java.lang.String" >FarFarAway,5000.0,0000.0</attribute>
16+
<attribute name="Gender" class="java.lang.String" >Male</attribute>
17+
<attribute name="Geographical.Coordinate" class="java.lang.String" >[144.2623, -36.9993]</attribute>
18+
<attribute name="HasDependents" class="java.lang.String" >false</attribute>
19+
<attribute name="HasDependentsAtLocation" class="java.lang.String" ></attribute>
20+
<attribute name="HouseholdId" class="java.lang.String" >202021028H1439</attribute>
21+
<attribute name="Id" class="java.lang.String" >3186</attribute>
22+
<attribute name="ImpactFromFireDangerIndexRating" class="java.lang.String" >0.1</attribute>
23+
<attribute name="ImpactFromImmersionInSmoke" class="java.lang.String" >0.4</attribute>
24+
<attribute name="ImpactFromMessageAdvice" class="java.lang.String" >0.4</attribute>
25+
<attribute name="ImpactFromMessageEmergencyWarning" class="java.lang.String" >0.6</attribute>
26+
<attribute name="ImpactFromMessageEvacuateNow" class="java.lang.String" >0.7</attribute>
27+
<attribute name="ImpactFromMessageRespondersAttending" class="java.lang.String" >0.2</attribute>
28+
<attribute name="ImpactFromMessageWatchAndAct" class="java.lang.String" >0.5</attribute>
29+
<attribute name="ImpactFromSocialMessage" class="java.lang.String" >0.5</attribute>
30+
<attribute name="ImpactFromVisibleEmbers" class="java.lang.String" >0.5</attribute>
31+
<attribute name="ImpactFromVisibleFire" class="java.lang.String" >0.6</attribute>
32+
<attribute name="ImpactFromVisibleResponders" class="java.lang.String" >0.4</attribute>
33+
<attribute name="ImpactFromVisibleSmoke" class="java.lang.String" >0.3</attribute>
34+
<attribute name="InvacLocationPreference" class="java.lang.String" >NotSoFarAway,2500.0,2500.0</attribute>
35+
<attribute name="LagTimeInMinsForFinalResponse" class="java.lang.String" >5.89</attribute>
36+
<attribute name="LagTimeInMinsForInitialResponse" class="java.lang.String" >17.89</attribute>
37+
<attribute name="PrimaryFamilyType" class="java.lang.String" >COUPLE_ONLY</attribute>
38+
<attribute name="ResponseThresholdFinal" class="java.lang.String" >0.38</attribute>
39+
<attribute name="ResponseThresholdInitial" class="java.lang.String" >-0.02</attribute>
40+
<attribute name="SA1_7DIGCODE" class="java.lang.String" >2102819</attribute>
41+
<attribute name="SA2_MAINCODE" class="java.lang.String" >202021028</attribute>
42+
<attribute name="WillGoHomeAfterVisitingDependents" class="java.lang.String" >false</attribute>
43+
<attribute name="WillGoHomeBeforeLeaving" class="java.lang.String" >false</attribute>
44+
<attribute name="WillStay" class="java.lang.String" >false</attribute>
45+
</attributes>
46+
<plan selected="yes">
47+
<activity type="home" x="0000.0" y="0000.0" end_time="01:00:00" />
48+
<leg mode="van" />
49+
<activity type="work" x="5000.0" y="5000.0" end_time="01:10:00" />
50+
<leg mode="van" />
51+
<activity type="home" x="0000.0" y="0000.0" />
52+
</plan>
53+
</person>
54+
55+
</population>

‎ees/scenarios/grid/gridworld.xml

+144-144
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
package io.github.agentsoz.ees.agents.archetype;
3+
4+
/*-
5+
* #%L
6+
* Emergency Evacuation Simulator
7+
* %%
8+
* Copyright (C) 2014 - 2024 by its authors. See AUTHORS file.
9+
* %%
10+
* This program is free software: you can redistribute it and/or modify
11+
* it under the terms of the GNU Lesser General Public License as
12+
* published by the Free Software Foundation, either version 3 of the
13+
* License, or (at your option) any later version.
14+
*
15+
* This program is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+
* GNU General Lesser Public License for more details.
19+
*
20+
* You should have received a copy of the GNU General Lesser Public
21+
* License along with this program. If not, see
22+
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
23+
* #L%
24+
*/
25+
26+
import io.github.agentsoz.ees.Run;
27+
import org.junit.Rule;
28+
import org.junit.Test;
29+
import org.matsim.testcases.MatsimTestUtils;
30+
import org.slf4j.Logger;
31+
import org.slf4j.LoggerFactory;
32+
33+
/**
34+
* @author dsingh
35+
*
36+
*/
37+
public class ArchetypeAgentFireTestNewMode {
38+
39+
// have tests in separate classes so that they run, at least under maven, in separate JVMs. kai, nov'17
40+
41+
private static final Logger log = LoggerFactory.getLogger(ArchetypeAgentFireTestNewMode.class);
42+
43+
@Rule
44+
public MatsimTestUtils matsimUtils = new MatsimTestUtils();
45+
46+
@Test
47+
public void test() {
48+
matsimUtils.getOutputDirectory(); // creates a clean one so need to call this first
49+
Run.main(new String[] {"--config", "scenarios/grid/ar-1b-ees-fire.xml"});
50+
}
51+
}
52+

0 commit comments

Comments
 (0)
Please sign in to comment.