-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integration test pickup/dropoff on adjacent links
- Loading branch information
1 parent
b804742
commit 3e10d85
Showing
6 changed files
with
141 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!DOCTYPE population SYSTEM "http://www.matsim.org/files/dtd/population_v6.dtd"> | ||
|
||
<population> | ||
<attributes> | ||
<attribute name="coordinateReferenceSystem" class="java.lang.String">epsg:31256</attribute> | ||
</attributes> | ||
|
||
<!-- Exactly one driver and one rider that should match --> | ||
<!-- full subtours starting and ending at home so that SubtourModeChoice works properly --> | ||
<person id="carPerson"> | ||
<attributes> | ||
<attribute class="java.lang.String" name="carAvail">always</attribute> | ||
<attribute class="java.lang.String" name="drsAffinity">driverOnly</attribute> | ||
<attribute class="java.lang.String" name="hasLicense">yes</attribute> | ||
</attributes> | ||
<plan selected="yes"> | ||
<activity type="home" link="112" x="5826.522" y="345633.182" start_time="07:20:00" end_time="07:20:00" /> | ||
<leg mode="bike" /> | ||
<activity type="work" link="152" x="3360.657" y="344813.230" start_time="07:40:00" end_time="17:30:00" /> | ||
<leg mode="bike" /> | ||
<activity type="home" link="112" x="5826.522" y="345633.182" start_time="18:00:00" /> | ||
</plan> | ||
</person> | ||
<person id="ridePerson"> | ||
<attributes> | ||
<attribute class="java.lang.String" name="carAvail">never</attribute> | ||
<attribute class="java.lang.String" name="drsAffinity">riderOnly</attribute> | ||
<attribute class="java.lang.String" name="hasLicense">no</attribute> | ||
</attributes> | ||
<plan selected="yes"> | ||
<activity type="home" link="28" x="5991.161" y="345598.0287" end_time="07:20:00" /> | ||
<leg mode="bike" /> | ||
<activity type="work" link="1655" x="3400.587" y="344774.199" start_time="07:40:00" end_time="17:30:00" /> | ||
<leg mode="bike" /> | ||
<activity type="home" link="28" x="5991.161" y="345598.0287" start_time="18:00:00" /> | ||
</plan> | ||
</person> | ||
|
||
</population> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/at/ac/ait/matsim/drs/run/RunAdjacentMatchExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package at.ac.ait.matsim.drs.run; | ||
|
||
import org.matsim.api.core.v01.TransportMode; | ||
import org.matsim.core.config.Config; | ||
import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; | ||
|
||
/** | ||
* Minimal example demonstrating a single match found in the replanning phase | ||
* where driver and rider have start destination not on the same link but close | ||
* enough for them to match | ||
*/ | ||
public class RunAdjacentMatchExample extends RunSimpleDrsExample { | ||
|
||
public static void main(String[] args) { | ||
new RunAdjacentMatchExample().run(false, null); | ||
} | ||
|
||
@Override | ||
public void adjustConfig(Config config) { | ||
config.controller().setLastIteration(1); | ||
config.controller().setOutputDirectory("output-floridsdorf-adjacentMatch"); | ||
config.plans().setInputFile("population_drs_adjacentMatch.xml"); | ||
|
||
// configure replanning so that in iteration 1 SubtourModeChoice will be used, | ||
// and drsRider + drsDriver mode is tried out | ||
// (so that we can demonstrate the match) | ||
config.replanning().clearStrategySettings(); | ||
config.replanning() | ||
.addStrategySettings(new StrategySettings().setStrategyName("SubtourModeChoiceForDrs").setWeight(1)); | ||
|
||
DrsConfigGroup drs = (DrsConfigGroup) config.getModules().get("drs"); | ||
drs.setSubtourModeChoiceModes(new String[] { Drs.DRIVER_MODE, Drs.RIDER_MODE, TransportMode.bike }); | ||
drs.setSubtourModeChoiceChainBasedModes(new String[] { Drs.DRIVER_MODE, TransportMode.bike }); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters