Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tdata4 #162

Open
wants to merge 604 commits into
base: ansi
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
604 commits
Select commit Hold shift + click to select a range
0124027
Test btimetext.
skinkie Mar 6, 2015
3f1acac
Revert "If rtime >= RTIME_THREE_DAYS it means we have less than an ho…
skinkie Mar 6, 2015
3d0f0c5
RTIME_THREE_DAYS check.
skinkie Mar 6, 2015
c873433
Tests the polyline code. This shows that the current code has a problem.
skinkie Mar 6, 2015
d45271e
The polyline offsets should have been based on the rounded integer va…
skinkie Mar 6, 2015
23479d4
Update the comments in the JSON renderer.
skinkie Mar 6, 2015
894bb5e
Cleanup JSON code.
skinkie Mar 7, 2015
15606ac
Tests for JSON rendering.
skinkie Mar 7, 2015
dfdc106
Try to install check-0.9.14 from sources in travis.
skinkie Mar 7, 2015
54eff41
Update .travis.yml
skinkie Mar 7, 2015
1dc3f35
This seams to be a typo.
skinkie Mar 7, 2015
7ae82e7
Add latlon distance prototype
skinkie Mar 7, 2015
b22f4a8
Initial tests for the geometry.c source.
skinkie Mar 7, 2015
652e8cb
Add an street_network_init. Maybe rename it to street_network_reset l…
skinkie Mar 9, 2015
7cd6edf
Add some informal comments to street_network.c
skinkie Mar 9, 2015
2569c18
Fix bug in street_network.c, thanks to TTD.
skinkie Mar 9, 2015
452f35a
Street_network.c unittest
skinkie Mar 9, 2015
60f2d37
Set travis to Europe/Amsterdam
Mar 9, 2015
0a71052
Add function to retrieve duration for given SP
koch-t Mar 9, 2015
c4730c9
Add test for streetnetwork duration function
koch-t Mar 9, 2015
92823d8
Redo router_result.c , only render optimal advices
koch-t Mar 9, 2015
d672a28
Undo disable check_plan_invariants
koch-t Mar 9, 2015
493e97b
Don't repeat the same search twice forward
koch-t Mar 9, 2015
62ac269
REmove virtual storage since we now use the plan as storage
koch-t Mar 10, 2015
c04c539
Make function intialize plan_t
koch-t Mar 10, 2015
411c703
Fix undefined behaviour error
koch-t Mar 10, 2015
54f35f5
Remove exired todo
koch-t Mar 10, 2015
2a4f8ba
Use stoparea/req coord in polyline
koch-t Mar 10, 2015
ef5b929
Use generated plan to make narrow bandwith reversals
koch-t Mar 11, 2015
3d9a3d5
Filter out fewer tranfers that depart too late
koch-t Mar 11, 2015
a2fa3b3
Remove debug code
koch-t Mar 11, 2015
00412c5
Deduplicate router_requests
koch-t Mar 11, 2015
489e243
typedef struct rdx_edge to rdx_edge_t
skinkie Mar 11, 2015
f3052da
Implement radixtree_find_exact en radixtree_find_prefix
skinkie Mar 11, 2015
3c7cacc
Some simple tests for the radixtree.
skinkie Mar 11, 2015
4cf5d27
Support block_id in GTFS loader
koch-t Mar 11, 2015
743dbcc
Kill the timetable v3 exporter
koch-t Mar 11, 2015
7cf123d
Fix fusio_db importer
koch-t Mar 11, 2015
be0cd03
remove timetable3 references
koch-t Mar 11, 2015
00d062b
Correct {JP,VJ}NONE
koch-t Mar 12, 2015
f292fe8
Check for valid symetric interlines
koch-t Mar 12, 2015
24e4a8a
Correct vj offset vs index
koch-t Mar 12, 2015
f52c72b
Fix VJ interline export and add safeguards
koch-t Mar 12, 2015
434a797
First draft of interlining
koch-t Mar 12, 2015
6be545b
Fail hashgrid_init if malloc fails and remove tdata.h include.
skinkie Mar 12, 2015
4634fd6
Handle the deallocation of coords used in hashgrid, within the scope …
skinkie Mar 12, 2015
ac06e28
Add newline to fprintf
skinkie Mar 13, 2015
2f953fb
Move geometry declarations to header file.
skinkie Mar 13, 2015
237ea76
@Skywave I don't know why this fails and different numbers pop up. Ne…
skinkie Mar 13, 2015
e5594e0
Validate router_request_to_epoch returns the correct cal_day.
skinkie Mar 13, 2015
9433a7c
TODO: 28 is now used as rest value if cal_day exceed tada->n_days. Fo…
skinkie Mar 13, 2015
92c22fd
More router_request_t tests.
skinkie Mar 13, 2015
60cc1d7
Fix arrive-by search
koch-t Mar 13, 2015
b2f7ebb
Fix Coverity CID 107151
skinkie Mar 13, 2015
a6d2d30
Fix Coverity CID 107145, 107146, 107147. Cast round to uint64_t prior…
skinkie Mar 13, 2015
b9c1acb
Our compliments go to Coverity for catching this copy/paste bug. Cove…
skinkie Mar 13, 2015
0ab44cb
First working prototype of interlining
koch-t Mar 13, 2015
b566aed
Fail hashgrid_init if malloc fails and remove tdata.h include.
skinkie Mar 12, 2015
080e1b7
Handle the deallocation of coords used in hashgrid, within the scope …
skinkie Mar 12, 2015
90d6ce1
Add newline to fprintf
skinkie Mar 13, 2015
df30710
Move geometry declarations to header file.
skinkie Mar 13, 2015
f6df830
@Skywave I don't know why this fails and different numbers pop up. Ne…
skinkie Mar 13, 2015
2887d6f
Validate router_request_to_epoch returns the correct cal_day.
skinkie Mar 13, 2015
45ccf0a
TODO: 28 is now used as rest value if cal_day exceed tada->n_days. Fo…
skinkie Mar 13, 2015
e9bcd2a
More router_request_t tests.
skinkie Mar 13, 2015
ca2e1ed
Fix arrive-by search
koch-t Mar 13, 2015
5cd18ce
Merge remote-tracking branch 'origin/tdata4_momt' into tdata4_momt_in…
koch-t Mar 13, 2015
a382b20
Fix the JSON string output, properly encode special characters, by Co…
skinkie Mar 13, 2015
1eaa055
Add an additional header validation might address Coverity CID 107149…
skinkie Mar 13, 2015
5608134
Temporary workaround for "serviceDate" that now shows an "estimate" b…
skinkie Mar 13, 2015
c7cb9a2
Third draft of interlining, 90% works now
koch-t Mar 14, 2015
18055ed
Fix interline symetric validation
koch-t Mar 14, 2015
3f82865
Fix interline symetric validation
koch-t Mar 14, 2015
506c3ad
Sort VJ's in block
koch-t Mar 14, 2015
e2ab724
remove walk short_name for stay_on leg render
koch-t Mar 14, 2015
62853c8
Re-enable disabled ban's for dev and allow extension chaing
koch-t Mar 14, 2015
eace155
Fix serviceday
koch-t Mar 14, 2015
ec04d3e
Fix OTP render for interlining
koch-t Mar 14, 2015
b1d5b73
Merge remote-tracking branch 'origin/tdata4_momt' into tdata4_momt_in…
koch-t Mar 14, 2015
b8164e3
Replace old interline
koch-t Mar 14, 2015
78f56b1
Swap for ANSI compatability
koch-t Mar 14, 2015
8729605
Make ansi compliant
koch-t Mar 14, 2015
185021e
Replace VLA for ANSI
koch-t Mar 14, 2015
2e4bacd
Restore behaviour on sub-optimal targets
koch-t Mar 14, 2015
1c3ab60
Init legs on rendering
koch-t Mar 14, 2015
173ebd5
Merge pull request #186 from bliksemlabs/tdata4_momt_interlining
Mar 15, 2015
fe499f9
Fix itinerary rendering/reversal for arrive_by
koch-t Mar 15, 2015
3b399e6
Fix onboard routing in full_reversal
koch-t Mar 15, 2015
21f3cd4
Fix infinite loop error
koch-t Mar 15, 2015
a232948
Swap transfer leg on arrive-by
koch-t Mar 15, 2015
b1f442c
Cull much too early less-transfer itineraries
koch-t Mar 15, 2015
8f428d4
Allow stopareas to be rendered as place.
skinkie Mar 15, 2015
2d1f2dd
Merge branch 'tdata4_momt' of http://github.com/bliksemlabs/rrrr into…
skinkie Mar 15, 2015
487c1ed
Fix reversal issue
koch-t Mar 15, 2015
deede3b
Fix number of transfers
koch-t Mar 15, 2015
847363f
Fix similar issue on arrive-by rendering
koch-t Mar 15, 2015
b38e15f
n_rides is not off by one of the number of transfrs
koch-t Mar 15, 2015
3877854
Fix issue with board_time of vj-extensions on arrive-by seachs
koch-t Mar 15, 2015
c595eb0
During vj-extension do not disembark at first and last stop
koch-t Mar 15, 2015
478889a
Stop segfault on direct journey
koch-t Mar 16, 2015
9296b9c
Only allow only-walk itineraries in round=0
koch-t Mar 16, 2015
33cf61f
Dont reverse requests without transit
koch-t Mar 16, 2015
0ed84de
Return only walk itin's in result
koch-t Mar 16, 2015
598ee26
Check for JP_NONE
koch-t Mar 16, 2015
5037eb8
Ignore less than optimal transit itineraries on very close by from/to…
koch-t Mar 16, 2015
5f98174
ANSI compliance fix
koch-t Mar 16, 2015
b03fabc
Remove debug print
koch-t Mar 16, 2015
44cc16b
Only board on allowed stops
koch-t Mar 16, 2015
869d0b0
Take the first possiblity to transfer
koch-t Mar 16, 2015
bd80174
Fix typo
koch-t Mar 16, 2015
3356fcb
Add post-rendering phase to check interlines
koch-t Mar 16, 2015
944ec2c
Fix postrender interlline
koch-t Mar 16, 2015
e037d2a
Add continue
koch-t Mar 16, 2015
55c78aa
Merge branch 'tdata4' into tdata4_momt
koch-t Mar 16, 2015
eba32e1
Merge branch 'tdata4' into tdata4_momt
koch-t Mar 16, 2015
aa7d05c
Merge pull request #185 from bliksemlabs/tdata4_momt
Mar 16, 2015
516d150
Fix hashgrid initialization
PaulWagener Mar 17, 2015
37f7593
Fix router_route_first_departure()
PaulWagener Mar 17, 2015
040e52f
Merge pull request #187 from PaulWagener/fix_first_departure
Mar 17, 2015
7f03580
Added unit tests for hashgrid fix
PaulWagener Mar 17, 2015
311fac5
Merge pull request #188 from PaulWagener/fix_hashgrid
skinkie Mar 18, 2015
ebb362c
Silence tdata coherency check
PaulWagener Mar 19, 2015
eddf625
Fix off-by-one iterating over router->servicedays
PaulWagener Mar 19, 2015
2b7a938
Merge pull request #189 from PaulWagener/fix_small
Mar 19, 2015
b586539
Fix reverse-recycling, data never written
koch-t Mar 20, 2015
86bd761
Pointer
koch-t Mar 20, 2015
efa82cf
Pass i_rev as argument
koch-t Mar 20, 2015
5cdf4df
Fix typo
koch-t Mar 20, 2015
ac1a19d
Break recycle loop on finding equivalent
koch-t Mar 20, 2015
9c5ffbe
Rebuild origin equals for multi-point origins
koch-t Mar 20, 2015
90cc023
Deduplicate requests in +router_request_reverse_plan
koch-t Mar 20, 2015
6170342
Deduplicate router-requests (i_rev)
koch-t Mar 20, 2015
a667dfc
Don't look at number of transfers higher than requested
koch-t Mar 20, 2015
0a4ed54
Fix compilation on disabling vj-banning
koch-t Mar 21, 2015
9199798
Move calls to banned_vj and vj_attributes to after we found a suitabl…
koch-t Mar 21, 2015
4a1f9b0
Merge pull request #190 from bliksemlabs/tdata4_lesscals
Mar 21, 2015
5abcb25
Break extend cycles
koch-t Mar 23, 2015
955daa9
Fix macro for JP banning
koch-t Mar 23, 2015
6a1126d
Implementation of Operator Filtering by --operator=name
skinkie Mar 25, 2015
0136182
Remove wrong banning code when bitmask is used to ban.
skinkie Mar 25, 2015
cd3a122
Fix null-terminating bug with strncpy()
PaulWagener Mar 24, 2015
2244761
Fix initialization of realtime journey patterns
PaulWagener Mar 24, 2015
988412a
Fixed handling of absolute times in the following night in realtime u…
PaulWagener Mar 25, 2015
46a8ea2
Fix vehicle_journey_extend() segfaulting on uninitialized memory for …
PaulWagener Mar 25, 2015
e0b9ddf
Fix RRRR_DEBUG function definitions for radixtree.c
skinkie Mar 25, 2015
239119a
Cast to jpidx_t to silence warning
PaulWagener Mar 25, 2015
1537b99
Silence the compiler.
skinkie Mar 25, 2015
d1b806d
Add slack to vj_stoptimes and vjs_in_journey_pattern
PaulWagener Mar 28, 2015
e590f49
Update Bliksem Labs to Bliksem Labs B.V.
skinkie Mar 31, 2015
dd852b5
Re-add sentinel journey_pattern
PaulWagener Apr 3, 2015
9e8df90
Add support for realtime trips that are added to the schedule
PaulWagener Apr 3, 2015
bade2e6
Merge branch 'tdata4' of github.com:bliksemlabs/rrrr into fix_realtime
PaulWagener Apr 3, 2015
8f226a8
Explicitly make ANSI a C project.
skinkie Apr 13, 2015
6e6b02d
n_stop_point_names is not used anymore
skinkie Apr 14, 2015
943f710
Fix args parsing.
skinkie Jul 24, 2015
0d1ff29
Verify if that branch allows to scan all stops.
skinkie Jul 24, 2015
50299e1
Introduce lineidx_t routeidx_t start with some advances for tdata_jit.c
skinkie Jul 24, 2015
d21451a
mktime -> timegm, add const on the right places
skinkie Jul 24, 2015
f5439b5
Fix proper in C89
skinkie Jul 24, 2015
beec744
Add const where required.
skinkie Jul 24, 2015
3c07e55
This commit adds the boiler plate code and tests for tdata_jit.c.
skinkie Jul 24, 2015
6fa5c07
Implement a small helper to make a sorted rtime_t list unique.
skinkie Jul 25, 2015
5891bd6
uint32_t to jpidx_t as return value.
skinkie Jul 25, 2015
a1d1203
Returns all possible departure times for a stop.
skinkie Jul 25, 2015
73a4638
In some cases we want to use the infrastructure to go from Lat/Lon or…
skinkie Jul 25, 2015
6f689ff
Really bad argument parsing.
skinkie Jul 25, 2015
35db5c8
Implement operator banning.
skinkie Jul 25, 2015
dec54af
Introduce bitset_count.
skinkie Aug 4, 2015
ec3efa3
Compare the float values for testing using fabs.
skinkie Aug 4, 2015
7da1fe9
We test the hashgrid better, but it stell has rough edges and todo's.
skinkie Aug 4, 2015
534726f
Cast some uint32_t values to smaller types.
skinkie Aug 4, 2015
52e0205
Include config.h and make set_max_time static.
skinkie Aug 4, 2015
ded9cee
Fix off_t vs size_t warnings with stat and mmap
skinkie Aug 4, 2015
2c203b7
Silence compiler warning.
skinkie Aug 4, 2015
6494135
Newline after debug output.
skinkie Aug 4, 2015
42da0a6
Make code that uses dynamic memory allocation conditationally depende…
skinkie Aug 4, 2015
b3a7288
More instructions for OSX
skinkie Aug 5, 2015
5c5fc62
Introduce plan.c and plan.h, for now allow to return a bitset of oper…
skinkie Aug 6, 2015
2a579f3
Fix the warnings with protobuf-c generation.
skinkie Aug 6, 2015
c1030a3
Some extra files required for tests.
skinkie Aug 6, 2015
c1e6ac8
Cleanup config.h and introduce a configurable result size for plans.
skinkie Aug 7, 2015
7d43678
Don't show realtime options when we have compiled with MMAP.
skinkie Aug 7, 2015
2a1fd45
Hide definitions realtime definitions when code is not compiled with it.
skinkie Aug 7, 2015
0e2bb46
Whitespace.
skinkie Aug 7, 2015
8aa6a75
TODO: optimise bit counting
skinkie Aug 7, 2015
15e0ce5
Calculate the global maximum time to replace set_max_time.
skinkie Aug 7, 2015
1b81bb5
Codestyle / readibility
skinkie Aug 7, 2015
9b1b88d
Index code should not change the tdata_t structure, thus make it const.
skinkie Aug 7, 2015
acaa99e
Validate our max_time calculator in a test.
skinkie Aug 7, 2015
b8e0461
Profiling API
skinkie Aug 8, 2015
b90eb98
Implement a wrapper for plan_render which allows to dynamically pick …
skinkie Aug 8, 2015
0819c32
Conditional compilation for plan_render_* saves up to 10k.
skinkie Aug 8, 2015
0c6690b
index_journey_pattern.h should already have been added.
skinkie Aug 8, 2015
393d035
First iteration in moving plan.* code.
skinkie Aug 8, 2015
69860f5
Removes some abstraction.
skinkie Aug 8, 2015
2f42331
Split the sources for the library and the cli.c executable.
skinkie Aug 24, 2015
1af1c1a
First attempt for python module.
skinkie Aug 24, 2015
1327ae8
Add some documentation on the Python C API code.
skinkie Aug 24, 2015
81f0677
In bitset_black add code to only set the bits that belong to our
skinkie Aug 26, 2015
005a7a8
Fix null-terminating bug with strncpy()
PaulWagener Mar 24, 2015
352dc4c
Merge remote-tracking branch 'PaulWagener/fix_realtime' into tdata3
skinkie Aug 26, 2015
4c6497c
Some minor changes to guard that a bitset with 0 chunks wouldn't crash.
skinkie Aug 26, 2015
1272823
Some additional tests for bitset_count
skinkie Aug 26, 2015
747a91f
Implement referencing stops by internal list indices.
skinkie Sep 5, 2015
3a781ae
Export the stop list from timetable.dat
skinkie Sep 5, 2015
beabffd
-g add debug information as well
skinkie Sep 5, 2015
27ff247
search_streetnetwork only uses tdata_t not the entire router_t.
skinkie Sep 5, 2015
2e3de73
Consistently use street_network
skinkie Sep 6, 2015
15bebc5
Move the street_network search code from api.c to router_request.c
skinkie Sep 7, 2015
2993041
Add const storage
skinkie Sep 7, 2015
d44159a
\0 terminate the JSON output
skinkie Sep 12, 2015
a769539
Fix whitespace
skinkie Sep 15, 2015
2a2a6ae
Fix #195
skinkie Sep 15, 2015
7429380
Fix whitespace.
skinkie Sep 15, 2015
a0a4429
Revert "Fix whitespace."
skinkie Sep 15, 2015
56e7a89
Fix whitespace, and only that.
skinkie Sep 15, 2015
dbaf6c4
Revert "Fix whitespace, and only that."
skinkie Sep 15, 2015
47b4036
Fix whitespace.
skinkie Sep 15, 2015
b348b3c
Fix issue #195
skinkie Sep 16, 2015
61cdcfd
Fix whitespace
skinkie Sep 16, 2015
edb19dc
We may use the restrict keyword for compilers that support it in C89 …
skinkie Sep 16, 2015
d5ae8bb
To initialise tmode_t empty, we introduce m_none.
skinkie Sep 16, 2015
ae4e3f4
Fix operator query from python interface
skinkie Sep 20, 2015
9fd743b
Python: kwlist should be NULL terminated
skinkie Sep 20, 2015
096b2f5
Python: introduce mode filter
skinkie Sep 20, 2015
3fb4da2
Python: change the default routing to router_route_first_departure
skinkie Sep 20, 2015
27b05ac
Python: change router.stops() output to GTFS stops.txt style (column …
skinkie Sep 20, 2015
3f6fb41
Python: introduce router.validity()
skinkie Sep 20, 2015
d40ae13
Option to select the different routing api's. UNSTABLE API!
skinkie Oct 6, 2015
1c0a86c
Allow to set walk_speed, walk_slack, walk_max_distance from python.
skinkie Oct 7, 2015
409292b
router_one_itinerary addition
skinkie Oct 11, 2015
28cd12f
Add const to tdata_t * where appropriate.
skinkie Oct 25, 2015
901b485
Report the validity of the timetable upon startup.
skinkie Oct 25, 2015
d08cb76
rtime_t is 16bits, thus must be << 16
skinkie Oct 26, 2015
3f0d6a1
Add documentation
koch-t Nov 21, 2015
a2ebdbc
rrtiimetable Remove unused parameters
koch-t Nov 21, 2015
c531833
Include documentation
koch-t Nov 21, 2015
6fda752
Use apt to download check
koch-t Nov 21, 2015
6630f34
Move to new travis infra
koch-t Nov 21, 2015
34df456
Attempting to fix travis
koch-t Nov 21, 2015
1a2ceb0
Stilling fixing travis
koch-t Nov 21, 2015
a8e0544
Add pkg-config depedency
koch-t Nov 21, 2015
4e74faa
Set travis to trusty
koch-t Nov 21, 2015
e7d860a
Switch back to apt
koch-t Nov 21, 2015
46b80e4
Make function call
koch-t Feb 7, 2016
a7bd68b
Reflect hashgrid_streetnetwork.c rename in Makefile
koch-t Feb 7, 2016
4dbac4a
6 items in bitset are set, so why do we expect 5? Fix test
koch-t Feb 7, 2016
d3187a3
Disable inputs that require timetable4.dat
koch-t Feb 7, 2016
470c26f
Use memset to zero out our bitset
Feb 17, 2016
4fa33c8
include <string.h> for memset
Feb 17, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
language: c

sudo: required
dist: trusty

compiler:
- gcc
- clang

cache:
directories:
- $HOME/.cache/pip

addons:
apt:
packages:
- libprotobuf-c0-dev
- protobuf-c-compiler
- check
- pkg-config

before_install:
- sudo apt-get update >/dev/null
- sudo apt-get -q install check libprotobuf-c0-dev protobuf-c-compiler
- export TZ=Europe/Amsterdam
- sudo apt-get update -qq
- sudo apt-get install -qq libprotobuf-c0-dev protobuf-c-compiler check pkg-config

before_script:
- pip install pytz python-dateutil --user `whoami`
- export PATH=$HOME/.local/bin:$PATH
- mkdir build
- cd build
- cmake ..

script:
- make
- ctest
- python -m unittest discover ../rrtimetable/rrtimetable "*_tests.py"

env:
global:
Expand Down
49 changes: 40 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
cmake_minimum_required(VERSION 2.8.4)
project(ansi)
project(ansi C)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wall -ansi -pedantic -ggdb3 -DRRRR_VALGRIND -DRRRR_STRICT")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wall -std=c89 -pedantic -g -ggdb3 -DRRRR_VALGRIND -DRRRR_STRICT -march=native")
if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Weverything")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Weverything -Wno-reserved-id-macro -Wno-documentation-unknown-command -Wno-c99-extensions -Wno-padded -Wno-disabled-macro-expansion -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments")
endif("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")

if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Weverything -Werror")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Weverything")
endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")

set_source_files_properties(gtfs-realtime.pb-c.c PROPERTIES COMPILE_FLAGS -Wno-missing-variable-declarations)

SET(PROTO_FILES
${CMAKE_CURRENT_SOURCE_DIR}/gtfs-realtime.proto
Expand All @@ -33,18 +34,35 @@ add_custom_command(OUTPUT ${PROTO_HDRS} ${PROTO_SRCS}
ENABLE_TESTING()

set(SOURCE_FILES
api.c
api.h
bitset.c
bitset.h
cli.c
config.h
geometry.c
geometry.h
gtfs-realtime.pb-c.c
gtfs-realtime.pb-c.h
hashgrid.c
hashgrid.h
index_journey_pattern_points.c
index_journey_pattern_points.h
index_journey_patterns.c
index_journey_patterns.h
index_vehicle_journeys.c
index_vehicle_journeys.h
json.c
json.h
linkedlist.c
linkedlist.h
plan.c
plan.h
plan_render_otp.c
plan_render_otp.h
plan_render_text.c
plan_render_text.h
polyline.c
polyline.h
radixtree.c
radixtree.h
router.c
Expand All @@ -56,23 +74,36 @@ set(SOURCE_FILES
router_result.c
router_result.h
rrrr_types.h
set.c
set.h
string_pool.c
string_pool.h
tdata.c
tdata.h
tdata_io_v3.h
tdata_io_v3_dynamic.c
tdata_io_v3_mmap.c
tdata_jit.h
tdata_jit.c
tdata_io_v4.h
tdata_io_v4_dynamic.c
tdata_io_v4_mmap.c
tdata_realtime_alerts.c
tdata_realtime_alerts.h
tdata_realtime_expanded.c
tdata_realtime_expanded.h
tdata_validation.c
tdata_validation.h
street_network.h
street_network.c
hashgrid_street_network.c
util.c
util.h)

include_directories(/usr/local/include)

link_directories(/usr/local/lib)
link_libraries(m)
link_libraries(protobuf-c)

add_executable(cli ${SOURCE_FILES})
add_executable(cli ${SOURCE_FILES} cli.c)
add_library(rrrr ${SOURCE_FILES})

add_subdirectory(tests)
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014, Bliksem Labs.
Copyright (c) 2014–2015, Bliksem Labs.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand Down
30 changes: 19 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
CC=clang

debug:
$(CC) -DRRRR_STRICT -DRRRR_TDATA_IO_DYNAMIC -DRRRR_FAKE_REALTIME -DRRRR_VALGRIND -DRRRR_BITSET_64 -Wextra -Wall -ansi -pedantic -DRRRR_DEBUG -DRRRR_INFO -DRRRR_TDATA -ggdb -O0 -lm -lprotobuf-c -o cli cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_realtime_expanded.c tdata_realtime_alerts.c tdata_io_v3_dynamic.c radixtree.c gtfs-realtime.pb-c.c geometry.c router_dump.c hashgrid.c
$(CC) -DRRRR_STRICT -DRRRR_TDATA_IO_MMAP -DRRRR_FAKE_REALTIME -DRRRR_VALGRIND -DRRRR_BITSET_64 -Wextra -Wall -ansi -pedantic -DRRRR_DEBUG -DRRRR_INFO -DRRRR_TDATA -ggdb -O0 -lm -lprotobuf-c -o cli cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_realtime_expanded.c tdata_realtime_alerts.c tdata_io_v3_mmap.c radixtree.c gtfs-realtime.pb-c.c geometry.c router_dump.c hashgrid.c
$(CC) -DRRRR_STRICT -DRRRR_TDATA_IO_DYNAMIC -DRRRR_FAKE_REALTIME -DRRRR_VALGRIND -DRRRR_BITSET_64 -Wextra -Wall -ansi -pedantic -DRRRR_DEBUG -DRRRR_INFO -DRRRR_TDATA -ggdb -O0 -lm -lprotobuf-c -o cli cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_realtime_expanded.c tdata_realtime_alerts.c tdata_io_v4_dynamic.c radixtree.c gtfs-realtime.pb-c.c geometry.c router_dump.c hashgrid.c plan_render_text.c polyline.c json.c plan_render_otp.c api.c set.c string_pool.c hashgrid_street_network.c street_network.c
$(CC) -DRRRR_STRICT -DRRRR_TDATA_IO_MMAP -DRRRR_FAKE_REALTIME -DRRRR_VALGRIND -DRRRR_BITSET_64 -Wextra -Wall -ansi -pedantic -DRRRR_DEBUG -DRRRR_INFO -DRRRR_TDATA -ggdb -O0 -lm -lprotobuf-c -o cli cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_realtime_expanded.c tdata_realtime_alerts.c tdata_io_v4_mmap.c radixtree.c gtfs-realtime.pb-c.c geometry.c router_dump.c hashgrid.c plan_render_text.c polyline.c json.c plan_render_otp.c api.c set.c string_pool.c hashgrid_street_network.c street_network.c

valgrind:
$(CC) -DRRRR_STRICT -DRRRR_FAKE_REALTIME -DRRRR_VALGRIND -DRRRR_BITSET_128 -DNDEBUG -O0 -ggdb3 -Wextra -Wall -std=c99 -lm -lprotobuf-c -o cli cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_realtime_expanded.c tdata_realtime_alerts.c tdata_io_v3_dynamic.c tdata_io_v3_mmap.c radixtree.c gtfs-realtime.pb-c.c geometry.c hashgrid.c
$(CC) -I/usr/local/include -L/usr/local/lib -DRRRR_STRICT -DRRRR_FAKE_REALTIME -DRRRR_VALGRIND -DRRRR_BITSET_128 -DNDEBUG -O0 -ggdb3 -Wextra -Wall -std=c99 -lm -lprotobuf-c -o cli cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_realtime_expanded.c tdata_realtime_alerts.c tdata_io_v4_dynamic.c tdata_io_v4_mmap.c radixtree.c gtfs-realtime.pb-c.c geometry.c hashgrid.c plan_render_text.c polyline.c json.c plan_render_otp.c api.c set.c string_pool.c hashgrid_street_network.c street_network.c

prod:
$(CC) -DRRRR_BITSET_128 -DNDEBUG -O3 -Wextra -Wall -std=c99 -lm -lprotobuf-c -o cli cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_realtime_expanded.c tdata_realtime_alerts.c tdata_io_v3_dynamic.c radixtree.c gtfs-realtime.pb-c.c geometry.c hashgrid.c
$(CC) -DRRRR_BITSET_128 -DNDEBUG -O3 -Wextra -Wall -std=c99 -lm -lprotobuf-c -o cli cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_realtime_expanded.c tdata_realtime_alerts.c tdata_io_v4_dynamic.c radixtree.c gtfs-realtime.pb-c.c geometry.c hashgrid.c plan_render_text.c polyline.c json.c plan_render_otp.c api.c set.c string_pool.c hashgrid_street_network.c street_network.c api.c plan.c

ioscli:
$(CC) -isysroot /var/sdks/Latest.sdk -DRRRR_TDATA_IO_MMAP -DRRRR_BITSET_64 -DNDEBUG -O2 -Wextra -Wall -std=c99 -lm -o cli router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_io_v3_mmap.c radixtree.c geometry.c hashgrid.c cli.c
$(CC) -isysroot /var/sdks/Latest.sdk -DRRRR_TDATA_IO_MMAP -DRRRR_BITSET_64 -DNDEBUG -O2 -Wextra -Wall -std=c99 -lm -o cli router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_io_v4_mmap.c radixtree.c geometry.c hashgrid.c cli.c plan_render_text.c api.c set.c string_pool.c hashgrid_street_network.c street_network.c

ios:
$(CC) -isysroot /var/sdks/Latest.sdk -DRRRR_TDATA_IO_MMAP -DRRRR_BITSET_64 -DNDEBUG -O2 -Wextra -Wall -std=c99 -c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_io_v3_mmap.c radixtree.c geometry.c hashgrid.c
libtool -static -o ../librrrr.a router.o tdata.o tdata_validation.o bitset.o router_request.o router_result.o util.o tdata_io_v3_mmap.o radixtree.o geometry.o hashgrid.o

$(CC) -isysroot /var/sdks/Latest.sdk -DRRRR_TDATA_IO_MMAP -DRRRR_BITSET_64 -DNDEBUG -O2 -Wextra -Wall -std=c99 -c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_io_v4_mmap.c radixtree.c geometry.c hashgrid.c api.c set.c string_pool.c hashgrid_street_network.c
libtool -static -o ../librrrr.a router.o tdata.o tdata_validation.o bitset.o router_request.o router_result.o util.o tdata_io_v4_mmap.o radixtree.o geometry.o hashgrid.o api.o set.o string_pool.o hashgrid_street_network.o street_network.o

all:
protoc-c --c_out=. gtfs-realtime.proto
$(CC) -c -Wextra -Wall -ansi -pedantic set.c
$(CC) -c -Wextra -Wall -ansi -pedantic json.c
$(CC) -c -Wextra -Wall -ansi -pedantic string_pool.c
$(CC) -c -Wextra -Wall -ansi -pedantic polyline.c
$(CC) -c -Wextra -Wall -ansi -pedantic util.c
$(CC) -c -Wextra -Wall -ansi -pedantic linkedlist.c
$(CC) -c -Wextra -Wall -ansi -pedantic bitset.c
Expand All @@ -28,14 +31,19 @@ all:
$(CC) -c -Wextra -Wall -ansi -pedantic geometry.c
$(CC) -c -Wextra -Wall -ansi -pedantic radixtree.c
$(CC) -c -Wextra -Wall -ansi -pedantic tdata_validation.c
$(CC) -DRRRR_TDATA_IO_DYNAMIC -c -Wextra -Wall -ansi -pedantic tdata_io_v3_dynamic.c
$(CC) -DRRRR_TDATA_IO_MMAP -c -Wextra -Wall -ansi -pedantic tdata_io_v3_mmap.c
$(CC) -DRRRR_TDATA_IO_DYNAMIC -c -Wextra -Wall -ansi -pedantic tdata_io_v4_dynamic.c
$(CC) -DRRRR_TDATA_IO_MMAP -c -Wextra -Wall -ansi -pedantic tdata_io_v4_mmap.c
$(CC) -DRRRR_STRICT -c -Wextra -Wall -ansi -pedantic tdata.c
$(CC) -c -Wextra -Wall -ansi -pedantic street_network.c
$(CC) -c -Wextra -Wall -ansi -pedantic hashgrid_street_network.c
$(CC) -c -Wextra -Wall -ansi -pedantic tdata_realtime_alerts.c
$(CC) -c -Wextra -Wall -ansi -pedantic tdata_realtime_expanded.c
$(CC) -c -Wextra -Wall -ansi -pedantic router_request.c
$(CC) -c -Wextra -Wall -ansi -pedantic router_dump.c
$(CC) -c -Wextra -Wall -ansi -pedantic router.c
$(CC) -c -Wextra -Wall -ansi -pedantic router_result.c
$(CC) -c -Wextra -Wall -ansi -pedantic plan_render_text.c
$(CC) -c -Wextra -Wall -ansi -pedantic plan_render_otp.c
$(CC) -c -Wextra -Wall -ansi -pedantic api.c
# $(CC) -o cli -Wextra -Wall -ansi -pedantic cli.c stubs.c
$(CC) -lm -lprotobuf-c -o cli -Wextra -Wall -ansi -pedantic cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c router_result.c util.c tdata_realtime_alerts.c tdata_realtime_expanded.c tdata_io_v3_dynamic.c radixtree.c gtfs-realtime.pb-c.c geometry.c hashgrid.c
$(CC) -lm -lprotobuf-c -o cli -Wextra -Wall -ansi -pedantic cli.c router.c tdata.c tdata_validation.c bitset.c router_request.c street_network.c hashgrid_street_network.c router_result.c util.c tdata_realtime_alerts.c tdata_realtime_expanded.c tdata_io_v4_dynamic.c radixtree.c gtfs-realtime.pb-c.c geometry.c hashgrid.c plan_render_text.c polyline.c api.c set.c string_pool.c
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,20 @@ clang provides very good error messages and warnings. At present time gcc provid
1. **check**:
a unit testing framework for c. http://check.sourceforge.net/.

Dependencies for OSX
--------------------

1. **brew**
Install homebrew. http://brew.sh/

1. brew install protobuf-c check pkg-config cmake
Install the requirements to Cmake would work.

Building transit data
---------------------

The ansi branch currently does not include any build scripts. Your best bet for generating timetable v3 outside the realm of Bliksem Integration will be timetable.py from the realtime_expanded2 branch.
First, run `python gtfsdb.py input.gtfs.zip output.gtfsdb` to load your GTFS feed into an SQLite database.
Next, run `python transfers.py output.gtfsdb` to add distance-based transfers to the transfers table in the database.
Finally, run `python timetable.py output.gtfsdb` to create the timetable file `timetable.dat` based on that GTFS database.
If you just want to experiment with the code download: http://1313.nl/timetable.dat
Browse into rrtimetable/rrtimetable. Run `python gtfs2rrrr.py gtfs.zip` to create the timetable file `timetable4.dat` based on that GTFS database.
If you just want to experiment with the code download: http://1313.nl/timetable4.dat

Coding conventions
------------------
Expand Down Expand Up @@ -67,3 +72,9 @@ Been there done that
* We have attempted to split the journey_pattern_t in a core routing and a meta data struct. The resulting code was 4% slower.
* The original code for the router state was packed in one struct. It gave 10% improvement to split it in separate lists.
* In an attempt to prevent overflow checking (migrating rtime to 32bit) resulted in a serious performance degradation.

Conciderations
--------------

* In some places of the code the function argument has been made uint32_t to prevent overflowing on a multiplication later. Such example is initialize_transfers_full (router_t *router, uint32_t round) where the original uint8_t round is later multiplied with spidx_t.

Loading