Home

MATSim User Guide - TU Berlin

image

Contents

1. 27 footy Men God ee Bee eh ar be Be ee 28 be RSE he dee 29 6 5 Interpretation of the logarithmic utility of performing 30 66 OUtlOGk e ecm 22 a ee ee a a ae 31 33 o A O Rs a 33 T2 Selectors o s c e a aoa a a A a Gs 34 7 2 1 BestScore Status works 2 0 2 0 020202 eee ee es 34 7 2 2 ChangeExpBeta Status works RECOMMENDED 34 caia a a oR de a 34 see A ne AAG pee ar 34 7 2 0 SelectRandom Status works 2 2222 2 non 0 2 0 0 00000004 34 7 3 Innovative Modules 2 2 2 2 2 Co nn nn ee 35 pak Bs ee Sod Ea Bowes 35 7 3 2 TimeAllocationMutator Status works 2 35 Sos Ge Eo Gs eres ne eae ees GE 5 35 a Se He ee as ge Be ON oe ee Ben 36 stint art ann eR 37 8 MATSim input data MATSim containers 38 8 1 counts Status works for vsp and ivt 22 2 2 En on nn 38 8 2 facilities Status user version work in progressl 2 2 22 39 8 3 households Status probably ready but nowhere used 40 8 4 network Status ok 22222 Coon nn 40 8 5 network time dependent Status works for vspl 2 22 222 00 40 8 6 vehicles Status probably reads the file correctly but does nothing else 41 9 Synthetic realities aka mobsims A2 Contents Contents 9 1 qsim Status works 2 42 9 1 1 qsim parallel version Status looks promising 43 9 1 2
2. Possible future developments Once it has been made explicit that plans generation means choice set generation the terminology may be made standard 3 2 Choice set generation Time mutation re route inno vation As said above the set of MATSim plans can be seen as this agent s choice set MATSim generates new plans on the fly i e while the simulation is running We sometimes call this innovation since agents create new plans add entries to the choice set rather than choosing between existing plans 3 3 Choice set generation choice replanning In MATSim there is no strict separation between choice set generation and choice at the replanning step for each agent a replanning strategy is randomly choosen This strategy may consist in selecting a random plan to use to generate a new plan by mutation choice set generation part or just to select a past plan based on the experienced score choice part 11 3 Terminology 3 4 Convergence learning rate 3 4 Convergence learning rate Scores in matsim are computed as SCOr new 1 0 SCOTEold SCOT Esim where scoresim is the score that is obtained from the execution of the plans network loading 3 5 Mu logit model scaling factor beta brain MATSim scoring function BrainExpBeta 5 BiTi i Typical logit model formulation py Piri As is well known u or are not inde
3. 0 can be calibrated e Utl function extends in meaningful way to negative durations this would fix the arbitrary handling that we currently employ In my view a polynomial of second degree would be worth trying P 2 As usual there are several ways to set this up One way is to expand around the typical duration U teyp U teyp U tiup ex U ttyp 2 or U x U teyp teyp U tiup a teyp U teyp 2 with ttyp typical duration U tiyp marg utl at typ dur U ttp curvature at typ dur priority and U t_x base value of act which could be something like 8 t yp Another way having the parabola going through 0 0 would be U x ax x c ax ace U x 2ax ac prio U x 0 ac i e c prio a B U x tiyp 2attyp prio i e a prio B 2tiyp 31 6 The MATSim default scoring function utility function 6 6 Outlook There is other work e g by Joh that should be looked at 32 Chapter T Strategy Modules Author s of this document Kai Nagel Strategies describe how agent plans are modified and are thus an important part of MATSim s evolutionary optimization algorithm 7 1 Introduction Strategy Modules can be configured in the configuration file via the following syntax lt module name strategy gt lt param name ModuleProbability_1 value 0 1 gt
4. Will keep the selected plan selected This may be necessary since every person will have to undergo plans selection 7 2 4 SelectExpBeta Status works Multinomial logit model choice between plans The scores S are taken as utilities the betaBrain parameter from the config file is taken as the scale parameter As equation E exp Sprain Si a gt EXP Bprnin Sj l 7 2 5 SelectRandom Status works Pure plan selecting i e non innovative strategy module Will select a random plan 34 7 Strategy Modules 7 3 Innovative modules 7 3 Innovative modules Sec 7 2 was about strategy modules which would just select between plans This section is about innovative modules which modify plans Note that innovative modules first copy a plan and then modify it i e they increase the choice set Pure selectors do not do this 7 3 1 ReRoute Status nearly indispensable Maintainer s Marcel Rieser Thibaut Dubernet All routes of a plan are recomputed The module is called by inserting the following lines into the strategy module lt module name strategy gt lt param name ModuleProbability_XXX value 0 1 gt lt param name Module_XXX value ReRoute gt Sodus The corresponding configuration module unfortunately has a different name lt module name planscalcroute gt lt param name beelineDistanceFactor value 1 3 gt lt param name bikeSpeed value 4 166666666666667 gt lt
5. in the above example 10 50 0 4 1250 This is naturally the same as dividing the 200 m of the link by the 0 16 persons m The effective lane width might be used by the visualization unclear if this is the case 9 1 1 qsim parallel version Status looks promising Main author s of the code C Dobler IVT Maintainer s C Dobler IVT Author s of this document C Dobler IVT Analysis of performance and structure of non parallel QueueSim shows e Simulation of movement on links and over nodes is most time consuming e Within a timestep actions on nodes and links can be simulated on parallel threads with low additional synchronization effort The parallel QueueSim is based on the existing QueueSim and can be used by just adding a new parameter to a scenario configuration file see below First performance measurements show promising results Working paper will be published in Q2 2010 The config option presumably is lt module name qsim gt lt param name numberOfThreads value 5 gt lt module gt Any number of threads larger than 1 triggers the use of the parallel version 9 1 2 lanes Status works Author s of this document Dominik Grether Maintainer s Dominik Grether Main author s of the code Dominik Grether Make sure you read before you use abe lanos module understand effects on the queue model 43 9 Synthetic realities aka mobsims 9 1 qsim
6. lanes Status works 2 2 22 0 020002 eee ee ee 43 9 1 3 signalsystems Status works 2 2 2 Common 45 9 1 4 transit public transport Status works 2 2 22 200 45 pH a a Pea eee a i S 46 9 3 simulation Status deprecated as of sep 2014 o 47 A A A A Mee ce ee 48 49 10 1 global Status indispensable o o e e e 49 10 2 controler Status indispensable 2 2 2 2 2 nn o e e 49 10 3 parallelEventHandling Status works for ivt and vsp 49 10 4 planCalcScore Status nearly indispensible 2 2 2222 2 50 A om Bao er ee ee Se es 50 10 6 travelTimeCalculator Status nearly indispensable 2 22 2 2 50 10 7 vspExperimental Status used by VSP 2 Co mn 50 51 E ed 51 ge heey A a a a ee 51 52 12 1 MATSim as tool for dynamic traffic assigment DTA 52 AA A AA 53 12 3 MATSim for network loading only 2 22 22 2 En nn 54 Appendices 55 A System Requirements 56 Chapter 1 Introduction Author s of this document Marcel Rieser 1 1 What is MATSim MATSim provides a framework to implement large scale agent based transport simulations The framework consists of severel modules which can be combined or used stand alone Modules can be replaced by own implementations to test single aspects of your own work Currently MATSim offers a framework for demand mo
7. 1 x 990 0 y 0 0 name Adorf linkRefId 1 isBlocking false gt lt stopFacility id 2 x 1100 0 y 980 0 name Beweiler linkRefId 2 isBlocking true gt lt stopFacility id 3 x 0 0 y 10 0 name Cestadt linkRefId 3 isBlocking false gt lt transitStops gt lt transitLine id Blue Line gt lt transitRoute id 1 gt lt description gt Just a comment lt description gt lt transportMode gt bus lt transportMode gt lt routeProfile gt lt stop refId 1 departureOffset 00 00 00 gt lt stop refId 2 arrivalOffset 00 02 30 departureOffset 00 03 00 awaitDeparture true gt lt stop refId 3 arrivalOffset 00 05 00 awaitDeparture true gt lt routeProfile gt lt route gt lt link refId 1 gt lt link refId 2 gt lt link refId 3 gt lt route gt lt departures gt lt departure id 1 departureTime 07 00 00 vehicleRefId 12 gt lt departure id 2 departureTime 07 05 00 vehicleRefId 23 gt lt departure id 3 departureTime 07 10 00 vehicleRefId 34 gt lt departures gt lt transitRoute gt lt transitLine gt lt transitSchedule gt Because of its complexity transit schedules often contain little mistakes that will return in an error when the simulation runs Typical examples include that the network route is missing a link or that the network route does not pass at all the defined stops in the right order To make sure a schedule does no
8. It shifts the function up and down i e it determines how much you lose if you drop an activity completely In the original paper and in most of MATSim to is set to typ exp 10h ttyp This has the intended consequence that all activities have the same utility contribution at their typical duration U P gt tiyp In tiyp exp 10h ttyp 8 gt ttyp gt n ttyp 10h ttyp which is at tiyp B tiyp 0 10h tiyp 8 10h With our usual 6 6 Eu h this results in 60Pu per activity The slope at U 0 i e at x to is B ttyp ttyp i exp 10h ttyp exp 10h ttyp which decreases with increasing tip This means that activities with larger typical duration are easier to drop completely In the end this makes sense Since the additional score of any activity is the same the score per time is smallest for activities with long typical durations Therefore it makes sense to drop them first But practically this is probably not desired behavior since it would first drop the home activity from a daily plan 30 6 The MATSim default scoring function utility function 6 6 Outlook Overall therefore In my opinion the current utility function does not work for activity dropping An alternative never tested since activity dropping was never tested with this utl fct would be to recognize that U to 2 tiyp to i e increasing slope with decreasing to That is high priority act
9. Status works initial demand replanning mobsim do SimStep prepare Simulation while Simulation is running simulate another SimStep prepare parallel executing threads ee E J _ A lt Y Y J y J Y J y A actions to do before SimStep i do SimStep actions to do after SimStep simulate movement on assigned linkes and nodes of the network simulate movement on assigned linkes and nodes of the network linkes and nodes of the network simulate movement on assigned linkes and nodes of the network simulate movement on assigned linkes and nodes of the network simulate movement on assigned linkes and nodes of the network simulate movement on assigned linkes and nodes of the network simulate movement on assigned linkes and nodes of the network ee aie sale L clean up Simulation synchronize threads amp data simulate movement on assigned Figure 9 1 Design of the parallel qsim Configuration To use lanes make sure that the following parameters are set lt module name controler gt lt param name enableLinkToLinkRouting value true gt lt param name mobsim value qsim gt lt module gt lt module name qsim gt sparati name numberOfThreads value 1 gt delas lt module name scenario gt lt pa
10. Xmx2000m needs to be added when the scenario gets larger 12 2 Including one s own upstream module There is the possibility to call one s own upstream plans modification module The config is something like lt module name strategy gt lt param name Module_1 value ChangeExpBeta gt lt param name ModuleProbability_1 value 0 9 gt lt param name Module_2 value ReRoute gt lt param name ModuleProbability_2 value 0 1 gt lt param name ModuleProbability_3 value 0 1 gt lt param name ModuleExePath_3 value lt some executable gt gt lt module gt where lt some executable gt isthe unix call of some external executable e g a shell script The external executable will be called with a config file as an argument The config file will contain e g the iteration number the full path name to the input plans file the full path name to the output plans file and the full path name to the txt events filef The input plans file are the plans that come from MATSim The output plans is the place where the modified plans file should be written to The events are the information on which the external module can base its computations f you would prefer the xml events here please let us know this is easy to change in particular when someone else tries it out 53 12 Specific applications 12 3 MATSim for network loading only 12 3 MATSim for network loading only Maybe one wants to
11. a configuration file which specifies the network and travel demand data to be used along with some settings for the Controler The list of available parameters and valid parameter values may vary from release to release Although we try to keep this stable due to changes in the software most notably by new features settings may change To get a list of all available settings currently available run the following command java cp matsim jar org matsim run CreateFullConfig fullConfig xml This command will create a new config file fullConfig xml which contains the full list of available parameters along with their default values This makes it easy to see what settings are available To use and modify certain settings the lines with the corresponding parameters can be copied to the config file specific for the scenario to be simulated and the parameter values be modified in that file 5 1 2 Network The network describes the infrastucture on which the agents or the vehicles respectively can move around The network consists of nodes and links in graph theory these are typically called vertices and edges Listing 5 2 shows an example of a simple description of a network in MATSim s XML data format Each element has an identifier id Nodes are described by an X and a Y coordinate value Links have more attributes The from and to attribute reference nodes and describe the geometry of the network Additional attributes describe the
12. but no routes When a simulation is started MATSim s Controler will load such a file and then automatically assign the nearest linnk to each activity and calculate a suitable route for each leg This makes it easy to get started quickly 5 1 4 Public Transport To simulate public transport in MATSim two additional input files are necessary One describes the schedule i e that lines their routes which stops they serve and the departure times The other describes the vehicles which serve the lines are they big busses small buses trains or light rail vehicles and describes how many passengers each vehicle can transport 19 5 Building New Scenarios 5 1 Typical Input Data Sets Listing 5 4 Minimal population xml required to start MATSim lt xml version 1 0 encoding utf 8 gt lt DOCTYPE population SYSTEM http www matsim org files dtd population_v5 dtd gt lt population gt lt person id 1 gt lt plan gt lt act type home x 5 0 y 8 0 end_time 08 00 00 gt lt leg mode car gt lt leg gt lt act type work x 1500 0 y 890 0 end_time 17 30 00 gt lt leg mode car gt lt leg gt lt act type home x 5 0 y 8 0 gt lt plan gt lt person gt lt person id 2 gt lt person gt lt population gt The description of public transport vehicles itself can be split into two parts In a first part vehicle types have to be described specifying how many passengers su
13. estimated per minute or hour and that the corresponding values for seconds are very small and thus errorprone to be configured 5 2 2 Conventions MATSim makes heavy uses of identifiers short Ids This Ids can be arbitrary strings with the following exceptions Ids should not contain any spaces incl tabs new lines etc or commas as those characters are typically used for separating different Ids from each other in Id lists 5 3 Coordinate Systems 5 3 1 Preparing Your Data in the Right Coordinate System In several input files you need to specify coordinates e g for the nodes of the network It is strongly suggested not to use WGS84 coordinates i e GPS coordinates or any other kind of spherical coordinates coordinates ranging from 180 to 180 in west east direction and from 90 to 90 in south north direction MATSim needs to calculate distances between two points in several places of the code The calculation of distances between spheric coordinates is very complex and potentially slow Instead MATSim uses the simple Pythagoras theorem but this requires the coordinates to be in a Cartesian coordinate system Thus is is stronlgy advised to use a Cartesian coordinate system along with MATSim preferably one where the distance unit corresponds to one meter Many countries and regions have custom coordinate system defined optimized for usages in their apropriet areas It might be best to ask some GIS specialists in your region
14. 11 12 e https svn vsp tu berlin de repos public svn publications vspwp 2011 11 08 This documentation is missing an explanation of the lanes option Please ask if you need this separate lanes for separate turning movements 9 1 4 transit public transport Status works Main author s of the code Marcel Rieser Maintainer s Marcel Rieser Author s of this document Marcel Rieser 45 9 Synthetic realities aka mobsims 9 2 JDEQSim Status works A public transport system is simulated and integrated on a fine scale with both the traffic simulation and the behavior of the artificial population Agents who use transit determine a route to their destination based on the transit schedule Transit vehicles are moved on the road network in accordance with the traffic flow model i e they may get stuck in congestion and fail to keep their schedule Agents getting on and off transit vehicles cause realistic delays A transport mode decision model is implemented which allows agents to switch their choice of driving a car or using transit based on the relative utility of the two modes The disutility of travel time which this model takes into account is based on actual travel times taken from the simulation See the This requires quite some additional input Reference M Rieser K Nagel Combined agent based simulation of private car traffic and transit IATBR 2009 9 2 JDEQSim Status wo
15. and the simulation will stop when the last event of the simulation has been processed The scaling parameters lowCapacityFactor and storageCapacityFactor can be used as with mobSim and have no unit The minimumInFlowCapacity defines for all roads the minimum number of cars which could enter the road per hour for the congestion less case The carSize parameter allows to set the size of a car in meters The gapTravelSpeed parameter defines the speed of gaps in m s Finally the squeezeTime is used for deadlock prevention and defines how long a car should wait at maximum for entering the next road before deadlock prevention is turned on unit seconds 46 9 Synthetic realities aka mobsims 9 3 simulation Status deprecated as of sep 2014 The minimumInFlowCapacity is a parameter which was not published in the C DEQSim but only used interally and was hardcoded to the value 1800 vehicles per hour This value was estimated from literature assuming that independently from the speed limit of a road the minimum interval between two vehicles is 2 seconds inverse of 1800 vehicles per hour This factor does not need to be changed when the flowCapacityFactor is changed as the scaling is automatically done internally The reason for publishing this factor is to make it possible for users to adapt this factor if they want to use a different minium inflow capacity based on their model est
16. factor beta brain o o o o 12 A ee eee ee ee a ee 12 panera 12 3 8 Stationary gt Telaxedl nn nen 13 3 9 Utility SCOPE s so ecs en ta d w Oe ea Ee 13 4 Running MATSim 14 4 1 Prerequisites s s sa 66 ae zer an ew ea SR EE SE be ee EG oe ees 14 4 2 Using MATSim from a Command Line 2 22 2 2 rn nn 14 5 Building New Scenarios 16 5 1 Typical Input Data Sets 2 0 0 0 0200020002 eee ee 16 5 1 1 Configuration 0 2 a u aa Eee de Se hae He sn 17 5 12 NetWork oS ra ee eee he ee ee 17 5 1 3 Demand eei 5 22 200 san e wa ee we A be a eee 18 SLA Public Transport i e zu st raora s Sa a da ar Frame ra 19 51 5 COMES s eh ae u wo he ee ee 22 9 2 Units and Conventions Usedl 22 22 2 nn nn nn 23 Contents Contents Dr NOISY ae ee am aoe ecke ug goa do hy ap are re Ge ae a F 23 5 2 9 Conventions 4 2 0 5 1 0 eee we ewe we Re Hew Ee Rel 23 woe AY GOR eG oe Ay RR Ge ee EES a 23 5 3 1 Preparing Your Data in the Right Coordinate System 23 ee ee 24 DR AA AA boa ee a E 24 ple a oh ee he ewe ee ee ee 24 6 The MATSim default scoring function utility function 25 De hy oy ar Pk Gem A whic ds Od 2G ee eee 26 pae A A A A ee ee ae 26 6 2 1 Performing activities 2 2 22 CH nn 0 000002 eee ee ee 26 6 2 2 Arriving late gues aa nee See est an 27 6 2 3 lravehnp ceo 2 So AO OE ara Ta aa era ad ne 27 6 2 4 Utility of time as a resource opportunity cost oftime
17. is also considered in the simulation The optimization of the demand data is one of the key features of MATSim making it suitable to be used for policy studies In this whole simulation and optimization process 5 major stages can be identified initial demand execution scoring replanning analysis These 5 stages are executed in the order shown in Fig In the following the responsibilities of each stage is shortly described The details for the stages including what options are available to influence the stages and how they work are explained in separate chapters later on initial E F GE execution gt el scorin MO anal ses replanning Figure 2 1 Stages of a MATSim Simulation 2 Overview 2 2 The Optimization Process Initialdemand The initial demand describes the mobility behaviour to be simulated It contains the full list of agents and for each agent at least one day plan A day plan contains a list of activities e g being home being at work and trips e g going by car to shopping along with temporal information e g leaving home at 7 23 am working until 5 39 pm and additional information e g detailed route going from home to work Plans describe the intentions of agents If agents calculate too optimistically get stuck in a traffic jam or miss a bus it might be that their plan cannot be realized in the simulation as the agents intended to Execution Often also called the mobility simulation or j
18. lt param name Module_1 value ChangeLegMode gt lt param name ModuleProbability_2 value 0 1 gt lt param name Module_2 value TimeAllocationMutator gt lt module gt In the configuration file strategy modules are numbered Also each module is given a weight which determines the probability by which the course of action represented by the module is taken In this example each person stands a chance of 1 2 that their transport mode is changed and a chance of 1 2 that their time allocation is changed The weights are renormalized so that they add up to one A strategy module is in the code always a combination of a plan selector and zero or more strategy module elements There are two cases which are handled differently e If there are zero strategy module elements the chosen plan is made selected for the person and the method returns e If there is at least one strategy module element the chosen plan is copied that copy is added to the persons s set of plan and the new plan is made selected That new plan is then given to the strategy module elements for modification These latter strategy modules with at least one strategy module element are sometimes called innovative The strategy modules that are understood by MATSim are defined in the class PlanStrategyReg In addition you can program your own strategy modules see tutorial programming in matsim src main java for examples Unfor
19. modules 10 4 planCalcScore Status nearly indispensible see details 10 4 planCalcScore Status nearly indispensible Maintainer s Marcel Rieser This module contains the definitions for the utility function Some help for it should be in the tutorials There is also some description in the scoring function section of the documentation P 10 5 strategy Status indispensable Maintainer s Marcel Rieser See 10 6 travelTimeCalculator Status nearly indispensable Maintainer s Marcel Rieser router and travel TimeCalculator are separate in matsim so that they can be configured separately They refer to each other though 10 7 vspExperimental Status used by VSP Main author s of the code Kai Nagel Maintainer s Kai Nagel Author s of this document Kai Nagel This section defines switches that are used at VSP or when collaborating with VSP There are experi mental and may we withdrawn without notice 50 Chapter 1 1 Visualization and analysis There are two visualizers available for MATSim The original open source visualizer is OTFVis which is a MATSim extension It requires current OpenGL drivers The source code is available so you can add your own information visualization code On the other hand there is currently little support for it from our part Then there is Via a commercial visualizer developed by Senozon It has more features a better UI and
20. of interest what the most commonly used local coordinate system is and use that as well for your data If you don t have any clue about what coordinate system is used in your region it might be best to use the Universal Transverse Mercator coordinate system This coordinate system divides the world into multiple bands each six degrees width and separated into a northern and southern part which it calls UTM zones see http en wikipedia org wiki UTM_zones UTM_ for more details For each zone an optimized coordinate system is defined Choose the 23 5 Building New Scenarios 5 4 A Minimum Example UTM zone which covers your region Wikipedia has a nice map showing the zones and use its coordinate system 5 3 2 Telling MATSim about Your Coordinate System In some places MATSim requires to know which coordinate system your data is in You have multiple ways to specify the coordinate system you use The easiest one is to use the so called EPSG codes Most of the commonly used coordinate systems got standardized and numbered The EPSG code uniquely identifies a coordinate system and can be directly used by MATSim As an alternative MATSim can also parse the description of a coordinate system in the so called WKT format As the WKT format is much more error prone it is suggested to use EPSG codes whenever possible To find the correct EPSG code for your coordinate system e g for one of the UTM zones the website http
21. population the simulated traffic volumes are likely lower than the real world traffic counts In order to allow useful comparison one can specify a factor by which the simulated traffic volumes are multiplied For example if you simulate a 25 sample of your full population specify a countsScaleFactor of 4 e lt param name distanceFilterCenterNode value 2386 gt lt param name distanceFiler value 30000 0 gt If the traffic counts cover a larger area than the area being simulated the traffic counts outside your area will result in a bad comparison Instead of removing the traffic counts from the counts xml you can specify a filter to only include some traffic counts from the file in the comparison To activate the filter specify the id of a node that acts as the center of a circle The circle has the radius specified in distanceFilter the unit being the same unit as the length of links i e usually meters 8 2 facilities Status user version work in progress Maintainer Andreas Horni One may or may not use a separate file that contains facilities essentially some kind of land use information 39 8 MATSim input data MATSim containers 8 3 households Status probably ready but nowhere used The prototype for this is fairly old But the final design is somewhat different and has not been fully executed So I kn do not know if this can currently be used as a non deve
22. to a link in the network The stop can only be served by vehicles driving on that specified link Optionally it is possible to specify a name for the stop and if other vehicles are blocked when a transit vehicle is waiting at a stop This last attribute is useful to model e g the difference of bus stops where one bus stop has a bay while at another stop the bus has to stop on the actual road After the stop facilities the transit lines their routes and schedules are described This is a hierarchical data structure Each line can have one or more routes each route has a route profile a network route and a list of departures Listing 5 6 has an example of a minimalistic but complete transit schedule Each transit line must have a unique id Bach transit route has an id which must be unique 20 5 Building New Scenarios 5 1 Typical Input Data Sets within that one line so the same route id can be used with different lines The transportMode describes on which links in the network the line runs Actually this is currently not yet enforced It would be possible to let a bus run on train links in the simulation It might be enforced in the future The routeProfile describes the stops this route serves while route itself describes the series of links in the network the transit vehicle s driver has to drive along thus often referred to as network route Note that the complete route i e all links the vehicle drives along must be l
23. use MATSim only for the network loading In this case the plans file needs to look something like lt population gt lt person gt lt plan gt lt act type dummy x lt dp loc x gt y lt dp loc y gt endTime lt dp time gt gt lt leg mode car gt lt route gt 18 24 45 lt route gt lt leg gt lt act type dummy x lt dest x gt y lt dest y gt gt lt plan gt lt person gt lt person gt populations where the route section needs to contain the route information chk plans v5 fmt kai The config file will be something like lt module name network gt lt param name inputNetworkFile value gt lt module gt lt module name plans gt lt param name inputPlansFile value gt lt module gt lt module name controler gt lt param name firstlteration value 0 gt lt param name lastIteration value 0 gt lt module gt lt don t know if the following is necessary gt lt module name planCalcScore gt lt param name activityType_0 value dummy gt lt same activity type as used in plans file gt lt module gt The overall calling syntax is again something like java cp matsim jar Xmx2000m org matsim run controler config xml There are two obvious options how this can be used e There is some external mechanics e g some external script which keeps calling MATSim from the command line as in and then takes the output
24. 52 12 Specific applications 12 2 Including one s own upstream module lt person gt lt person gt lt population gt Note that MATSim trips start on links not at nodes You somehow have to convert this This file together with the appropriate network file and an appropriate config file will serve as input to MATSim The config file will look something like lt module name network gt lt param name inputNetworkFile value gt lt module gt lt module name plans gt lt param name inputPlansFile value gt lt module gt lt module name controler gt lt param name firstIteration value 0 gt lt param name lastIteration value 100 gt lt module gt lt module name planCalcScore gt lt param name activityType_0 value dummy gt lt same activity type as used in plans file gt lt module gt lt module name strategy gt lt param name Module_1 value ChangeExpBeta gt lt param name ModuleProbability_1 value 0 9 gt lt param name Module_2 value ReRoute gt lt param name ModuleProbability_2 value 0 1 gt lt module gt The overall calling syntax is something like java cp matsim jar Xmx2000m org matsim run Controler config xml There is a corresponding example in recent releases it should run in the release directory with java cp matsim 0 5 0 jar org matsim run Controler examples tutorial config example5 config xml
25. 7 3 Innovative modules This replanning module randomly picks one of the plans of a person and changes the mode of transport of one single leg The leg is picked randomly For changing the mode of transport for all legs use ChangeLegMode Sec 7 3 4 In contrast to ChangeLegMode ChangeSingleLegMode allows for multiple modes in one plan By default the supported modes are driving a car and using public transport Also this module is able to optionally respect car availability Note that the configuration is done by lt module name changeLegMode gt and not by lt module name changeSingleLegMode gt The replanning module is configured like this using the very same configuration module as ChangeLegMode lt module name changeLegMode gt lt param name modes value car pt bike walk gt lt param name ignoreCarAvailability value false gt lt module gt Add the module to the replanning strategy like this lt param name Module_X value ChangeSingleLegMode gt lt param name ModuleProbability_X value 0 1 gt Replace the X with the number you assign to this module For some more details on the syntax of this section see Sec By default the simulation will handle legs with modes different from car by using a delayed teleportation If another behavior is requested e g detailed simulation of public transport this needs to be manually configured for the simulation 7 3 4 ChangeLegMode Stat
26. During the simulation MATSim collects sev eral key values from the simulation and outputs them to give you a quick overview of the current state of the simulation Among other results it can compare the simulated traffic to real world data from counting stations displaying the results interactively in Google Earth Additionally MATSim provides detailed output from the traffic simulation which can easily be parsed by other applications to create your own special analyses 1 Introduction 1 3 About this Guide Modular Approach MATSim allows for easy replacement or addition of functionality This allows you to add your own algorithms for agent behavior and plug them into MATSim or use your own transport simulation while using MATSim s replanning features Open Source amp Multi Platform MATSim is distributed under the Gnu Public License GPL which means that MATSim can be downloaded and used free of charge Addition ally you get the complete source code which you may modify within certain constraints see the license for more details Written in Java MATSim runs on all major operating systems including Linux Windows and Mac OS X Active Development and Versatile Usage of MATSim Researchers from several loca tions are currently working on MATSim Core development takes place world wide with the efforts lead by the Berlin Institute of Technology TU Berlin the Swiss Federal In stitute of Technology ETH in Zurich as well as S
27. MATSim User Guide Development Version last updated September 12 2014 Marcel Rieser Christoph Dobler Thibaut Dubernet Dominik Grether Andreas Horni Gregor Lammel Rashid Waraich Michael Zilske Kay W Axhausen Kai Nagel MATSim Multi Agent Transport Simulation Note The material found in this document was originally maintained as a collection of web pages Those were eventually automatically converted to latex and incrementally cleaned up since then As a result leftovers from those web pages can still be found in the document including lots of links to web pages which could be replaced by internal links in the document and links to web pages where the material should be inlined into the document Originally generated 2013 06 12 T12 13 34 02 00 from matsim org docs userguide but changed since then Contents 5 I1 What is MAD Simi 2 3 ao 2 Sr a na aa Ps ana ben a OR 5 l2 Features ce de so a u a ee Ba a ww a Dre ee a 5 1 3 About this Guidel 22 2 2 2 Coon on 6 7 a re ie Ge ee 7 Stee ad OSS A ea Ea 8 ope arson e Soe a es as ea oe ee ee F 9 2 4 Customizabuity ears su Ae aoe ew Re a BO a a Soe e B 10 3 Terminology 11 3 1 Choice set plan set of an agent nn 11 3 2 Choice set generation Time mutation re route innovation 11 3 3 Choice set generation choice gt replanning 11 La Sass amp Sis See Bey e 12 3 5 Mu logit model scaling
28. Runtime Environment JRE can be downloaded from http java oracle com e Have at least 2 GB memory for running the examples For larger scenarios more memory will be required e Have enough free hard drive space The provided examples will occupy only a few megabytes but large scenarios can easily use multiple gigabytes of disk space e Last but not least you need a version of MATSim This chapter assumes you are using a release or nightly build of MATSim which comes pre packaged as a jar file This chapter will not explain how to compile and run MATSim based on its program source files In the remainder of this chapter matsim jar will be used to refer to the jar file of MATSim The actual name might differ e g it might include a version number like matsim 0 6 0 jar or matsim 20140114 jar 4 2 Using MATSim from a Command Line To run MATSim one needs a configuration file and an estimation how much memory the simulation will consume Don t fear this you ll get used to this quite fast As MATSim comes without graphical user interface it needs to be run on the command line In Linux or Mac OS X 14 4 Running MATSim 4 2 Using MATSim from a Command Line this is typically done using a Terminal application In Windows the Power Shell or Command Prompt can be used On the command line type the following command but substitute the correct paths java Xmx512m cp path to matsim jar org matsim run Controler
29. alue TransitChangeLegMode gt 36 7 Strategy Modules 7 3 Innovative modules Reference M Rieser D Grether K Nagel Adding mode choice to a multi agent transport simu lation TRB 09 7 3 5 SubtourModeChoice Status probably works Maintainer s Michael Zilske In contrast to ChangeLegMode which changes all legs of a plan to a different mode this module changes the modes of sub tours separately For example somebody might take the car to work walk to lunch and back and take the car back home chainBasedModes means modes where a vehicle car bicycle is parked and in consequence needs to be picked up again lt module name subtourModeChoice gt lt param name chainBasedModes value car bike gt lt param name modes value car bike pt walk gt lt module gt The module is called by inserting the following lines into the strategy module lt module name strategy gt lt param name ModuleProbability_XXX value 0 1 gt lt param name Module_XXX value SubtourModeChoice gt lt module gt For modes other than car travel time and travel distance are computed according to some heuristics which are configured in the router 37 Chapter 8 MATSim input data MATSim containers Sorted alphabetically 8 1 counts Status works for vsp and ivt Maintenance and Questions A Horni IVT horni_at_IVT baug ethz ch Javadoc www matsim o
30. ated machine running MATSim if you plan to simulate many different scenarios Recommendations e To try MATSim out Any modern laptop or desktop computer with 1GB RAM and 500MB free disk space should be suitable e To run a large scenario 100 000 agents networks with 50 000 links A high end desktop computer with at least 4GB RAM and 200 GB free disk space e To run many large scenarios so they can be compared against each other Multiple high end desktop computers or servers with at least 4GB RAM that share a common storage disk at least 1TB The high numbers for free disk space result from the fact that the simulation writes quite a lot of data to the disk during a run For analysis usually only the last version of the data is required and data from earlier iterations can be deleted freeing space up again 56 A System Requirements What we use Currently we simulate most of our scenarios on machines with 16 or 32 GB RAM having 2 dual or quad core processors The amount of memory allows us to run 2 scenarios at the same time on the machines A RAID array is used as storage backend offering about 4 TB of hard disk space This huge disk space is able to store the results of hundreds of simulations and will suit us for the next few years Computers and RAID are regular components used in data centers nowadays available at moderate prices 57
31. by two long time MATSim developers which provides commercial support for such situations e Senozon also helps significantly with the development and maintenance of the MATSim core The open source community and Senozon have a shared interest in a functional and robust MATSim core Both our academic research and Senozon s commercial success depend on this e In addition Senozon has developed the MAT Sim visualization and analysis software Via OTFVis remains available but maintenance is limited In particular please understand that we are unable to provide support for specific hardware configurations or specific query requests 11 2 Events analysis In order to write MATSim events handlers some amount of Java programming is necessary Material can thus found in the api users section of the documentation see here 5l Chapter 1 2 Specific applications Author s of this document Kai Nagel A discussion of policy measures that can be investigated with matsim is under matsim org policy measures It is not in the user section but in the developer section of the documentation since at this point many of those measures need additional coding Clearly something like adding or removing lanes or links can be investigated without any coding Ex amples for use cases and policy measures that can be investigated without coding can be found in the following 12 1 MATSim as tool for dynamic traffic assigment DTA A typical MATS
32. ch a vehicle can transport Note that the term vehicle can refer to multiple vehicles in reality e g a train with several wagons should be specified as one long vehicle with a high number of seats In the second part actual vehicles have to listed Each vehicle has an identifier and is of a previously specified vehicle type Listing 5 5 shows an example of a such a file describing one vehicle type and two vehicles of that type Listing 5 5 An example of transit Vehicles xml lt xml version 1 0 encoding UTF 8 gt lt vehicleDefinitions xmlns http www matsim org files dtd xmlns xsi http www w3 org 2001 XMLSchema instance xsi schemaLocation http www matsim org files dtd http www matsim org files dtd vehicleDefinitions_v1 0 xsd gt lt vehicleType id 1 gt lt description gt Small Train lt description gt lt capacity gt lt seats persons 50 gt lt standingRoom persons 30 gt lt capacity gt lt length meter 50 0 gt lt vehicleType gt lt vehicle id tr_1 type 1 gt lt vehicle id tr_2 type 1 gt lt vehicleDefinitions gt The public transport schedule often referred to as transitSchedule xml only is a rather complex file It contains information about stop facilities these can be bus stops train stations or other stop locations and transit services In the first part the stop facilities need to be defined giving each one a coordinate an identifier and a reference
33. crease corre sponding to the agents improving their plans such that they can perform their daily activities as good as possible Fig 2 2 shows how the average score develops in a typical MATSim simulation over the course of the iterations Note that the absolute value of the scores may depend upon the scenario As can be nicely seen in the figure the average executed score typically improves very rapidly in the first few iterations but will only improve very slightly in later iterations or even degrade a few times Average executed score 160 140 120 Score 00 40 20 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 Iteration Figure 2 2 Tpyical development of the average score of the executed plans over the iterations 2 3 Mobility Simulation Events The mobility simulation moves the agents around in the virtual world according to their plans and within the bounds of the simulated reality The mobility simulation documents its moves with so called Events These events are small pieces of information describing the action of an object at a specific time Examples of such events can be An agent finishes an activity An agent starts a trip A vehicle enters a road segment A vehicle leaves a road segment 2 Overview 2 4 Customizability e An agent bordes a public transport vehicle e An agent arrives at a location e An agent starts an activity Each event has a timestamp a type and additional att
34. d capacity constraints Reusing demand data is typically more complex If you have the output of an agent based and activity based demand generation process you might convert the data agent by agent to the MATSim format If only aggregated data in the form of origin destination matrices or attraction matrices is available a simple conversion to complex agent plans is not possible and the demand must be regenerated using other data sources 24 Chapter 6 The MATSim default scoring function utility function Author s of this document Kai Nagel MATSim contains at its core a co evolutionary algorithm which continuously generates new alterna tives continuous choice set generation The actual choice from that set is based on the scoring function This section contains information that pertains to the so called Charypar Nagel scoring func tion In many situations it should be sufficient to just read Sec However if you are working on departure time choice or related issues such as peak hour pricing you need to read on beyond that time homd ave workplace workplace opening time u Figure 6 1 Example of scoring function 25 6 The MATSim default scoring function utility function 6 1 Illustration 6 1 Illustration Synthetic travelers normally receive rewards positive utility for performing activities and penalties negative utility for traveling Fig 6 1 provide
35. deling agent based mobility simulation traffic flow simulation re planning a controller to iteratively run simulations as well as methods to analyze the output generated by the modules The basic set of features of MATSim can be used just by using the software as is providing your own input data and just modifying the configuration for the simulation For advanced usages it is necessary to write your own program code that integrates with MATSim e g to provide special functionality or have your custom analysis output 1 2 Features The following list shows the key features of MATSim Agent Based Multi Modal Simulation of Daily Mobility Behavior MATSim is capa ble of simulating private car traffic and public transport in large detail and is able to support additional modes e g pedestrians or cyclists as well Simulations typically cover one full day and the mobility behaviour of a large number of single persons agents is simulated simultaneously This allows to track single agents through their whole day from home to work to leisure or shopping and back to home Fast even for Large Scenarios MATSim is able to simulate scenarios with several millions agents on networks with hundreds of thousands of road segments All you need is a current fast desktop computer with enough memory Even in such cases MATSim often only takes a couple of minutes for the simulation of one complete day Versatile Analyses and Simulation Output
36. ed traffic count attribute val for an hour of the day attribute h numbered from 1 to 24 1 00 00 00 59 2 01 00 01 59 etc It is not necessary that traffic counts are available for all 24 hours of a day Enabling Comparison in Configuration File Add the following lines to your configuration file lt module name counts gt lt param name inputCountsFile value path to counts xml gt lt param name outputformat value txt html kml gt lt module gt The comparison is automatically generated every 10th iteration Generated output is located in the output directory of the iteration usually something like output ITERS it 10 Configuring the Counts Comparison The counts module offers the following config parameters e lt param name outputformat value txt html kml gt The output format specifies in which format the comparison results are written to disk It can be any combination of txt html and kml Multiple formats can be specified separated by commas txt writes simple text tables containing the values to a file It is most useful to create custom graphs e g in Excel html creates a directory containing several html files allowing to browse the results interactively kml creates a file to be displayed in Google Earth This last option only works if the correct coordinate system is set e lt param name countsScaleFactor value 1 0 gt If you only simulate a sample of your
37. enozon a private company founded by two former PhD students Additional development as far as we are aware of cur rently takes place in South Africa Germany Canada as well as other places around the world This distribution of development ensures that MATSim not only works for one scenario context but can be adapted to many different scenarios 1 3 About this Guide This user guide should help you to get started with MATSim It starts by giving a broad overview of MATSim highlighting the different parts of MATSim and how they work together in Chpt 2 In Chpt 3 Terminology some terms commonly referred to in this user guide are explained and put into relation to terms used to describe similar concepts After this you re ready to start MATSim for the first time Chpt 4 shows you how to do this in a number of different environments If you re interested to build your own scenario you ll find Chpt helpful It explains what data and in what format is necessary to build a scenario Chapter 2 Overview Author s of this document Marcel Rieser This chapter gives an overview of the major components of MATSim and how they work together essentially building the foundation for the MATSim framework 2 1 The Major Stages of aMATSim Simulation In a typical MATSim simulation travel demand data is simulated and optimized on a given transportation network e g a road network or a multimodal network in the case when public transport
38. events in order to update plans e One uses the MATSim iteration mechanics as described in Sec 12 2 to call an external module which also modifies routes 54 Appendices 55 Appendix A System Requirements Author s of this document Marcel Rieser Software MATSim runs on any machine that has the Java Platform Standard Edition SE 6 or newer installed commonly referred to as Java 6 or newer Hardware Smaller scenarios e g the examples included in the tutorials 5 or 10 samples of large scenarios can be run on common desktop or laptop computers To simulate large scenarios several hundreds of thousands of agents networks with ten thousands of links and nodes high end computers with a large amount of memory RAM may be required to keep the agents data in memory The description of agents plans and the simulation output can take several Gigabytes of hard disk space To store the data for several scenarios and or output of simulation runs large amounts of disk space may thus be needed MATSim can read and write compressed files to reduce the amount of required disk space but this aspect still shouldn t be underestimated MATSim can make use of multiple CPUs or CPU cores that share common memory shared memory machine during the replanning phase Running large scenarios for a high number of iterations can take several hours up to a few days Thus it may be advisable to have a dedic
39. fig group 9 1 3 signalsystems Status works Main author s of the code Dominik Grether Maintainer s Dominik Grether Author s of this document Dominik Grether The signal systems module provides functionality to simulate traffic lights with MATSim It is recom mended to use a nightly build that is younger than 04 19 2011 i e revision 15081 Have a look at the tutorial at http matsim org node 732 The starting point of the technical documentation is e http www matsim org javadoc org matsim signalsystems package summary html Note that there are links to continuative documentation at the bottom of the package summary html www page MATSim ships with a tutorial that shows you how to set up a traffic light scenario The network and traffic light configuration of the turorial is shown in the slides attached to this page The network and code can be found in the folder tutorial unsupported example90TrafficLights in the nightly build The code examples are divided into several classes e CreateSimpleTrafficSignalScenario java Uses traffic signals without lanes and creates the traffic lights at nodes 3 4 7 and 8 e CreateTrafficSignalScenarioWithLanes java Uses traffic signals with lanes and creates the traffic lights at nodes 2 and 5 Publications using this module e https svn vsp tu berlin de repos public svn publications vspwp 2008 08 24 e https svn vsp tu berlin de repos public svn publications vspwp 2011
40. following trip changing the mode of transport for a trip or changing the route for a trip departure time choice mode choice route choice In MATSim these modifications are performed by so called Strategy Modules Analysis At the end of a complete simulation one is often interested in some key performance values of the simulation Examples could be mode shares miles travelled in total by all agents or average trip duration and distance per mode and hour Such analyses could either be auto matically be performed at then end or in a separate post processing step The three stages Execution Scoring and Replanning are performed iteratively in order to give the agents multiple opportunities to adapt their plans to the plans and behaviour of the other agents This is why MATSim typically performs multiple iterations within one simulation run consisting of multiple mobility simulation scoring and replanning executions until the end result is available MATSim provides a Controller sadly misspelled as Controler in some places which implements the iteration loop as shown in Fig This Controller is typically the entry point for running MATSim simulations as it handles all aspects from loading all the required data configuring the whole setup according to the user s settings and iteratively calling the execution scoring and re planning stages Chpt 4 shows the usage of the Controller in more detail 2 2 The Optimization Process As ou
41. has just will be applied aut to start the controller with this config file and the network change events omatically It seems that the absolute version of this module was never tested and may not work with freespeeds other than zero kai oct 10 8 6 vehicle nothing s Status probably reads the file correctly but does else Maintainer Michael Zilske within limits of DFG MUC project possibly pt project 41 Chapter 9 Synthetic realities aka mobsims This chapter is partially deprecated e g e qsim is now the default mobsim the others need to be specifically called for in the controler section of the config file It is also the most used and therefore probably the most reliable of the three variants 9 1 gsim Status works Hyeudo not puta asim section into the config file the systenrwil use the default simulatien look there asin js whatave use fer new features suchas public transi_or_sienalsystems New features implies unstable Use onh if you _have te Also see Some calibration hints especially when the main mode is not car The exit flow capacity of a link is capacity_value_of_link capacity_period_of network x flow_capacity_factor where e the capacity value of the link is given by the link entry in the network file e the capacity period of the network is given at the beginning of the links section in the netwo
42. im use case is the use as dynamic traffic assignment DTA tool In DTA trips are given by departure time departure location and destination and the task of DTA is to find routes The task is typically solved by iterating between network loading and routing possible outcomes are a Nash equilibrium no traveller can improve its score utility by switching to a different route or SUE so called stochastic user equilibrium In order to use MATSim for this one needs to convert each trip into a pseudo person I call this pseudo person since it does not correspond to a real person rather it is probably that multiple trips belong to one person The input file would look something like lt population gt lt person gt lt plan gt lt act type dummy x lt dp loc x gt y lt dp loc y gt endTime lt dp time gt gt lt act type dummy x lt dest x gt y lt dest y gt gt lt plan gt lt person gt lt person gt lt population gt where dummy arbitrary activity type see below lt dp time gt starting time of trip lt dp loc x gt x coordinate of departure location lt dest x gt x coordinate of destination Alternatively one can use link ids for departure locations and destinations lt population gt lt person gt lt plan gt lt act type dummy link lt link id gt endTime lt dp time gt gt lt act type dummy link lt link id gt x lt dest x gt y lt dest y gt gt lt plan gt
43. imations Hints e You might consider turning on the module parallelEventHandling when using JDEQSim as often JDEQSim can make much better use of this module than QueueSim as JDEQSim is faster e If you are getting lots of breakdowns consider using smaller squeezeTime e g 10 seconds or lower Requirements for the Plans XML File e For each person the end_time of the first act must be defined dur is ignored e For the other acts of a person either dur or end_time needs to be defined e If both dur and end_time are defined then only the one which occurs earlier is considered Differences between MobSim and JDEQSim e QueueSim uses a simulation approach called fixed increment time advance instead of next event time advance which makes it much slower than JDEQSim for high resolution networks e JDEQSim models gap travel times more realistically than QueueSim where this feature is missing Further Reading This implementation is based on the micro simulation described in the following paper Charypar D K Nagel and K W Axhausen 2007 An event driven queue based microsimulation of traffic flow Transportation Research Record 2003 35 40 Order here Some Java specific implementation aspects and performance tests of JDEQSim and parallelEventHandling are described in the following paper Waraich R D Charypar M Balmer and K W Axhausen 2009 Performance improvements f
44. ime as a resource opportunity cost of time Most utility based models in travel behavior research such as typical logit mode choice models use partial utility functions These utility functions do not describe the full utility of the person but just those parts that are affected by the choice Since MATSim gives a score utility to the full day this does not work in the same way any more It most importantly shows up with time where reducing the time spent traveling does not only lead to a reduction of the penalty of traveling but also barring opening time constraints to an extension of the activity following the travel The first effect is described marginally by o leg _ 0 ve Decaesiode gt tiran the minus stems from the fact that we are reducing the travel time 27 6 The MATSim default scoring function utility function 6 3 Calibration of the scoring function The second effect is described marginally by o vrerf _ Otper f i Boer f s ttyp i x Boer f gt tperf where the approximation holds when the actual activity duration tperf is close to its typical duration ttyp This is also the justification why t yp is called the typcical duration and perf the marginal utility of performing The marginal utility of travel time savings needs to consider both t mUTTS Ga or Ber f i x Btrav mode Ber f per In consequence Berav mode 18 only an offset to the marginal utility of time as a res
45. isted in the route and not only the ones where stops are located All the specified stops should occur along this route in the specified order The time offsets given for each stop in the routeProfile describe the relative time offset to an actual departure time If a bus is to depart at 7 o clock in the morning and stop 2 has a departureOffset of 00 03 00 this must be read that the bus is expected to depart at 07 03 at the specific stop All stops in the route profile must have a departure offset definded except the last one All stops except the first one can optionally have an arrival offset defined This is mostly useful for large trains that stop for several minutes at a station to help the routing algorithm to find connecting services at the correct time namely the expected arrival time of the train As last part of the description of a transit route the list of departures should be given Bach departure has an id which must be unique within the route and gives the departure time at the first stop of the specified route profile In addition the departure specifies with which vehicle the service should be run This vehicle must be defined in the aforementioned list of transit vehicles Listing 5 6 An example of a schedule xml lt xml version 1 0 encoding UTF 8 gt lt DOCTYPE transitSchedule SYSTEM http www matsim org files dtd transitSchedule_v1 dtd gt lt transitSchedule gt lt transitStops gt lt stopFacility id
46. it is more stable On the other hand it visualizes output files from simulation runs whereas OTFVis runs in the same VM as MATSim and can peek into the running simulation The supported way of programming your own data analysis or visualization code is to analyze MATSim output in the form of Events either reading in the events xml file or writing an EventHandler and receiving Events programmatically 11 1 Senozon Via Via can be obtained from the While the application is commercial a limited version is available freely from the website A brief introduction to using Senozon Via is part of the Learning MATSim in 8 Lessons tutorial in the Getting Started lesson Via is able to visualize most of MATSim s data network agent plans transit schedule facilities counts along additional data e g shape files GPS traces It allows to analyze and visualize the outcome of MATSim simulations by loading the generated events file On the relation between Senozon a private company Senzon Via a commercial software MATSim an open source project software and MATSim OTFVis an open source software e Historically MATSim is open source An important reason for this was that multiple teams contribute and we wanted to make progress rather than sorting out the intellectual property e However this community is unable to provide support for any and all requests that may come up As a result the commercial company Senozon was founded
47. ity MAT Sim is designed to be modular Nearly all parts can be customized replaced or enhanced with custom functionality Some customizations are easier than others Replacing the mobility simulation for additonal behaviour might be one of the hardest things to achieve Changing the replanning on the other hand is quite easy especially as there is already a number of modules available for different replanning needs which can be activiated and used without programming and only by modifying the configuration file This guide will mostly focus on functionality available in a standard release of MATSim that can be used just by making changes to the configuration file and not on enhancing MATSim by programming custom functionality 10 Chapter 3 Terminology Author s of this document Kai Nagel In many cases MATSim uses a terminology that is different from the mainstream terminology In most cases the reason is that the concepts are only similar but not identical and we wanted to avoid the confusion of using the same term for aspects that are similar but not identical The following attempts some commented approximate translations from more standard teminology to MATSim terminology 3 1 Choice set plan set of an agent During MATSim iterations agent accumulate plans This can be interpreted as building a choice set over time A problem is that the process that generates the choice set at this point is not systematic
48. ivities should have to such that tiyp to is large large slope hard to drop Activities of the same priority should have ty such that ty to is the same between those activities Overall something like weight X ttyp to or to X tiyp weight where large weight implies a large importance of the activity This was as said never tried since activity dropping was never systematically tried It also does not fix the problem discussed later that different activities might have different resistance against making them shorter since this is U this is beta t x with the above utl fct activities are shortened proportional to their typical duration To make matters worse there is currently the convention that negative values of U are set to atthe stitchine together of the last to the first activity of a day and if we give these a very negative score then thet at 0 cannet be even smaller thanthis This has however the unfortunate consequence that the drift direction of the adaptive ales rithm once an activity duration has cone below ty coos to zere duration The above was modified in nov 13 see https matsim atlassian net browse It now takes the slope at t to and extends it with that slope to the left 6 6 Outlook Outlook What would we want for our next generation utl function Some wishes from my perspective e Curvature at typical duration can be calibrated e Slope at U
49. list e g modes car bike taxi Note that all links are uni directional If a road can be travelled in both directions two links have to be defined with alternating to and from attributes see links with id 2 and 3 in the example given in Listing 5 2 Thus the network can be seen as a directed graph 5 13 Demand The travel demand for MATSim is described by the agents day plans The full set of agents is typically the population hence the filename population xml Alternatively plans xml is also commonly used in MATSim as the population file essentially contains a list of day plans The population contains the data in a hierarchical structure as shown in Listing 5 3 e The population contains a list of persons e Each person contains a list of plans e Each plan contains a list of Activities and Legs Exactly one plan per person is marked as selected The selected plan of each agent is the plan that gets executed by the mobility simulation During the replanning stage a different plan might get marked as being selected A plan can contain a score as attribute The score gets calculated and stored in the plan during the scoring stage after the plan was executed by the mobility simulation The list of activities and legs in each plan describe the planned actions by each agent Activities have a type assigned and have except for the last activity in a day plan an end time defined There are some exceptions where activities ha
50. loper 8 3 households Status probably ready but nowhere used Maintainer Christoph Dobler An option to read a households file into matsim I kn don t know the exact status 8 4 network Status ok 8 5 network time dependent Status works for vsp Maintenance G Lammel VSP MATSim provides the opportunity to model time dependent aspects of the network explicitly For each link in the network basic parameters i e freespeed number of lanes and flow capacity can be varied over the time So it is possible to model accidents or the like One particular area for this technique is the modeling of evacuation scenarios In the case of an evacuation simulation the network has time dependent attributes For instance large scale inundations or conflagrations do not cover all the endangered area at once In MATSim this time varying aspects are modeled as network change events A network change event modifies parameters of links in the network at predefined time steps The network change events have to be provided in a XML file to MATSim A sample network change event XML file could look like lt xml version 1 0 encoding UTF 8 gt lt networkChangeEvents xmlns http www matsim org files dtd xmlns xsi http www w3 org 2001 XMLSchema instance xsi schemaLocation http www matsim org files dtd http www matsim org files dtd networkChangeEvents xsd gt lt networkChangeEvent startTime 03 06 00 g
51. lume gt lt volume h 22 val 21 0 gt lt volume gt lt volume h 23 val 22 0 gt lt volume gt lt volume h 24 val 23 0 gt lt volume gt lt count gt lt counts gt 22 5 Building New Scenarios 5 2 Units and Conventions Used 5 2 Units and Conventions Used 5 2 1 Units MATSim tries to make as few assumptions about actual units as is possible but at some locations it cannot be done without any In general MATSim expects similar values e g all distances to be in the same unit wherever they are used In the following the most important expected units are listed in a short overview Distance Distance units are most prominently used in links length They should be specified in the same unit that the coordinate system uses This allows MATSim to use simple triangulation e g with the nodes coordinates to calculate beeline distances As most of the typically used projected coordinate systems see Sec use meters as unit of distance this is the most common used unit of distance in MATSim Time While MATSim supports an hour minute second notation in several places internally it uses seconds as the default time unit This implies that for example link speeds must be specified in distance per second typically m s One noteable exception from this rule are scoring parameters where MATSim expects values per hour This is due to the fact that most behavioral parameters like value of time are typically
52. m default scoring function utility function 6 2 Mathematical version 6 2 2 Arriving late The normally negative penalty of arriving late is late V Plate tlate gt where tate is the amount of time the agent arrived late and Pate is a normally negative slope 6 2 3 Traveling The normally negative penalty of traveling is leg V Btrav mode trav Bm gt Mtrav Barsiinade alr Bm Ydist mode 2 dirav ae Viransfer where tiray is the time spent traveling e Birav mode 18 a normally negative or zero see below slope Merav is the change of the monetary position caused by the travel normally negative e g a toll or a fare Bm is a normally positive slope this is the marginal utility of money dtray is the distance of the leg e Gdistymode is a normally negative slope e Ydist mode 18 a normally negative distance cost rate e Viransfer 18 a transfer penalty e g incurred in public transit systems The negative effects of distance can be included both directly as a marginal disutility and indirectly as a distance cost rate The first is presumably more applicable for a mode with mostly physical exercise such as walk whereas the latter is presumably more applicable for a mechanical mode such as car Bicycle may incur both The notation deliberately uses leg and not trip since this allows to decompose a trip into multiple legs all with separate scoring contributions 6 2 4 Utility of t
53. o calibrate the MATSim parameters from a survey was made This is documented here unfortunately in German Two results were 29 6 The MATSim default scoring function utility function 6 5 Interpretation of the logarithmic utility of performing e The estimated parameters all have the same order of magnitude as the MATSim default parameters the Vickrey parameters e The results with respect to traffic counts were not considerably different from before 6 5 Interpretation of the logarithmic utility of performing The so called Charypar Nagel scoring function is used in many MATSim studies It is called that way because there is an ancient paper where this scoring function was introduced It uses a logarithmic utility of time for activities U tiyp n a to I sometimes call try the typical duration The first derivative of U is beta at the typical duration dU d B teyp x dU e 4 p AX a typ Interpretation marginal utility of duration at typical duration is indep of activity type The second derivative of U at the typical duration is EU ae El tiyp 2 AU TZ B ttyp T ttyp An important consequence of this is that there is no separate free parameter to calibrate the curvature 2nd derivative at the typical duration 8 needs to be the same across all activities and ttyp is given by A second consequence is that to is largely irrelevant
54. on config block I kn oct 13 cannot say if this is still working 48 Chapter 10 Other configurable modules Modules are loosely defined by their corresponding entry in the config file They are also sorted in the same sequence which is done by the machine not by content Note that individual config options are often explained inside the config section of the log file Config file modules that just define files directories are as a tendency not explained here Note that strategy modules such as ReRoute Planomat are described in a separate section Maintainers are mentioned as far as possible but they are not responsible for answering arbitrary service requests 10 1 global Status indispensable Maintainer s Marcel Rieser Global information Arguably should be merged with controler section 10 2 controler Status indispensable Main author s of the code Marcel Rieser Maintainer s Marcel Rieser Author s of this document Marcel Rieser Javadoc www matsim org javadoc org matsim core controler package summary html Config Parameters www matsim org javadoc org matsim core controler package summary html controler_parameters In Brief Central module to run matsim Specifies for example the number of iterations 10 3 parallelEventHandling Status works for ivt and vsp Main author s of the code Rashid Waraich Maintainer s Rashid Waraich 49 10 Other configurable
55. one Each leg must have a transport mode assigned Optionally legs may have an attribute trav_time which describes the expected travel time for this leg For a leg to be simulated it must contain a route The format of a route depends on the mode of a leg For car legs the route lists the links that the agent has to travel along in the given order while for transit legs information about the stop locations and expected transit services are stored An agent starts a leg directly after the previous activity or leg has ended Depending on the mode the mobility simulation might handle the agent differently By default car and transit legs are well supported by the mobility simulation If the mobsim encounters a mode it does not know it defaults to teleportation In this case the agent is removed from the simulated reality and after the leg s expected travel time has passed re inserted at the agent s target location The population data format is one of the most central data structures in MATSim and might be a bit overwhelming at first Luckily to get started only a small subset must be known of it Listing 5 4 shows how a minimal population file could look like Most notably the following simplications can be made Each person needs exactly one plan The plan does not need to be selected or have a score Activities can be located just by their coordinates Activities should have a somewhat meaningful end time Legs only need a mode
56. or comparison Table 5 1 Files often used with MATSim In the following small examples of these files will be shown and the data they contain discussed 16 5 Building New Scenarios 5 1 Typical Input Data Sets 5 1 1 Configuration Listing 5 1 An example of a config xml lt xml version 1 0 gt lt DOCTYPE config SYSTEM http www matsim org files dtd config_v1 dtd gt lt config gt lt module name network gt lt param name inputNetworkFile value example network xml gt lt module gt lt module name plans gt lt param name inputPlansFile value example population xml gz gt lt module gt lt module name controler gt lt param name outputDirectory value output gt lt param name firstIteration value 0 gt lt param name lastIteration value 10 gt lt module gt lt config gt The configuration file often just referred to as config file or as config cml builds the connection between the user and MATSim It contains a list of settings which influence how the simulation behaves All configuration parameters are simple pairs of a parameter name and a parameter value The parameters are grouped into logical groups For example there is a group with settings related to the Controler like the number of iterations or there is another group with settings related to the simulation e g the end time of the simulation Listing 5 1 shows a very short example of
57. or large scale traffic simulation in MATSim paper presented at the h Swiss Transport Research Conference Ascona September 2009 Download from here 9 3 simulation Status deprecated as of sep 2014 Fits avas essentint the prediction ol he qreresinttation nti Ney 2010 Phe qui eas then forked otto father develepient Ca ftortateh thi fork ae ote note tee tite sehen He not_exactly _ nn 0 a a E See simulation AN ea ya 1I am sceptic if this statement is correct QSim goes through all active links which means that short empty link are also not considered by the QSim I would instead expect that the difference is rather for long links low resolution networks in conjunction with few vehicles e g small sample sizes kai oct 13 47 9 Synthetic realities aka mobsims 9 4 External mobsim Status unknown 9 4 External mobsim Status unknown Main author s of the code Marcel Rieser Author s of this document Kai Nagel There used to be an option to start an external mobsim This still seems to be there but the syntax is a bit awkward lt module name controler gt lt param name mobsim value null gt lt module gt lt module name simulation gt lt param name externalExe value lt path to executable gt gt lt module gt Le you need to specify that you are not using the queue Simulation but then set a parameter inside the queue Simulati
58. ource If travelling is considered more pleasant than doing nothing it may actually be positive Even when it is positive the overall marginal utility of travel time mUTT S can still remain negative The better known marginal value of travel time savings is obtained by dividing these values by the marginal utility of money ttyp i VTTS mUTTS _ Boers er Berasmsee y Brent rem Bm Bm Bm 6 3 Calibration of the scoring function A possible approach is as follows 1 Set scale BrainExpBeta to 1 0 This is the default This is normally a positive value 2 Set Bmoney marginalUtilityOfMoney to whatever is the prefactor of your monetary term in your mode choice logit model If you do not have a mode choice logit model set to 1 0 This is normally a positive value since having more money normally increases utility 3 Set Boers performing to whatever is the prefactor of car travel time in your mode choice mode probably with a sign change see below If you do not have a mode choice logit model set to 6 0 This is normally a positive value since performing an activity for more time normally increases utility 4 Set Pit car traveling to 0 0 It is important to understand this Even if this value is set to zero traveling by car will be implicitly punished by the so called opportunity cost of time If you are traveling by car you cannot perform an activity and thus you are marginall
59. param name ptSpeedFactor value 2 0 gt lt param name undefinedModeSpeed value 13 88888888888889 gt lt param name walkSpeed value 0 8333333333333333 gt lt module gt This works pretty reliably for car It also works for other modes as pseudo mode in the following way e Travel times for these other modes are not obtained from true routing on the corresponding network but by some estimates These are configured by the parameters above but no guarantee that they work consistently e The mobsim will not execute such routes on the network but teleport them e The scoring works quite normally since it just takes the time from leg start to leg end by mode It is possible to route such legs on the network by using a different router It is not possible to physically execute a leg in the mobsim if it has not been routed before That is the capability of the router needs to be gt the capability of the mobsim Makes sense if one thinks about it 7 3 2 TimeAllocationMutator Status works Simple module that shifts activity end times randomly Good time shifts will be selected through the matsim plans selection mechanism The maximum extent of the shifts can be configured see the config section of the log file The usage of the module is configured in the strategy section 7 3 3 ChangeSingleLegMode Status works Maintainer s Marcel Rieser 35 7 Strategy Modules
60. path to config xml Note that the commands should always be written on one line they are shown in this tutorial on multiple lines only for readability As an example on Linux this could look like java Xmx512m cp home username matsim matsim jar org matsim run Controler home user matsim input config xml On Mac OS X it could look like this java Xmx512m cp Users username matsim matsim jar org matsim run Controler Users user matsim input config xml On Windows an example command could be java Xmx512m cp C MATSim matsim jar org matsim run Controler C MATSim input config xml Such a command exists of multiple parts e java tells the system that you want to run Java e Xmx512m tells Java that it should use up to 512 MB of memory This is typically enough to run the small examples For larger scenarios you might need more memory Xmx3g would allow Java to use up to 3 GB of memory e cp path to matsim jar tells Java where to find the MATSim code e org matsim run Controler tells Java which class think of entry point it should start running In most cases the default MATSim Controler is the class you ll need to run simulations e path to config xml tells MATSim which config file is to be used In the case you have relative paths in your config file make sure to start MATSim in the correct directory It will interpret all relative paths based on the directory where the Java process got started and no
61. pendently identifiable from estimation For simulation they are hence somewhat arbitrary The default value for BrainExpBeta is 2 for historical reasons but it should be set to 1 if the parameters of the scoring function are estimated rather than hand calibrated Possible future development Default value of BrainExpBeta should be set to 1 instead of 2 3 6 Multinomial logit ExpBetaPlanSelector Comments e The main problem is that one needs to keep in mind how the choice set is constructed see above e In most simulations we use ExpBetaPlanChanger instead which is a Metropolis Monte Carlo variant of making multinomial logit draws Possible future developments None of this is ideal since after the introduction of a policy it is not clear which behavioral switches are due to the policy and which are due to sampling In theory one should have unbiased samples before and after the introduction of the policy but at this point this is not implemented and it is also computationally considerably more expensive than what is done now 3 7 Network loading mobsim mobility simulation physical sim ulation The standard terminology has the network loading on the supply side In my KN s view the simulation of the physical system is not the supply side but what in economics is called technology This can for example be seen in the fact that lane changing is part of the mobsim but
62. ram name useLanes value true gt lt module gt lt module name network gt pata name laneDefinitionsFile value PATH TO FILE gt lt module gt Capacity interpretation of lanes In principle a lane is similar to the representation of a link in the queue model The exit flow capacity of a lane is capacity_value_of_ lane flow_capacity_factor where e the capacity value of the lane is given in the laneDefinitions_v2 0 xsd compatible input file 44 9 Synthetic realities aka mobsims 9 1 qsim Status works e the flow capacity factor is given in the qsim config group The storage capacity of a lane is length_of_lane no_of_represented_lanes effective_cell_size storage_capacity_factor where e the length of the lane is calculated by the value of the lt startsAt meterFromLinkEnd 10 gt element within the lt lane gt element of the laneDefinitions_v2 0 xsd file format If the lane ends at the end of the link its length is simply the meterFromLinkEnd value Ifthe lane leads to other downstream lanes its length is calculated from the distance between the position on the link the downstream lanes start from and the meterFromLinkEnd value of the lane e the number of represented lanes is the value of the number attribute of the lt representedLanes gt element of the laneDefinitions_v2 0 xsd file format e the storage capacity factor is given in the qsim con
63. rg javadoc org matsim counts package summary html Config Parameters www matsim org javadoc org matsim counts package summary html counts_parameters In Brief MATSim can compare the simulated traffic volumes to traffic counts from the real world Counts is the module that allows to e read some external file with traffic flow counts e compare them automatically to the counts generated inside the matsim simulation e submit the result to a kmz file which can be displayed inside google earth There is a feature to re scale the counts before comparison for example if you are running the simulations with a 10 sample Comparison Data Prepare a file containing the real world traffic counts The file e g named counts xml must follow the xml format defined in An example of such a file can be found in MATSim at examples equil counts100 xml The file contains the following information 8 MATSim input data MATSim containers 8 2 facilities Status user version work in progress e For each link in the network for which traffic count information is available a count element must exist The count element specifies the link it refers to in its attribute loc_id In addition an optional cs_id can be stored that may for example refer to the original id of the counting station for tracking back the origin of the data e In each count element 1 to 24 volume elements can appear Each volume element contains the measur
64. ributes required to describe the action like the agent s id a link id an activity type or other data In theory it should be possible to replay the mobility simulation just by the information stored in the events While plans describe the agents plan for a day the events describe how the agents day actually was according to the simulation As the events are so basic each agent typically generates hundreds of events during one execution of a mobility simulation In total the number of events generated by a mobility simulation can easily reach a million or more with large simulations even generating more than a billion events But as the events really describe all the details from the execution of the plans it is possible to extract mostly any kind of aggregated data one is interested in Practically all analyses of MATSim simulations make use of events to calculate some data Examples of such analyses are the average duration of an activity average trip duration or distance mode shares per time window number of passengers in specific transit lines and many more The scoring of the executed plans makes use of events to find out how much time agents spent at activities or for travelling Some replanning modules might make use of events as well The router for example can use the information contained in events to figure out what links are jammed at certain times and route agents around that jam when creating new plans 2 4 Customizabil
65. rk file Normally set to one hour e the flow capacity factor is given in the qsim config group The storage capacity of a link is length_of_link number_of_lanes_of_link effective_cell_size storage_capacity_factor where e the length of the link is given by the link entry in the network file e the number of lanes of the link is given by the link entry in the network file 42 9 Synthetic realities aka mobsims 9 1 qsim Status works e the effective cell size is given at the beginning of the links section in the network file Normally set to 7 5m e the storage capacity factor is given in the qsim config group e There is also an effective lane width also at the beginning of the links section in the network file normally set to 3 75m See below for its use This is most useful if you have something else than cars for example pedestrians Let us assume an effective lane with of 0 4m and an effective cell size also of 0 4m This would lead to a maximum density of 0 4 0 4 0 16persons m not totally unrealistic If now a link has an area of 200m and a length of 50m then it would obtain number_of_lanes area length effective_lane_width 200 50 0 4 10 Note that in the end the lane width is not used by the dynamics all the meaning is subsumed in the number of lanes The storage capacity comes out as storage_capacity number_of_lanes length effective_cell_siz
66. rks Main author s of the code Rashid Waraich Maintainer s Rashid Waraich Author s of this document Rashid Waraich Overview JDEQSim Java Deterministic Event Driven Queue Based Simulation has the following properties and features e it is based on a discrete event simulation model e traffic simulation is based on a queue model for streets FIFO first in first out e deadlock prevention is achieved by squeezing vehicles e gaps generated at front of queue propagate backwards with a speed called gapTravelSpeed result ing in a more realistic traffic model Usage Insert a new module called JDEQSim into the config XML file All parameters are optional and have default values shown below never the less it could be helpful to know their meaning and physical units lt module name JDEQSim gt lt param name endTime value 00 00 00 pe lt param name flowCapacityFactor value 1 0 gt lt param name storageCapacityFactor value 1 0 gt lt param name minimumInFlowCapacity value 1800 gt lt param name carSize value 7 5 gt lt param name gapTravelSpeed value 15 0 gt lt param name squeezeTime value 1800 gt lt module gt The mobsim type now also needs to be defined in the controler section of the config file See comments in config dumps in logfiles The end Time defines the time of the last event of the simulation If it is set to 00 00 00 no end time is defined
67. s an example of a typical scoring function Time increases to the right The agent first is at home then travels to the workplace then travels to lunch etc The workplace opening time is different from the time span during which the agent is at the workplace The distance of the blue dots to the zero line is what the synthetic persons receive at the end of each stage e a positive utility from the home activity e a negative utility from travelling to work e nothing from waiting until the workplace opens e a positive utility from the work activity e a negative utility from travelling to lunch e etc One can observe the following e extending an activity increases the utility e however the marginal increase of utility decreases with increasing utility duration e doing nothing brings neither reward nor penalty e travelling incurrs negative utility 6 2 Mathematical version The mathematical version of the scoring function is V Ya vie y we f 1 j 6 2 1 Performing activities The normally positive reward of performing activity i is VPI Boers ttyp i Miltperf to for toerf tag 4 where e tperf is how long the agent performed the activity e tip is its typical duration e g 8 hours for work 12 hours for home and e perf is a slope e to is more confusing than it looks and has less influence than one may think and therefore we ignore it for the time being 26 6 The MATSi
68. t lt link refId 12487 gt lt link refId 12489 gt lt link refId 12491 gt lt freespeed type absolute value 0 0 gt lt networkChangeEvent gt lt networkChangeEvent s gt This change event would set the freespeed of the links 12487 12489 12491 to 0 m s at 03 06 am all values have to be provided in SI units These values are valid until the next network change event if there is any changes the freespeed of link 12487 12489 12491 again In this example the freespeed would be set to an absolute value It is also possible to take the old freespeed value and multiply it by a factor For dividing the old freespeed value by 2 the corresponding line of the network change event XML file would look like lt freespeed type scaleFactor value 0 5 gt Besides changing the freespeed one could also change the number of lanes lt lane type absolute value 2 0 gt Or the flow capacity lt flowCapacity type absolute value 0 0 gt To make use of the network change events one has to define it in the MATSim config file Therefore the following two lines have to be added in the network section of the config file lt param name timeVariantNetwork value true gt 40 8 MATSim input data MATSim containers 8 6 vehicles Status probably reads the file correctly but does nothing else lt param name inputChangeEventsFile value path_to_ change_events_file gt Now one
69. t have any such issues before the simulation is started a special 21 5 Building New Scenarios 5 1 Typical Input Data Sets validation routine is available java Xmx512m cp path to matsim jar org matsim pt utils TransitScheduleValidator path to transitSchedule xml path to network xml If run this validator will print out a list of errors or warnings if any are found or show a message that the schedule appears to be valid 5 1 5 Counts MATSim provides funtionality to compare traffic volumes from your simulation to real world values The Counts infrastructure allows to compare the traffic volumes on links on an hourly basis Listing shows an example of a counts zml input file required to do traffic count comparisons It starts with a header containing general descriptive information about the counts including a year to describe how current the data is Next for each link having real world counts data the hourly volumes can be specified The network link is referenced by the loc_id attribute in the example it s link 2 The attribute cs_id counting station identifier can be used to store an arbitrary description of the counting station Most often it is used to note the original real word counting station to simplify future data comparison The hourly volumes specified by the hour of the day counting starts with hour 1 and its value are optional That is not for every hour a value must be given If for a coun
70. t where the config file is located 15 Chapter 5 Building New Scenarios Author s of this document Marcel Rieser Starting a new scenario our term for the application of MATSim to a region area can appear quite cumbersome at the first glace as a lot of data preparation may be required This chapter gives first an overview of the input data typically required for running a MATSim scenario and then gives examples how such data is generated for existing scenarios 5 1 Typical Input Data Sets MATSim uses multiple files to store the different types of data it uses for the simulation Tab gives an overview over files you may typically encounter when working with MATSim Not all files are always required Very simple simulations can be run only with a configuration file and the description of the network and the population containing the agents plans For additional functionality e g for the simulation of public transport additional files might be required config xml configuration options for MATSim network xml description of the road network population xml the travel demand i e the list of agents and their day plans facilities xml information about locations where activities can be performed transitSchedule xml information about transit stop locations and transit services transitVehicles xml description of the vehicles used for public transport services counts xml hourly volumes from real world counting stations f
71. this is in my view not a supply side aspect Possible future developments May switch to network loading if there is agreement that this is a better name 12 3 Terminology 3 8 Stationary relaxed 3 8 Stationary relaxed stationary means that the probability distribution does not shift any more However as long as innovation is still switched in on MATSim new routes new times the result is not truly stationary Thus we avoid the word If innovation is switched off the result is indeed a statinary process but limited to the set of plans that every agent has at that point in time Possible future developments not clear Minimally publications should be precise lt module name strategy gt lt iteration after which module will be disabled oa gt lt param name ModuleDisableAfterIteration_1 value null gt lt param name ModuleDisableAfterIteration_2 value 950 gt lt probability that a strategy is applied to a given person gt lt param name ModuleProbability_1 value 0 9 gt lt param name ModuleProbability_2 value 0 1 gt lt name of strategy gt lt param name Module_1 value ChangeExpBeta gt lt param name Module_2 value ReRoute gt lt maximum number of plans per agent gt lt param name maxAgentPlanMemorySize value 4 gt lt module gt The above means e StrategyModule ReRoute inno
72. ting station data is only available for certain hours of the day e g only during peak hours it is possible to omit the other hours from the XML listing Listing 5 7 An example of a counts xml lt xml version 1 0 encoding UTF 8 gt lt counts xmlns xsi http www w3 0rg 2001 XMLSchema instance xsi noNamespaceSchemaLocation http matsim org files dtd counts_v1 xsd name test desc test counting stations year 2014 gt lt count loc_id 2 cs_id 005 gt lt volume h 1 val 10 0 gt lt volume gt lt volume h 2 val 1 0 gt lt volume gt lt volume h 3 val 2 0 gt lt volume gt lt volume h 4 val 3 0 gt lt volume gt lt volume h 5 val 4 0 gt lt volume gt lt volume h 6 val 5 0 gt lt volume gt lt volume h 7 val 6 0 gt lt volume gt lt volume h 8 val 7 0 gt lt volume gt lt volume h 9 val 8 0 gt lt volume gt lt volume h 10 val 9 0 gt lt volume gt lt volume h 11 val 10 0 gt lt volume gt lt volume h 12 val 11 0 gt lt volume gt lt volume h 13 val 12 0 gt lt volume gt lt volume h 14 val 13 0 gt lt volume gt lt volume h 15 val 14 0 gt lt volume gt lt volume h 16 val 15 0 gt lt volume gt lt volume h 17 val 16 0 gt lt volume gt lt volume h 18 val 17 0 gt lt volume gt lt volume h 19 val 18 0 gt lt volume gt lt volume h 20 val 19 0 gt lt volume gt lt volume h 21 val 20 0 gt lt vo
73. tions e Stay away from schedule based pt until you really understand what you are doing e Treat schedule based pt as a mechanical model which just transports people For this completely switch off mode choice e Make a support contract with senozon Write a joint funding proposal with the MATSim group in Berlin or in Zurich but I haven t asked them This needs to provide funding for us that is large enough to do research and not just support 6 4 Default values for the Charypar Nagel scoring function As explained here the MATSim scoring function has under some circumstances actual dura tions near typical durations some similarity to the Vickrey scenario The typical parameters of the Vickrey scenario are em 6 sravel 12 and Plate 18 For MATSim as explained in Sec 6 2 4 this translates into Bperf 6 Btravel 6 and Plate 18 These are the parameters that were for a lack of estimated parameters introduced into the precursor of MATSim approximately in 2006 These parameters are multiplied with the beta_brain parameter which can be seen as a sepa rately configurable logit scale parameter A useful setting for this parameter was determined via systematic tests concerning the stability of the iterations see here As a next step an infrastructure to compare MATSim simulations with real world traffic counts was set up Only after that infrastructure was there an attempt t
74. tlined above agents can modify the plans from the initial demand to try to come up with new variants of the plan that lead to higher scores The main concept of the optimization process 2 Overview 2 3 Mobility Simulation Events follows the principles of so called co evolutionary algorithms Evolutionary algorithms typically maintain a set of candidates which are evaluated using a fitness function New candidates are generated and evaluated If they have a bad fitness they are discarded If they have a good fitness another candidate with a worse fitness is removed from the set of candidates and the new candidate is added to the set This is repeated until no new good candidates are found after some tries MATSim implements an evolutionary algorithm for each agent As all agents are optimized using their own evolutionary algorithm the whole system is called a co evolutionary algorithm The set of candidates corresponds to the set of plans each agent has New candidates are generated in the replanning stage by making a copy of an existing plan and modifying the copy The fitness evaluation is done by scoring the execution of the plan Thus the replanning stage in MATSim corresponds to the generation of new candidates of evolutionary algorithms while the execution and scoring of plans corresponds to the evaluation of the fitness of the candidates The repetition With each iteration the goal is that the average score of the executed plans in
75. traffic related aspects of the network e the length of the link typically in meters see Sec 5 2 e the flow capacity of the link i e the number of vehicles that can pass the link typically in vehicles per hour 17 5 Building New Scenarios 5 1 Typical Input Data Sets Listing 5 2 An example of a network xml lt xml version 1 0 encoding utf 8 gt lt DOCTYPE network SYSTEM http www matsim org files dtd network_v1 dtd gt lt network name example network gt lt nodes gt lt node id 1 x 0 0 y 0 0 gt lt node id 2 x 1000 0 y 0 0 gt lt node id 3 x 1000 0 y 1000 0 gt lt nodes gt lt links gt lt link id 1 from 1 to 2 length 3000 00 capacity 3600 freespeed 27 78 permlanes 2 modes car gt lt link id 2 from 2 to 3 length 4000 00 capacity 1800 freespeed 27 78 permlanes 1 modes car gt lt link id 3 from 3 to 2 length 4000 00 capacity 1800 freespeed 27 78 permlanes 1 modes car gt lt link id 4 from 3 to 1 length 6000 00 capacity 3600 freespeed 27 78 permlanes 2 modes car gt lt links gt lt network gt e the freespeed is the maximum speed at which vehicles are allowed to travel along the link typically in meters per seconds e the number of lanes permlanes available in the direction specified by the from and to nodes e the list of modes allowed on the link This is a comma separated
76. tunately the naming in the code is different from the naming in the config file 33 7 Strategy Modules 7 2 Selectors e strategy in config file StrategyManager or set of strategies in code e strategy module in config file PlanStrategy in code e There is a PlanStrategyModule in the code it corresponds to what was called strategy module element in the description above It is not clear which combinations of these modules can be used together Depending on required features special variants sometimes need to be used This has not yet been sorted out Also see 7 2 Selectors Selectors are pure plan selecting i e non innovative strategy module 7 2 1 BestScore Status works Will select the plan with the highest score The score will be updated after execution of the mobsim Disadvantage Will never try again plans that obtained a bad score from a fluctuation e g a rare traffic jam It is therefore recommended to either use this in conjunction with a small probability for RandomPlanSelector or to use ChangeExpBeta 7 2 2 ChangeExpBeta Status works RECOMMENDED Choice model between plans that converges to a logit distribution The scores S are taken as utilities the betaBrain parameter from the config file is taken as the scale parameter As equation _ exp Pbrain Si dl 2 eXP Bbrain Sy 7 2 3 KeepLastSelected Status works Pure plan selecting i e non innovative strategy module
77. us works Maintainer s Michael Zilske This replanning module randomly picks one of the plans of a person and changes its mode of transport By default the supported modes are driving a car and using public transport Only one mode of transport per plan is supported For using different modes for sub tours on a single day see the SubtourModeChoice module Also this module is able to optionally respect car availability The replanning module is configured like this where the value parameter lists the modes of transport from which the module randomly chooses lt module name changeLegMode gt lt param name modes value car pt bike walk gt lt param name ignoreCarAvailability value false gt lt module gt Add the module to the replanning strategy like this lt param name Module_X value ChangeLegMode gt lt param name ModuleProbability_X value 0 1 gt Replace the X with the number you assign to this module For some more details on the syntax of this section see here By default the simulation will handle legs with modes different from car by using a delayed teleportation If another behavior is requested e g detailed simulation of public transport this needs to be manually configured for the simulation This module can be used with the detailed simulation of public transport by changing the line lt param name Module_X value ChangeLegMode gt to lt param name Module_X v
78. ust mobsim the agents plans get executed along each other in a representation of the physical world This means that the agents and their vehicles are moved around in the network the infrastructure in the real world During this execution of the plans agents can influence each other by taking up space in the virtual world If too many agents want to travel on the same road at a specific time they generate a traffic jam in the mobility simulation This is why the agents plans only describe their intentions for a day but do not actually describe their day Scoring Once the execution of the plans finished the agents plans are evaluated based on their experienced execution The exact scoring function is customizable but generally time spent at activities increases the score while time spent travelling decreases it Agents stuck in a traffic jam thus loose points while agents with short and quick trips are able to accumulate more score points by performing activities for a longer time period Replanning As mentioned in the execution stage agents can be influenced by others and for example get stuck in a traffic jam During the replanning stage agents may modify their plans actually they modify copies of the plans see Sec in order to try to avoid situations in the mobility simulation that lead to bad scores Typical examples of such modifications are the modification of activity end times effectively changing the start time of the
79. vative Module produces plans with new routes is switched off after iteration 950 e StrategyModule ChangeExpBeta non innovative Module switches between existing plans is never switched off e If an agent ever ends up with more than 4 plans plans are deleted until she is back to 4 plans Deletion goes via a PlanSelectorForRemoval which affects the choice set and thus more thought needs to go into this Currently the plan with the worst score is removed 3 9 Utility lt gt score Configuration At least when using random utility models such as multinomial logit aka Exp Beta the score has the same function as the deterministic utility 13 Chapter 4 Running MATSim Author s of this document Marcel Rieser MATSim comes without any easy to use graphical interface Instead it uses text files for configuration and uses a command line interface to start simulations This chapter shows you how to start MAT Sim simulations in a number of different computing environments 4 1 Prerequisites MATSim is written in Java a programming language which allows to write applications that run on a large variety of computers As scenarios can become quite large they may consume large amounts of memory RAM Very large scenarios should be run on dedicated servers with enough resources In general to use MATSim the following requirements must be met e Java SE 7 must be installed The latest version of the Java
80. ve a duration instead of an end time Such activities are often automatically generated by routing algorithms and are thus not described in this guide To describe the location where an activity takes place the activity is either assigned a coordinate by giving an x and y attribute value or has a link assigned which describes from which link the activity can be reached As the simulation requires the link attribute the Controler calculates the nearest link for a given coordinate in the case the attribute is missing and only an x and y coordinate value is given or any activity 18 5 Building New Scenarios 5 1 Typical Input Data Sets Listing 5 3 An example of a population xml lt xml version 1 0 encoding utf 8 gt lt DOCTYPE population SYSTEM http www matsim org files dtd population_v5 dtd gt lt population gt lt person id 1 gt lt plan selected yes score 93 2987721 gt lt act type home link 1 end_time 07 16 23 gt lt leg mode car gt lt route type links gt 1 2 3 lt route gt lt leg gt lt act type work link 3 end_time 17 38 34 gt lt leg mode car gt lt route type links gt 3 1 lt route gt lt leg gt lt act type home link 1 gt lt plan gt lt person gt lt person id 2 gt lt plan selected yes score 144 39002 gt ldots lt plan gt lt person gt lt population gt Legs describe how agents plan to travel from one location to the next
81. www spatialreference org is of great use Search on this website for your coordinate system e g for WGS84 UTM Zone 8N for the northern hemisphere UTM Zone 8 to find a list of matching coordinate systems along with their EPSG codes For some operations MATSim must know the coordinate system your data is in Some analyses may create output to be visualized in Google Earth for example where the coordinates need to be converted back to WGS84 The coordinate system used by your data can be specified in the config file lt module name global gt lt param name coordinateSystem value EPSG 32608 gt lt module gt This allows MATSim to work with your coordinates and convert them whenever needed 5 4 A Minimum Example TODO MR 5 5 Reusing Existing Data Data from other modelling tools like PTV Visum or EMME can be partially reused Converting the network topology is often possible with little work For Visum that converts the network into MATSim s format But note that this only converts the network topology location of nodes and links with a limited set of attributes Due to the different working of other modelling tools e g the use of capacity constraint functions to describe links attributes might be differently interpreted by MATSim e g link capacities are hard limits in MATSim vs part of a CPR function in other tools leading to manual edits being needed after the initial conversion ODO MR check CPR an
82. y losing perf Sometimes also called the utility of time as a resource 5 Set all other marginal utilities of travel time by mode relative to the car value E g if your logit model says something like 2 6 h gt ttear T h ttpt Different groups have different systems this is mine although I took ideas from Michael Balmer 28 6 The MATSim default scoring function utility function 6 4 Default values for the Charypar Nagel scoring function then Boerf 6 Ptt car 0 and Bit pt 1 If you do not have a mode choice logit model set all Bit mode travelingXxx values to zero i e same as car 6 Set the distance cost rates monetaryDistanceCostRateXxx to plausible values if you have them For the time being this needs to be negative which is not entirely plausible but it is the way it is 7 Use the alternative specific constants Cinode constantXxx to calibrate your modal split This is however not completely simple One needs to run iterations and look at their end and especially for modes with small shares one needs to have innovation switched off early enough near the end of the iterations If you end up having your modal split right but its distance distribution not you probably need to look at the different mode speeds In our experience this works better than using the By mode for this Calibrating schedule based pt currently goes beyond what can be provided here recommenda

Download Pdf Manuals

image

Related Search

Related Contents

Acco 60075  COLOR TELEVISION  Samsung MM-DG35 Bruksanvisning  Dane-Elec CompactFlash Card 80X 1024 MB  Bedienungsanleitung  Polar RS100 Manual do utilizador  Avaya 14.xx User's Manual  Guía del usuario  LST SG70-1 User's Manual    

Copyright © All rights reserved.
Failed to retrieve file