A Research - Applying swarm intelligence for public transportation, NetLogo model and additional proprietary tools such as map drawer and NetLogo extension for parsing input files.
The datasets for cities roads graph and transportation data was taken from this repository: https://github.com/bstabler/TransportationNetworks, which is an update to Dr. Hillel Bar-Gera's TNTP project.
Ideally, for our research needs, each city folder contains the following files:
<City>_trips.tntp
- contains a sampled origin-destination data.<City>_node.tntp
- contains the bus stations list (each can be either an origin or/and a destination).<City>_net.tntp
- contains the list of existing roads between those nodes (from the node.tntp file).
- Download and install Net Logo 6.1.0
- Download this repo as zip or clone using:
git clone https://github.com/roiedanino/SwarmPubTran.git
- The extension jar for NetLogo is located under
SwarmPubTran/NetLogoExtensions/build/libs/read-origins.jar
, you can re-generate it using:gradlew fatJar
. - Inside the
<NetLogo installation folder>/extentions
create a folder namedread-origins
- Locate the extension jar file under
NetLogo 6.1.0/extensions/read-origins
- Launch NetLogo 6.1.0
- File -> Open -> Choose
SwarmPubTran/Net Logo Code/pubtran.nlogo
from the cloned repository. - Click the
reset
button on the top right corner - Change parameters (described later) as needed
- Click
setup
- Click
run
The net logo model receives paths for 3 files:
nodes-file-path
- a<City>_node.tntp
file (probably after some map-size-related transformation using the additional utility tools)map-path
- a city road map png image, drawn (green over grey colored to be compatible with the model) by theMap Drawer
utility, which will be described in more detail later.trips-path
- a<City>_trips.tntp
file, the amount of passengers (ants) going from a specific origin to a specific destination will be relative to the amount in the file, while considering thenumber-of-passengers
as the total amount of passengers
color-sensitivity
-- changes the intensity of the pheromones, so it will be easier to adjust it as needed while the model is running.
Parameters related to determining the "Natural Conditions" for the model, in general the model moves ants from different origin pixels to their destination pixels, anywhere an ant passes its "eating" some of the grass in that pixel, making that pixel a little bit darker, while diffusing 2 kinds of pheromones:
- 'stay-away' - tells the other ants to stay away and prevent collisions
- 'come-here' - tells the other ants to come near, just like real ants attraction pheromones
Research Parameter | Description | Example Value |
---|---|---|
growth-decelration |
Determines how slow the grass grows back after being "eaten" by an ant | 0.001 |
chipping-factor |
The precentage of the grass left after an ant passes over it | 0.995 |
stay-away-incr |
Determines the addition factor of the stay-away pheromone | 0.2 |
stay-away-decay |
Determines the multiplication factor of the stay-away pheromone | 0.99 |
come-here-incr |
Determines the addition factor of the come-here pheromone | 0.045 |
come-here-decay |
Determines the multiplication factor of the come-here pheromone | 0.5 |
Map Drawer is a Java application for converting origin/destination and road files in TNTP format to a png image with patch colors suitable for reading by the NetLogo environment. The application would list the available cities from the data-set of your choosing, you may also choose the result image size, while 100 works seems to work the best, the graph would scale automatically as big as it can fit. The application also creates a new fixed coordinates file which fits the scaled graph and suite the NetLogo coordinate system.
- After clicking on the
Load Coords
button, the image file is saved into the selected dataset-city folder along with the "fixed" coordinates (node.tntp), the new fixed coordinates adjusted to the entered image size.
Check Box | Maps it works with |
---|---|
Flip Vertically | SiouxFalls, Berlin Maps, Chicago Maps |
Enumerate Nodes | SiouxFalls, Berlin Maps, Chicago Maps |
Enumerate Roads | SiouxFalls, Berlin Maps, Chicago Maps |
Color Buslines | SiouxFalls - Required data was taken from Moovit's website |