├── .editorconfig ├── .github ├── dependabot.yml └── workflows │ └── verify-push.yaml ├── .gitignore ├── LICENSE ├── README.md ├── docs ├── figure-matsim-dvrp.jpg └── header_big.png ├── drt.md ├── pom.xml ├── scenarios ├── README.md ├── cottbus │ ├── cb-drtplans.xml.gz │ ├── cb-drtplans_test.xml.gz │ ├── cb-taxiplans.xml.gz │ ├── drtconfig_door2door.xml │ ├── drtconfig_stopbased.xml │ ├── drtstops.xml │ ├── drtvehicles.xml │ ├── network.xml.gz │ ├── robotaxi_config.xml │ ├── taxis_2000.xml │ └── taxis_5000.xml └── mielec_2014_02 │ ├── mielec_drt_config.xml │ ├── mielec_taxi_config_assignment.xml │ ├── mielec_taxi_config_rulebased.xml │ ├── network.xml │ ├── plans_only_drt_1.0.xml.gz │ ├── plans_only_drt_1.5.xml.gz │ ├── plans_only_drt_2.0.xml.gz │ ├── plans_only_drt_2.5.xml.gz │ ├── plans_only_drt_3.0.xml.gz │ ├── plans_only_drt_3.5.xml.gz │ ├── plans_only_drt_4.0.xml.gz │ ├── plans_only_taxi_1.0.xml.gz │ ├── plans_only_taxi_1.5.xml.gz │ ├── plans_only_taxi_2.0.xml.gz │ ├── plans_only_taxi_2.5.xml.gz │ ├── plans_only_taxi_3.0.xml.gz │ ├── plans_only_taxi_3.5.xml.gz │ ├── plans_only_taxi_4.0.xml.gz │ ├── taxis-25.xml │ ├── taxis-50.xml │ ├── vehicles-10-cap-4.xml │ └── vehicles-20-cap-2.xml └── src ├── main └── java │ └── org │ └── matsim │ └── maas │ ├── RunMaas.java │ ├── RunMaasGui.java │ ├── drt │ ├── RunDoorToDoorDrtExample.java │ └── RunStopBasedDrtExample.java │ ├── taxi │ ├── RunRobotaxiExample.java │ └── RunTaxiExample.java │ └── utils │ └── CreateFleetVehicles.java └── test └── java └── org └── matsim └── maas ├── drt ├── RunDoorToDoorDrtExampleTest.java └── RunStopBasedDrtExampleTest.java └── taxi ├── RunRobotaxiExampleTest.java └── TaxiTest.java /.editorconfig: -------------------------------------------------------------------------------- 1 | 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | end_of_line = lf 7 | 8 | 9 | [*.java] 10 | indent_style = tab 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | max_line_length = 150 14 | 15 | 16 | [*.{xml, xsd, dtd}] 17 | max_line_length = off 18 | indent_style = tab 19 | trim_trailing_whitespace = true 20 | insert_final_newline = true 21 | indent_size = 4 22 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "maven" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | groups: 8 | java-dependencies: 9 | patterns: 10 | - "*" 11 | -------------------------------------------------------------------------------- /.github/workflows/verify-push.yaml: -------------------------------------------------------------------------------- 1 | name: verify-push 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | jobs: 8 | build: 9 | 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout git repo 14 | uses: actions/checkout@v3 15 | 16 | - name: Setup Java 17 | uses: actions/setup-java@v3 18 | with: 19 | java-version: 21 20 | distribution: 'zulu' 21 | cache: 'maven' 22 | 23 | - name: Maven verify 24 | run: mvn verify --batch-mode -Dmaven.test.redirectTestOutputToFile -Dmatsim.preferLocalDtds=true --fail-at-end 25 | 26 | env: 27 | MAVEN_OPTS: -Xmx2g 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | 3 | # Mobile Tools for Java (J2ME) 4 | .mtj.tmp/ 5 | 6 | # Package Files # 7 | #*.jar //we decided to upload the jar with dependecies for teaching puporses, tschlenther may '20 8 | *.war 9 | *.ear 10 | 11 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 12 | hs_err_pid* 13 | /.settings/ 14 | /.project 15 | /.classpath 16 | /target/ 17 | /output/ 18 | /bin/ 19 | 20 | /.idea/ 21 | *.iml 22 | /matsim-maas-master-SNAPSHOT.jar 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![100,000 robo-taxis driving in Berlin (10% sample)](docs/header_big.png "100,000 robo-taxis driving in Berlin (10% sample)") 2 | 3 | # MATSim – Mobility as a Service 4 | [![Build Status](https://travis-ci.org/matsim-org/matsim-maas.svg?branch=master)](https://travis-ci.org/matsim-org/matsim-maas) 5 | 6 | This project contains a collection of examples to simulate Mobility as a Service (MaaS) and Mobility on Demand (MoD) in MATSim. All services may be simulated with a driver or using Autonomous Vehicles (AVs). The basic framework for these services are the [Dynamic Vehicle Routing Problem (DVRP)](https://github.com/matsim-org/matsim/tree/master/contribs/dvrp), [Autonomous Vehicles](https://github.com/matsim-org/matsim/tree/master/contribs/av), [Taxi](https://github.com/matsim-org/matsim/tree/master/contribs/taxi) and [Demand Responsive Transport (DRT)](https://github.com/matsim-org/matsim/tree/master/contribs/drt) extensions. This means, vehicles will be dispatched on-line while the MATSim Mobility Simulation is running. 7 | 8 | ![Integration of DVRP into MATSim](docs/figure-matsim-dvrp.jpg "Integration of DVRP into MATSim") 9 | 10 | The main goal of the code in this repository is to provide examples of different usage scenarios for MaaS / AV services and make them easy to access in one single place, while the actual optimizer code remains in the MATSim contributions. All the examples run on the current MATSim Snapshot, as there are continuous improvement to the functionality. 11 | 12 | ## Functionality 13 | 14 | The following extensions might be of particular interest: 15 | 16 | ### Taxi 17 | The centralized dispatched of Taxi services may be simulated using different algorithms, which may be set in the Config file. An overview of different Taxi dispatch strategies and their performance is provided in: 18 | 19 | *M. Maciejewski; J. Bischoff, & K. Nagel* **An Assignment-Based Approach to Efficient Real-Time City-Scale Taxi Dispatching**, IEEE Intelligent Systems, 2016, 31, 68-77 [Available here](http://svn.vsp.tu-berlin.de/repos/public-svn/publications/vspwp/2016/16-12/) 20 | 21 | 22 | ### Robotaxi / Shared Autonomous Vehicles 23 | 24 | Shared Autonomous Vehicles provide the capability to simulate large fleets of automated taxi vehicles. This is done by combining a fast, rule-based dispatch algorithm with the possibility to adjust the consumed road capacity of Autonomous Vehicles. 25 | 26 | The algorithm and results are presented in 27 | *J. Bischoff, M. Maciejewski* **Simulation of city-wide replacement of private cars with autonomous taxis in Berlin**, Procedia Computer Science, 2016, 83, https://doi.org/10.1016/j.procs.2016.04.121 28 | 29 | The effects of different road capacity use are described in 30 | *M. Maciejewski, J. Bischoff* **Congestion Effects of Autonomous Taxi Fleets**; Transport, 2017, 0, 1-10, [Full text available here](http://dx.doi.org/10.14279/depositonce-7693) 31 | 32 | ### Demand Responsive Transport (DRT) 33 | 34 | Demand Responsive Transport allows the pooling of several passengers into a single vehicle. Several constraints, such as maximum travel times and maximum waiting times, can be taken into account when organizing the vehicle dispatch. 35 | Please find a full documentation [here](drt.md). 36 | 37 | ### Autonomous Vehicles 38 | 39 | All MaaS extensions may be simulated with and without drivers. Arguably, the biggest influence of AV operations are road capacity and pricing. 40 | * Road capacity can be influenced using the *AVCapacityModule* 41 | * Pricing of MaaS modes can be influenced using Standard MATSim scoring parameters. 42 | 43 | ## Common infrastructure 44 | 45 | With DVRP being the common base to all the modules described here, there is some common infrastructure all of the MaaS modules share: 46 | * The *DVRP config* group. In this, both the Leg mode of an agent using MaaS can be defined (such as "taxi") as well as the network mode vehicles are using (such as "car"). Furthermore, the on-line Travel Time Calculator can be adapted, if required. 47 | * The *Vehicles Container*. This is a file containing information about the fleet used by any MaaS extension. Fleet vehicle files can be created using the *CreateFleetVehicles* script. 48 | 49 | ## Test scenarios 50 | 51 | The [scenarios](scenarios/) folder contains several test scenarios. These are roughly derived from existing MATSim scenarios, but often depict only the excerpt with relevance to MaaS of the scenario. 52 | 53 | ## How to use 54 | 55 | 1) Check out this project using your favorite git client or just download as a zip. As for the latter, you can download: 56 | - the [development version](https://github.com/matsim-org/matsim-maas/archive/master.zip), which is running using the latest MATSim development snapshot 57 | - one of the [releases](https://github.com/matsim-org/matsim-maas/releases), which is running using the official MATSim releases 58 | Using the latest is release will give you relatively stable results, whereas using the master will provide more features, though some of them not thoroughly tested. 59 | 60 | 2) Import the folder as a new Maven project to Eclipse (Import --> Maven --> Existing project) or intelliJ (New --> Module from existing sources --> Select the folder --> Maven) 61 | 62 | 3) Run the example classes and start editing them according to your taste. You can also run `RunMaasGui` to launch a simple GUI application for running MaaS simulations. 63 | -------------------------------------------------------------------------------- /docs/figure-matsim-dvrp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/docs/figure-matsim-dvrp.jpg -------------------------------------------------------------------------------- /docs/header_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/docs/header_big.png -------------------------------------------------------------------------------- /drt.md: -------------------------------------------------------------------------------- 1 | # Demand Responsive Transport (DRT) 2 | 3 | The **Demand Responsive Transport** module allows the simulation of pooled (or shared) rides in MATSim. 4 | In the simulation scenario, there may be one or several *DRT operators*, each of them having its own characteristics, such as the vehicle fleet, detour or scoring paramters. 5 | 6 | ## Algorithm 7 | 8 | The vehicle dispatch algorithm is based on an insertion heuristic, where for each new incoming request all feasible insertion points are assessed and the best one (for a given objective function) is chosen. The feasibility of insertion is checked against the following constraints: vehicle capacity, vehicle availability (time window), maximum wait time and travel time (for both the new request and all other uncompleted requests). By default, if no feasible insertion exists, the request gets rejected, although this behavour can be changed (see "Configuration"). 9 | 10 | A more detailed description of the algorithms can be found in 11 | *J. Bischoff, M. Maciejewski, K. Nagel* **City-wide Shared Taxis: A Simulation Study in Berlin**, IEEE ITSC 2017, DOI: [10.1109/ITSC.2017.8317926](https://doi.org/10.1109/ITSC.2017.8317926), [Full text available here](http://dx.doi.org/10.14279/depositonce-7734). 12 | 13 | ## Configuration 14 | Based on a standard MATSim config file, DRT requires at least two additional config groups: One general DVRP and one for DRT. For an example config file, see [scenarios/cottbus/drtconfig_door2door.xml]. 15 | 16 | The DRT configuration should look roughly like that: 17 | 18 | ```xml 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | ``` 54 | 55 | The function of the parameters is as follows: 56 | 57 | **mode** - The mode associated with the config parameterset. Add one parameterset into the _multiModeDrt_ module per operator. 58 | 59 | **vehiclesFile** - A file containing the fleet specifications. To get an idea how to create your own fleet file, see the _CreateFleetVehicles.java_ script. 60 | 61 | **operationalScheme** - DRT can either be used in three different operation modes: 62 | - _door2door_ for a service serving passengers from door-to-door 63 | - _serviceAreaBased_ for a door2door service that runs only within a certain area. The area must be defined in a shape file, which must be provided using the **drtServiceAreaShapeFile** parameter. 64 | - _stopbased_ Provides a stop-based DRT services, where passengers need to walk to the first access stop and from the last egress stop. The stops need to be defined in the MATSim transit schedule format and the file needs to specified using the 65 | **transitStopFile** parameter. 66 | 67 | **changeStartLinkToLastLinkInSchedule** - If enabled, at the beginning of a new iteration, vehicles are kept where they were last parked in the previous iteration. Otherwise, they are positioned at their start link according to the vehicles file again. 68 | 69 | 70 | The following parameters directly influence the pooling algorithms, which includes a simple linear function that determines the maximum allowable traveltime. The full equation is: 71 | maxTravelTime = maxTravelTimeAlpha \* estimated_drt_travel_time + maxTravelTimeBeta. 72 | 73 | **maxTravelTimeAlpha** - A factor, usually something >1. 74 | 75 | **maxTravelTimeBeta** - an additional offset in seconds. Keep in mind that maxTravelTime **includes** waiting times. Therefore, **maxTravelTimeBeta** >= **maxWaitTime** needs to be set. 76 | 77 | **maxWaitTime** - Maximum desirable waiting time for a vehicle to arrive. 78 | 79 | **rejectRequestIfMaxWaitOrTravelTimeViolated** - If true, the max travel and wait times of a submitted request, are considered hard constraints (the request gets rejected if one of the constraints is violated). If false, the max travel and wait times are considered soft constraints (insertion of a request that violates one of the constraints is allowed, but its cost is increased by additional penalty to make it relatively less attractive). Penalisation of insertions can be customised by injecting a customized InsertionCostCalculator.PenaltyCalculator. 80 | 81 | **stopDuration** - Determines the length of a stop to pick up or drop off passengers. 82 | 83 | **writeDetailedCustomerStats** - DRT writes several statistics per iteration. Disable if you do not need this to speed up the simulation. 84 | 85 | **Vehicle rebalancing** 86 | Rebalancing idle vehicles is crucial in order to increase the overall efficiency of the system. In DRT, a Minimum Cost Flow Rebalancing strategy is already included that takes into account the demand structure of the previous iteration in order to rebalance vehicles. More info in [this paper](https://www.sciencedirect.com/science/article/pii/S1877050920306220). 87 | 88 | **interval** - \[s\] the interval in between re-balancing vehicles in seconds. 89 | 90 | **cellSize** - \[m\] the demand per iteration is aggregated over cells. Use a bigger cell size for scenarios with large network extents. 91 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 4.0.0 5 | matsim-maas 6 | jar 7 | master-SNAPSHOT 8 | 9 | 10 | org.matsim 11 | matsim-all 12 | 16.0-2024w15 13 | 14 | 15 | 16 | MATSim MaaS simulation 17 | A toolkit for using MATSim to simulate Mobility as a Service (MaaS) 18 | 19 | 20 | 21 | matsim 22 | https://repo.matsim.org/repository/matsim 23 | 24 | 25 | 26 | 27 | 28 | org.matsim 29 | matsim 30 | ${project.parent.version} 31 | 32 | 33 | 35 | 36 | org.matsim.contrib 37 | otfvis 38 | ${project.parent.version} 39 | 40 | 41 | org.matsim.contrib 42 | taxi 43 | ${project.parent.version} 44 | 45 | 46 | org.matsim.contrib 47 | av 48 | ${project.parent.version} 49 | 50 | 51 | org.matsim.contrib 52 | drt 53 | ${project.parent.version} 54 | 55 | 56 | org.matsim.contrib 57 | dvrp 58 | ${project.parent.version} 59 | 60 | 61 | 62 | 63 | org.junit.jupiter 64 | junit-jupiter-engine 65 | 66 | 67 | org.junit.jupiter 68 | junit-jupiter 69 | 70 | 71 | org.matsim 72 | matsim 73 | ${project.parent.version} 74 | test-jar 75 | test 76 | 77 | 78 | 79 | 80 | 81 | 82 | org.apache.maven.plugins 83 | maven-shade-plugin 84 | 3.6.0 85 | 86 | 87 | package 88 | 89 | shade 90 | 91 | 92 | true 93 | shaded 94 | false 95 | ${project.basedir}/${project.build.finalName}.jar 96 | 97 | 98 | 99 | org.matsim.maas.RunMaasGui 100 | org.matsim 101 | org.matsim 102 | ${project.version} 103 | true 104 | 105 | 106 | 107 | 108 | 109 | 110 | *:* 111 | 112 | 113 | META-INF/*.SF 114 | META-INF/*.DSA 115 | META-INF/*.RSA 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /scenarios/README.md: -------------------------------------------------------------------------------- 1 | # Scenarios 2 | 3 | This folder contains scenarios to get started with taxi, DRT and AV modules. 4 | The scenarios included here are: 5 | 6 | ## Mielec 2014 7 | A scenario roughly depicting the Polish city of Mielec. The scenario does not aim to re-semble reality, but is a good starting point for simple MaaS experiments. 8 | Example configs for both taxi and DRT are provided. 9 | 10 | ## Cottbus 11 | This is an excerpt of the existing MATSim Cottbus scenario, depicting only inner-city traffic. 12 | The scenario is described in [VSP-WP 11-12](https://svn.vsp.tu-berlin.de/repos/public-svn/publications/vspwp/2011/11-12/). 13 | Example configs for both DRT and robotaxi are provided. -------------------------------------------------------------------------------- /scenarios/cottbus/cb-drtplans.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/cottbus/cb-drtplans.xml.gz -------------------------------------------------------------------------------- /scenarios/cottbus/cb-drtplans_test.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/cottbus/cb-drtplans_test.xml.gz -------------------------------------------------------------------------------- /scenarios/cottbus/cb-taxiplans.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/cottbus/cb-taxiplans.xml.gz -------------------------------------------------------------------------------- /scenarios/cottbus/drtconfig_door2door.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /scenarios/cottbus/drtconfig_stopbased.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /scenarios/cottbus/drtstops.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | -------------------------------------------------------------------------------- /scenarios/cottbus/drtvehicles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | -------------------------------------------------------------------------------- /scenarios/cottbus/network.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/cottbus/network.xml.gz -------------------------------------------------------------------------------- /scenarios/cottbus/robotaxi_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/mielec_drt_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/mielec_taxi_config_assignment.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/mielec_taxi_config_rulebased.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_drt_1.0.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_drt_1.0.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_drt_1.5.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_drt_1.5.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_drt_2.0.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_drt_2.0.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_drt_2.5.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_drt_2.5.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_drt_3.0.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_drt_3.0.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_drt_3.5.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_drt_3.5.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_drt_4.0.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_drt_4.0.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_taxi_1.0.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_taxi_1.0.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_taxi_1.5.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_taxi_1.5.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_taxi_2.0.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_taxi_2.0.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_taxi_2.5.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_taxi_2.5.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_taxi_3.0.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_taxi_3.0.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_taxi_3.5.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_taxi_3.5.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/plans_only_taxi_4.0.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/matsim-org/matsim-maas/14c10cd87d83857aa0681ba19f6056ac32689816/scenarios/mielec_2014_02/plans_only_taxi_4.0.xml.gz -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/taxis-25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/taxis-50.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/vehicles-10-cap-4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /scenarios/mielec_2014_02/vehicles-20-cap-2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/org/matsim/maas/RunMaas.java: -------------------------------------------------------------------------------- 1 | /* 2 | * *********************************************************************** * 3 | * project: org.matsim.* 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2019 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** * 19 | */ 20 | 21 | package org.matsim.maas; 22 | 23 | import org.matsim.api.core.v01.Scenario; 24 | import org.matsim.contrib.drt.run.DrtControlerCreator; 25 | import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; 26 | import org.matsim.contrib.drt.run.MultiModeDrtModule; 27 | import org.matsim.contrib.dvrp.run.DvrpConfigGroup; 28 | import org.matsim.contrib.dvrp.run.DvrpModule; 29 | import org.matsim.contrib.dvrp.run.DvrpQSimComponents; 30 | import org.matsim.contrib.otfvis.OTFVisLiveModule; 31 | import org.matsim.contrib.taxi.run.MultiModeTaxiConfigGroup; 32 | import org.matsim.contrib.taxi.run.MultiModeTaxiModule; 33 | import org.matsim.core.config.Config; 34 | import org.matsim.core.config.ConfigUtils; 35 | import org.matsim.core.controler.Controler; 36 | import org.matsim.core.controler.OutputDirectoryHierarchy; 37 | import org.matsim.core.scenario.ScenarioUtils; 38 | import org.matsim.vis.otfvis.OTFVisConfigGroup; 39 | 40 | /** 41 | * @author Michal Maciejewski (michalm) 42 | */ 43 | public class RunMaas { 44 | public static void main(String[] args) { 45 | run(args[0], false); 46 | } 47 | 48 | public static void run(String configFile, boolean otfvis) { 49 | Config config = ConfigUtils.loadConfig(configFile, new MultiModeDrtConfigGroup(), new MultiModeTaxiConfigGroup(), new DvrpConfigGroup(), 50 | new OTFVisConfigGroup()); 51 | Scenario scenario = DrtControlerCreator.createScenarioWithDrtRouteFactory(config); 52 | ScenarioUtils.loadScenario(scenario); 53 | config.controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.overwriteExistingFiles); 54 | Controler controler = new Controler(scenario); 55 | controler.addOverridingModule(new MultiModeDrtModule()); 56 | controler.addOverridingModule(new MultiModeTaxiModule()); 57 | 58 | controler.addOverridingModule(new DvrpModule()); 59 | controler.configureQSimComponents( 60 | DvrpQSimComponents.activateAllModes(MultiModeTaxiConfigGroup.get(config), MultiModeDrtConfigGroup.get(config))); 61 | 62 | if (otfvis) { 63 | controler.addOverridingModule(new OTFVisLiveModule()); 64 | } 65 | 66 | controler.run(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/org/matsim/maas/RunMaasGui.java: -------------------------------------------------------------------------------- 1 | /* 2 | * *********************************************************************** * 3 | * project: org.matsim.* 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2020 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** * 19 | */ 20 | 21 | package org.matsim.maas; 22 | 23 | import org.matsim.run.gui.Gui; 24 | 25 | /** 26 | * @author Michal Maciejewski (michalm) 27 | */ 28 | public class RunMaasGui { 29 | public static void main(String[] args) { 30 | Gui.show("MATSim MaaS Simulation", RunMaas.class); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/matsim/maas/drt/RunDoorToDoorDrtExample.java: -------------------------------------------------------------------------------- 1 | /* *********************************************************************** * 2 | * project: org.matsim.* 3 | * * 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2017 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** */ 19 | 20 | package org.matsim.maas.drt; 21 | 22 | import org.matsim.contrib.drt.run.DrtControlerCreator; 23 | import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; 24 | import org.matsim.contrib.dvrp.run.DvrpConfigGroup; 25 | import org.matsim.core.config.Config; 26 | import org.matsim.core.config.ConfigUtils; 27 | import org.matsim.core.controler.Controler; 28 | import org.matsim.vis.otfvis.OTFVisConfigGroup; 29 | 30 | /** 31 | * @author jbischoff 32 | * An example to run the demand responsive transport contribution in MATSim, with DRT service 33 | * serving customers from door to door between origin and destinations. 34 | * There are two different examples, one for Mielec and one for the Cottbus scenario. 35 | * You'll find the corresponding scenarios in the "scenario" folder of the project. 36 | */ 37 | public class RunDoorToDoorDrtExample { 38 | 39 | private static final String COTTBUS_DOOR2DOOR_CONFIG = "scenarios/cottbus/drtconfig_door2door.xml"; 40 | 41 | @SuppressWarnings("unused") 42 | private static final String MIELEC_CONFIG = "scenarios/mielec_2014_02/mielec_drt_config.xml"; 43 | 44 | public static void run(Config config, boolean otfvis) { 45 | //Creates a MATSim Controler and preloads all DRT related packages 46 | Controler controler = DrtControlerCreator.createControler(config, otfvis); 47 | 48 | //starts the simulation 49 | controler.run(); 50 | } 51 | 52 | public static void main(String[] args) { 53 | Config config = ConfigUtils.loadConfig(COTTBUS_DOOR2DOOR_CONFIG, new MultiModeDrtConfigGroup(), 54 | new DvrpConfigGroup(), new OTFVisConfigGroup()); 55 | run(config, false); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/org/matsim/maas/drt/RunStopBasedDrtExample.java: -------------------------------------------------------------------------------- 1 | /* *********************************************************************** * 2 | * project: org.matsim.* 3 | * * 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2017 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** */ 19 | 20 | package org.matsim.maas.drt; 21 | 22 | import org.matsim.contrib.drt.run.DrtControlerCreator; 23 | import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup; 24 | import org.matsim.contrib.dvrp.run.DvrpConfigGroup; 25 | import org.matsim.core.config.Config; 26 | import org.matsim.core.config.ConfigUtils; 27 | import org.matsim.core.controler.Controler; 28 | import org.matsim.vis.otfvis.OTFVisConfigGroup; 29 | 30 | /** 31 | * @author jbischoff 32 | * An example to run the demand responsive transport contribution in MATSim, with DRT service 33 | * serving customers in between stops. 34 | * The stops are defined using the Transit Schedule file format. 35 | * You'll find the scenario in the "scenario" folder of the project. 36 | */ 37 | public class RunStopBasedDrtExample { 38 | 39 | public static void run(Config config, boolean otfvis) { 40 | //Creates a MATSim Controler and preloads all DRT related packages 41 | Controler controler = DrtControlerCreator.createControler(config, otfvis); 42 | 43 | //starts the simulation 44 | controler.run(); 45 | } 46 | 47 | public static void main(String[] args) { 48 | Config config = ConfigUtils.loadConfig("scenarios/cottbus/drtconfig_stopbased.xml", 49 | new MultiModeDrtConfigGroup(), new DvrpConfigGroup(), new OTFVisConfigGroup()); 50 | run(config, false); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/matsim/maas/taxi/RunRobotaxiExample.java: -------------------------------------------------------------------------------- 1 | /* *********************************************************************** * 2 | * project: org.matsim.* 3 | * * 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2016 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** */ 19 | 20 | package org.matsim.maas.taxi; 21 | 22 | import org.matsim.contrib.dvrp.run.DvrpConfigGroup; 23 | import org.matsim.contrib.taxi.run.MultiModeTaxiConfigGroup; 24 | import org.matsim.contrib.taxi.run.TaxiControlerCreator; 25 | import org.matsim.core.config.Config; 26 | import org.matsim.core.config.ConfigUtils; 27 | import org.matsim.vis.otfvis.OTFVisConfigGroup; 28 | 29 | /** 30 | * This class runs an example robotaxi scenario including fares. The simulation runs for 10 iterations, this takes 31 | * quite a bit time (25 minutes or so). You may switch on OTFVis visualisation in the main method below. The scenario 32 | * should run out of the box without any additional files. If required, you may find all input files in the resource 33 | * path or in the jar maven has downloaded). There are two vehicle files: 2000 vehicles and 5000, which may be set in 34 | * the config. Different fleet sizes can be created using 35 | * {@link org.matsim.contrib.av.robotaxi.vehicles.CreateTaxiVehicles} 36 | */ 37 | public class RunRobotaxiExample { 38 | public static final String CONFIG_FILE = "scenarios/cottbus/robotaxi_config.xml"; 39 | 40 | public static void main(String[] args) { 41 | RunRobotaxiExample.run(CONFIG_FILE, false, 10); 42 | } 43 | 44 | public static void run(String configFile, boolean otfvis, int lastIteration) { 45 | Config config = ConfigUtils.loadConfig(configFile, new DvrpConfigGroup(), new OTFVisConfigGroup(), 46 | new MultiModeTaxiConfigGroup()); 47 | config.controller().setLastIteration(lastIteration); 48 | 49 | TaxiControlerCreator.createControler(config, otfvis).run(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/matsim/maas/taxi/RunTaxiExample.java: -------------------------------------------------------------------------------- 1 | /* *********************************************************************** * 2 | * project: org.matsim.* 3 | * * 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2016 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** */ 19 | 20 | package org.matsim.maas.taxi; 21 | 22 | import org.matsim.contrib.dvrp.run.DvrpConfigGroup; 23 | import org.matsim.contrib.taxi.run.MultiModeTaxiConfigGroup; 24 | import org.matsim.contrib.taxi.run.TaxiControlerCreator; 25 | import org.matsim.core.config.Config; 26 | import org.matsim.core.config.ConfigUtils; 27 | import org.matsim.vis.otfvis.OTFVisConfigGroup; 28 | 29 | /** 30 | * An example class to Run a taxi scenario based on a config file. 31 | * Note that several different optimizers may be set directly within the config file. 32 | * Two examples are provided here: A rulebased and an assignment based dispatch algorithm. 33 | */ 34 | 35 | public class RunTaxiExample { 36 | public static final String CONFIG_FILE_RULEBASED = "scenarios/mielec_2014_02/mielec_taxi_config_rulebased.xml"; 37 | public static final String CONFIG_FILE_ASSIGNMENT = "scenarios/mielec_2014_02/mielec_taxi_config_assignment.xml"; 38 | 39 | public static void run(String configFile, boolean otfvis, int lastIteration) { 40 | // load config 41 | Config config = ConfigUtils.loadConfig(configFile, new MultiModeTaxiConfigGroup(), new DvrpConfigGroup(), 42 | new OTFVisConfigGroup()); 43 | config.controller().setLastIteration(lastIteration); 44 | 45 | TaxiControlerCreator.createControler(config, otfvis).run(); 46 | } 47 | 48 | public static void main(String[] args) { 49 | //RunTaxiExample.run(CONFIG_FILE_RULEBASED,false, 0); // switch to 'true' to turn on visualisation 50 | RunTaxiExample.run(CONFIG_FILE_ASSIGNMENT, false, 0); // switch to 'true' to turn on visualisation 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/matsim/maas/utils/CreateFleetVehicles.java: -------------------------------------------------------------------------------- 1 | /* *********************************************************************** * 2 | * project: org.matsim.* 3 | * * 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2016 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** */ 19 | 20 | package org.matsim.maas.utils; 21 | 22 | import org.matsim.api.core.v01.Id; 23 | import org.matsim.api.core.v01.Scenario; 24 | import org.matsim.api.core.v01.TransportMode; 25 | import org.matsim.contrib.dvrp.fleet.DvrpVehicle; 26 | import org.matsim.contrib.dvrp.fleet.DvrpVehicleSpecification; 27 | import org.matsim.contrib.dvrp.fleet.FleetWriter; 28 | import org.matsim.contrib.dvrp.fleet.ImmutableDvrpVehicleSpecification; 29 | import org.matsim.core.config.ConfigUtils; 30 | import org.matsim.core.gbl.MatsimRandom; 31 | import org.matsim.core.network.io.MatsimNetworkReader; 32 | import org.matsim.core.scenario.ScenarioUtils; 33 | 34 | import java.nio.file.Path; 35 | import java.nio.file.Paths; 36 | import java.util.Random; 37 | import java.util.stream.Stream; 38 | 39 | /** 40 | * @author jbischoff 41 | * This is an example script to create a vehicle file for taxis, SAV or DRTs. 42 | * The vehicles are distributed randomly in the network. 43 | */ 44 | public class CreateFleetVehicles { 45 | 46 | /** 47 | * Adjust these variables and paths to your need. 48 | */ 49 | 50 | private static final int numberOfVehicles = 1500; 51 | private static final int seatsPerVehicle = 6; //this is important for DRT, value is not used by taxi 52 | private static final double operationStartTime = 0; 53 | private static final double operationEndTime = 24 * 60 * 60; //24h 54 | private static final Random random = MatsimRandom.getRandom(); 55 | 56 | private static final Path networkFile = Paths.get("scenarios/cottbus/network.xml.gz"); 57 | private static final Path outputFile = Paths.get("fleetVehicles.xml"); 58 | 59 | public static void main(String[] args) { 60 | 61 | new CreateFleetVehicles().run(); 62 | } 63 | 64 | private void run() { 65 | 66 | Scenario scenario = ScenarioUtils.createScenario(ConfigUtils.createConfig()); 67 | new MatsimNetworkReader(scenario.getNetwork()).readFile(networkFile.toString()); 68 | final int[] i = {0}; 69 | Stream vehicleSpecificationStream = scenario.getNetwork().getLinks().entrySet().stream() 70 | .filter(entry -> entry.getValue().getAllowedModes().contains(TransportMode.car)) // drt can only start on links with Transport mode 'car' 71 | .sorted((e1, e2) -> (random.nextInt(2) - 1)) // shuffle links 72 | .limit(numberOfVehicles) // select the first *numberOfVehicles* links 73 | .map(entry -> ImmutableDvrpVehicleSpecification.newBuilder() 74 | .id(Id.create("drt_" + i[0]++, DvrpVehicle.class)) 75 | .startLinkId(entry.getKey()) 76 | .capacity(seatsPerVehicle) 77 | .serviceBeginTime(operationStartTime) 78 | .serviceEndTime(operationEndTime) 79 | .build()); 80 | 81 | new FleetWriter(vehicleSpecificationStream).write(outputFile.toString()); 82 | } 83 | 84 | } 85 | -------------------------------------------------------------------------------- /src/test/java/org/matsim/maas/drt/RunDoorToDoorDrtExampleTest.java: -------------------------------------------------------------------------------- 1 | /* *********************************************************************** * 2 | * project: org.matsim.* 3 | * * 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2016 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** */ 19 | 20 | package org.matsim.maas.drt;/* 21 | * created by jbischoff, 06.09.2018 22 | */ 23 | 24 | import org.junit.jupiter.api.Test; 25 | 26 | public class RunDoorToDoorDrtExampleTest { 27 | 28 | @Test 29 | public void testDrtDoorToDoor() { 30 | RunDoorToDoorDrtExample.main(new String[]{""}); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/matsim/maas/drt/RunStopBasedDrtExampleTest.java: -------------------------------------------------------------------------------- 1 | /* *********************************************************************** * 2 | * project: org.matsim.* 3 | * * 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2016 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** */ 19 | 20 | package org.matsim.maas.drt;/* 21 | * created by jbischoff, 06.09.2018 22 | */ 23 | 24 | import org.junit.jupiter.api.Test; 25 | 26 | public class RunStopBasedDrtExampleTest { 27 | 28 | @Test 29 | public void testDrtStopBased() { 30 | RunStopBasedDrtExample.main(new String[] { "" }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/org/matsim/maas/taxi/RunRobotaxiExampleTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * *********************************************************************** * 3 | * project: org.matsim.* 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2021 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** * 19 | */ 20 | 21 | package org.matsim.maas.taxi; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | /** 26 | * @author Michal Maciejewski (michalm) 27 | */ 28 | public class RunRobotaxiExampleTest { 29 | @Test 30 | public void runTaxiScenario() { 31 | RunRobotaxiExample.run(RunRobotaxiExample.CONFIG_FILE, false, 0); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/org/matsim/maas/taxi/TaxiTest.java: -------------------------------------------------------------------------------- 1 | /* *********************************************************************** * 2 | * project: org.matsim.* 3 | * * 4 | * *********************************************************************** * 5 | * * 6 | * copyright : (C) 2016 by the members listed in the COPYING, * 7 | * LICENSE and WARRANTY file. * 8 | * email : info at matsim dot org * 9 | * * 10 | * *********************************************************************** * 11 | * * 12 | * This program is free software; you can redistribute it and/or modify * 13 | * it under the terms of the GNU General Public License as published by * 14 | * the Free Software Foundation; either version 2 of the License, or * 15 | * (at your option) any later version. * 16 | * See also COPYING, LICENSE and WARRANTY file * 17 | * * 18 | * *********************************************************************** */ 19 | 20 | package org.matsim.maas.taxi;/* 21 | * created by jbischoff, 06.09.2018 22 | */ 23 | 24 | import org.junit.jupiter.api.Test; 25 | 26 | public class TaxiTest { 27 | 28 | 29 | @Test 30 | public void runRulebasedTaxiScenario() { 31 | RunTaxiExample.run(RunTaxiExample.CONFIG_FILE_RULEBASED, false, 0); 32 | } 33 | 34 | 35 | @Test 36 | public void runAssignmentTaxiScenario() { 37 | RunTaxiExample.run(RunTaxiExample.CONFIG_FILE_ASSIGNMENT, false, 0); 38 | } 39 | } 40 | --------------------------------------------------------------------------------