Commit Graph

450 Commits (d70c8240563daaecf1e748539b7ae82868905e53)

Author SHA1 Message Date
Jonathan G Rennison 1cede8431f Linkgraph: Support running multiple jobs per spawned thread. 8 years ago
Jonathan G Rennison 84e61b690a Linkgraph: Changes to job scheduling algorithm.
This is to improve responsiveness of link graph updates, whilst
avoiding being blocked waiting for updates to complete.
Previously, large numbers of cheap jobs resulted in poor responsiveness
as it took a long time for jobs to cycle round.

Add 'linkgraph' debug category.
8 years ago
frosch 31f046bd9b (svn r27670) -Add: [FS#6471] Assign descriptive names to (GNU pthread) threads. (JGR) 8 years ago
frosch 3f75b8bca2 (svn r27670) -Add: [FS#6471] Assign descriptive names to (GNU pthread) threads. (JGR) 8 years ago
Jonathan G Rennison b8a89437a1 Enable use of atomic store/load on clang. 8 years ago
Jonathan G Rennison 9ea018abc5 Merge branch 'cargo_type_order' into jgrpp
# Conflicts:
#	src/order_base.h
#	src/order_gui.cpp
#	src/order_type.h
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/extended_ver_sl.h
#	src/vehicle_base.h
8 years ago
Jonathan G Rennison 6031cca2d7 Refactor Link Refresher cargo mask handling.
Add some separate helper functions.
Move cargo checks out of LinkRefresher::Run.
8 years ago
Jonathan G Rennison e90b266af1 De-duplicate cargo masking boilerplate using C++11. 8 years ago
Jonathan G Rennison 3507b51d9e Initial LinkRefresher support for cargo-specific links. 8 years ago
Jonathan G Rennison 7b56097f50 Merge branch 'master' into jgrpp
# Conflicts:
#	config.lib
#	src/linkgraph/demands.cpp
#	src/linkgraph/mcf.cpp
#	src/linkgraph/refresh.cpp
#	src/linkgraph/refresh.h
#	src/smallmap_gui.cpp
8 years ago
fonsinchen f769305d7d (svn r27614) -Codechange: Use a fixed array instead of a map for link refresher cargo capacities. (JGR) 8 years ago
fonsinchen ff96590312 (svn r27614) -Codechange: Use a fixed array instead of a map for link refresher cargo capacities. (JGR) 8 years ago
fonsinchen 022b284064 (svn r27613) -Codechange: Use a flat vector instead of a map in FlowEdgeIterator. (JGR) 8 years ago
fonsinchen a81b7a24a6 (svn r27613) -Codechange: Use a flat vector instead of a map in FlowEdgeIterator. (JGR) 8 years ago
fonsinchen e2426b22fa (svn r27612) -Codechange: Replace three uses of std::list with std::queue/vector. (JGR) 8 years ago
fonsinchen 6b2eed0a70 (svn r27612) -Codechange: Replace three uses of std::list with std::queue/vector. (JGR) 8 years ago
fonsinchen bcdae9a093 (svn r27611) -Codechange: Cache the calculated value of CapacityAnnotation 8 years ago
fonsinchen 8d5566651b (svn r27611) -Codechange: Cache the calculated value of CapacityAnnotation 8 years ago
Jonathan G Rennison 61ff4f5d97 Limit linkgraph recalc interval to minimum of 2 ticks.
The interval could otherwise fall to 1 tick at very high day lengths,
and low number of days interval, with recalc not scaled by day length
enabled.
9 years ago
Jonathan G Rennison 78cf5ca682 Add setting for linkgraph times to be in non daylength scaled days.
Savegame format change for link graph jobs.
Change link graph scheduler to support more than one operation
per day, on _date_fract ticks other than SPAWN_JOIN_TICK.
9 years ago
Jonathan G Rennison 3896952136 Join more than one link graph job at once where possible.
This can occur when the link graph recalculation times are changed.
In particular, if the duration or interval are reduced, the new jobs
will be delayed until the completion of the previous long job,
and then remain backlogged thereafter as jobs are dequeued at the same
rate as they are queued.
9 years ago
Jonathan G Rennison 548ea31e83 Fix compilation on gcc before 4.7 due to use of atomic builtins. 9 years ago
Jonathan G Rennison 58b6bf16c3 Linkgraph: Enable MCF custom allocator only for GCC 4.9+
Earlier compilers don't use std::allocator_traits to query allocators.
9 years ago
Jonathan G Rennison e22e1df939 Store annotation and node ID in set key, to reduce ptr derefs on sort.
Store the set iterator in the node, for faster erasing during forks.

Use a custom pool allocator to store set nodes contiguously.
9 years ago
Jonathan G Rennison 4534812b4f Use a fixed array instead of a map for link refresher cargo capacities. 9 years ago
Jonathan G Rennison 0fb79a8f15 Use a flat vector instead of a map in FlowEdgeIterator.
This reduced the cost of Dijkstra<CapacityAnnotation> by approx. 25%,
in a test profiling.
9 years ago
Jonathan G Rennison a3768d3a29 Label threads with a descriptive name where supported (pthreads). 9 years ago
Jonathan G Rennison 3a28be7841 Linkgraph: Replace three uses of std::list with std::deque/vector. 9 years ago
Jonathan G Rennison 564744d427 Cache the calculated value of CapacityAnnotation.
This is because CapacityAnnotation::Comparator::operator()
was appearing at the top of profiler output due to regenerating
the annotation value on every comparison when performing a set operation.
9 years ago
Jonathan G Rennison c6854afcef Pause the game instead of blocking when link graph jobs lag.
Check if the job is still running one date fract tick before it
is due to join and if so pause the game until its done.
This avoids the main thread being blocked on a thread join.
Show if pause is due to link graph job in status bar, update network
messages.
This does not apply for network clients.
9 years ago
frosch a14b836bf2 (svn r27178) -Fix [FS#5969]: Data race due to lazy initialisation of objects. 9 years ago
frosch 780e595933 (svn r27178) -Fix [FS#5969]: Data race due to lazy initialisation of objects. 9 years ago
rubidium 0c2f4bdc2b (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 10 years ago
rubidium d534c80e94 (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 10 years ago
rubidium 26574124b1 (svn r27002) -Fix-ish: replace some non-ASCII characters with ASCII characters, e.g. @þaram to @param 10 years ago
rubidium fddeeb5e49 (svn r27002) -Fix-ish: replace some non-ASCII characters with ASCII characters, e.g. @þaram to @param 10 years ago
fonsinchen 78df68e695 (svn r26891) -Codechange: Add methods to retrieve flows from a FlowStatMap 10 years ago
fonsinchen 9fdb88962f (svn r26891) -Codechange: Add methods to retrieve flows from a FlowStatMap 10 years ago
fonsinchen ce9d75f517 (svn r26889) -Feature: Predict links for station-autorefitting vehicles 10 years ago
fonsinchen 831fb254f6 (svn r26889) -Feature: Predict links for station-autorefitting vehicles 10 years ago
fonsinchen ef2caa02b2 (svn r26646) -Fix [FS#6041]: Save locations instead of distances in link graphs to reduce size. 10 years ago
fonsinchen 957f5ca117 (svn r26646) -Fix [FS#6041]: Save locations instead of distances in link graphs to reduce size. 10 years ago
rubidium fb9dbf30fa (svn r26580) -Codechange: s/GES_PICKUP/GES_RATING/ (it has nothing to do with actual pickup), s/acceptance_pickup/status/ (the enum isn't called GoodEntryStatus for a reason; it's not only acceptance and pickup anymore) 10 years ago
rubidium 89c25b955e (svn r26580) -Codechange: s/GES_PICKUP/GES_RATING/ (it has nothing to do with actual pickup), s/acceptance_pickup/status/ (the enum isn't called GoodEntryStatus for a reason; it's not only acceptance and pickup anymore) 10 years ago
fonsinchen b8381b6b25 (svn r26549) -Change: better estimation for link capacities during full load 10 years ago
fonsinchen 11d98f043e (svn r26549) -Change: better estimation for link capacities during full load 10 years ago
fonsinchen 547e8233be (svn r26484) -Change: Remove demand calculation based on tiles. 10 years ago
fonsinchen 56e8ea6dde (svn r26484) -Change: Remove demand calculation based on tiles. 10 years ago
rubidium 2be4215f43 (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 10 years ago
fonsinchen 8395c08738 (svn r26448) -Fix [FS#5970]: Avoid division by 0 when scaling flow values. 10 years ago
fonsinchen bef953a32c (svn r26448) -Fix [FS#5970]: Avoid division by 0 when scaling flow values. 10 years ago
fonsinchen d6097956a5 (svn r26445) -Change [FS#5961]: Draw links to match _settings_game.vehicle.road_side (M3Henry) 10 years ago
fonsinchen 782b9f01cb (svn r26445) -Change [FS#5961]: Draw links to match _settings_game.vehicle.road_side (M3Henry) 10 years ago
fonsinchen e4385f1423 (svn r26411) -Change [FS#5941]: Use better distance metric for link graph (MildaIV) 10 years ago
fonsinchen afd1263ce1 (svn r26411) -Change [FS#5941]: Use better distance metric for link graph (MildaIV) 10 years ago
fonsinchen 3570104d24 (svn r26393) -Fix: Update distances between link graph nodes when station sign is moved 10 years ago
fonsinchen 5d3fcce725 (svn r26393) -Fix: Update distances between link graph nodes when station sign is moved 10 years ago
fonsinchen ebcba0c0e3 (svn r26347) -Fix [FS#5898]: Make sure link graph jobs can delete themselves after SLA_NULL. 11 years ago
fonsinchen cc77d40336 (svn r26347) -Fix [FS#5898]: Make sure link graph jobs can delete themselves after SLA_NULL. 11 years ago
fonsinchen 537975b794 (svn r26341) -Fix [FS#5902]: Reroute cargo when automatic distribution is switched off. 11 years ago
fonsinchen 2945e76269 (svn r26341) -Fix [FS#5902]: Reroute cargo when automatic distribution is switched off. 11 years ago
fonsinchen 86ebb981f1 (svn r26331) -Fix: some inconsistencies regarding link graph (job) IDs. 11 years ago
fonsinchen e37656f2e5 (svn r26331) -Fix: some inconsistencies regarding link graph (job) IDs. 11 years ago
fonsinchen b31a1119fb (svn r26286) -Fix: Thoroughly erase dead flows. 11 years ago
fonsinchen 91407b924e (svn r26286) -Fix: Thoroughly erase dead flows. 11 years ago
fonsinchen 21a5571d07 (svn r26283) -Fix [FS#5878]: Prevent infinite recursion also in RefreshLinks. 11 years ago
fonsinchen b12bf124c7 (svn r26283) -Fix [FS#5878]: Prevent infinite recursion also in RefreshLinks. 11 years ago
fonsinchen cd68a2d8a5 (svn r26276) -Fix [FS#5874]: Don't spawn link graph jobs for link graphs with only one node 11 years ago
fonsinchen 95354136be (svn r26276) -Fix [FS#5874]: Don't spawn link graph jobs for link graphs with only one node 11 years ago
fonsinchen ced1bfa60f (svn r26266) -Fix [FS#5860]: Update smallmap overlay if player joins different company and make sure company masks are valid 11 years ago
fonsinchen b158c7d0fa (svn r26266) -Fix [FS#5860]: Update smallmap overlay if player joins different company and make sure company masks are valid 11 years ago
fonsinchen fea3a433b2 (svn r26166) -Fix: Scale flows only after mapping to avoid rounding errors. 11 years ago
fonsinchen ec492bfb77 (svn r26166) -Fix: Scale flows only after mapping to avoid rounding errors. 11 years ago
fonsinchen 05b50ada5c (svn r25963) -Fix [FS#5758]: Mixtures of old and new flows could create cycles. 11 years ago
fonsinchen 962d6d7e48 (svn r25963) -Fix [FS#5758]: Mixtures of old and new flows could create cycles. 11 years ago
fonsinchen b83b4ab4c2 (svn r25948) -Fix [FS#5796]: Make sure LinkRefresher doesn't delete the LinkGraph DeleteStaleLinks() is examining. 11 years ago
fonsinchen f6fd21e8e6 (svn r25948) -Fix [FS#5796]: Make sure LinkRefresher doesn't delete the LinkGraph DeleteStaleLinks() is examining. 11 years ago
frosch 795e94c87b (svn r25934) -Fix [FS#5793]: Do not access items from other pools in pool item destructors during pool cleaning. 11 years ago
frosch 2a16d139a2 (svn r25934) -Fix [FS#5793]: Do not access items from other pools in pool item destructors during pool cleaning. 11 years ago
fonsinchen 532744d9ee (svn r25912) -Fix [FS#5676]: Draw 'shared' links (involving neutral stations) as dashed lines and show them in every company's link graph overlay. 11 years ago
fonsinchen 1237e3c48c (svn r25912) -Fix [FS#5676]: Draw 'shared' links (involving neutral stations) as dashed lines and show them in every company's link graph overlay. 11 years ago
fonsinchen 3ebe7e3ef9 (svn r25909) -Fix (r25906): That simplification was a bit too much. 11 years ago
fonsinchen b5dd83e84f (svn r25909) -Fix (r25906): That simplification was a bit too much. 11 years ago
fonsinchen 9596352830 (svn r25908) -Fix: Some documentation for constructors of LinkRefresher::Hop. 11 years ago
fonsinchen 6c4e7ab51d (svn r25908) -Fix: Some documentation for constructors of LinkRefresher::Hop. 11 years ago
fonsinchen a7f07d50b7 (svn r25906) -Fix: Simplify condition logic in link refresher. 11 years ago
fonsinchen fb7ad743d2 (svn r25906) -Fix: Simplify condition logic in link refresher. 11 years ago
fonsinchen ca0486e410 (svn r25905) -Codechange: A more robust way of detecting loops during order prediction. 11 years ago
fonsinchen a9f6a1eeb7 (svn r25905) -Codechange: A more robust way of detecting loops during order prediction. 11 years ago
fonsinchen 8ef95222c9 (svn r25904) -Fix: add forgotten files 11 years ago
fonsinchen d3fa322087 (svn r25904) -Fix: add forgotten files 11 years ago
fonsinchen 97e1013863 (svn r25901) -Fix [FS#5675]: Check if any vehicles are still serving a link before deleting it. 11 years ago
fonsinchen 2f9c48b859 (svn r25901) -Fix [FS#5675]: Check if any vehicles are still serving a link before deleting it. 11 years ago
fonsinchen 7025a145e3 (svn r25899) -Change: Restrict flows if links are restricted and don't normally pick them anymore. 11 years ago
fonsinchen 6524849386 (svn r25899) -Change: Restrict flows if links are restricted and don't normally pick them anymore. 11 years ago
fonsinchen d0c610f0ec (svn r25898) -Codechange: Add second timestamp for 'restricted links' to all edges. 11 years ago
fonsinchen 29e987f3fc (svn r25898) -Codechange: Add second timestamp for 'restricted links' to all edges. 11 years ago
fonsinchen 6580fd4b8f (svn r25885) -Codechange: Keep paths sorted so that the ones with flow == 0 are in the back and don't have to be iterated over so often. 11 years ago
fonsinchen b3b460cae2 (svn r25885) -Codechange: Keep paths sorted so that the ones with flow == 0 are in the back and don't have to be iterated over so often. 11 years ago
fonsinchen 75cff48a5d (svn r25867) -Fix [FS#5764]: Shift dates on link graphs when using scenario editor date tool. 11 years ago
fonsinchen 5ab204c8a1 (svn r25867) -Fix [FS#5764]: Shift dates on link graphs when using scenario editor date tool. 11 years ago
frosch ec68541fb8 (svn r25861) -Fix [FS#5760]: Scale linkgraph legend according to text dimensions. 11 years ago
frosch 27a77d2c09 (svn r25861) -Fix [FS#5760]: Scale linkgraph legend according to text dimensions. 11 years ago
fonsinchen 8d50c98ef9 (svn r25741) -Fix: shift join dates of link graph jobs when using the date cheat 11 years ago
fonsinchen bcbaa92485 (svn r25741) -Fix: shift join dates of link graph jobs when using the date cheat 11 years ago
frosch 0284db1a31 (svn r25731) -Fix [FS#5692]: Minor RTL alignment issues. (sbr) 11 years ago
frosch f89375aa44 (svn r25731) -Fix [FS#5692]: Minor RTL alignment issues. (sbr) 11 years ago
fonsinchen c1d043f516 (svn r25637) -Fix: don't keep minimal routing information if automatic distribution has been disabled 11 years ago
fonsinchen ca1c792144 (svn r25637) -Fix: don't keep minimal routing information if automatic distribution has been disabled 11 years ago
fonsinchen e3807ed606 (svn r25424) -Fix: keep old flows around in an invalidated state to continue routing cargo if necessary 11 years ago
fonsinchen f0119308f6 (svn r25424) -Fix: keep old flows around in an invalidated state to continue routing cargo if necessary 11 years ago
fonsinchen 72f464e6b5 (svn r25423) -Fix: integer overflows in MCF solver 11 years ago
fonsinchen b923eb31a8 (svn r25423) -Fix: integer overflows in MCF solver 11 years ago
fonsinchen 450834a8ff (svn r25422) -Fix: properly initialize base capacity for paths 11 years ago
fonsinchen d9985c3331 (svn r25422) -Fix: properly initialize base capacity for paths 11 years ago
rubidium 5eac8ba705 (svn r25387) -Fix: "typos" in @file filename 11 years ago
rubidium b860353a66 (svn r25387) -Fix: "typos" in @file filename 11 years ago
fonsinchen 5cd8240544 (svn r25364) -Add: support for flow stats to linkgraph overlay 11 years ago
fonsinchen b4ab43be5f (svn r25364) -Add: support for flow stats to linkgraph overlay 11 years ago
fonsinchen 94baba190e (svn r25357) -Add: flow mapper for link graph 11 years ago
fonsinchen 575cabe90a (svn r25357) -Add: flow mapper for link graph 11 years ago
fonsinchen 1cc410f7bb (svn r25356) -Add: Multi-Commodity-Flow solver for link graph 11 years ago
fonsinchen 9824d53d6a (svn r25356) -Add: Multi-Commodity-Flow solver for link graph 11 years ago
fonsinchen aa393a8ee9 (svn r25355) -Add: demand handler for link graph 11 years ago
fonsinchen 6a46b5262f (svn r25355) -Add: demand handler for link graph 11 years ago
fonsinchen 97a9908b0e (svn r25354) -Add: link graph schedule and typedefs for LinkGraph and related classes 11 years ago
fonsinchen c32eea02dd (svn r25354) -Add: link graph schedule and typedefs for LinkGraph and related classes 11 years ago
fonsinchen bfd6f2bb85 (svn r25353) -Add: link graph job implementation 11 years ago
fonsinchen 22f56ffdd7 (svn r25353) -Add: link graph job implementation 11 years ago
fonsinchen 8867eabecc (svn r25350) -Add: basic definitions for link graph 11 years ago
fonsinchen fdf04f60e0 (svn r25350) -Add: basic definitions for link graph 11 years ago
frosch 2b46e426b9 (svn r25334) -Fix: Position the linkgraph legend window automatically like most windows. 11 years ago
frosch d79b2b03d0 (svn r25334) -Fix: Position the linkgraph legend window automatically like most windows. 11 years ago
rubidium e93a8e0943 (svn r25320) -Fix [FS#5577]: link graph start time was not accounted for when cheating dates 11 years ago
rubidium 0fbc7140c5 (svn r25320) -Fix [FS#5577]: link graph start time was not accounted for when cheating dates 11 years ago
frosch 16feb5c4e9 (svn r25290) -Add: Assign string names to notable windows. 11 years ago
frosch 8157a8afd8 (svn r25290) -Add: Assign string names to notable windows. 11 years ago
frosch 25adefca23 (svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction. 11 years ago
frosch 56e4a8c4d6 (svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction. 11 years ago
rubidium 238a842700 (svn r25264) -Feature: linkgraph overlay over main viewport (fonsinchen) 11 years ago
rubidium ef7befdbd8 (svn r25264) -Feature: linkgraph overlay over main viewport (fonsinchen) 11 years ago
rubidium 71ce89c1d0 (svn r25263) -Add: legend for linkgraph overlay (fonsinchen) 11 years ago
rubidium 50ae992b47 (svn r25263) -Add: legend for linkgraph overlay (fonsinchen) 11 years ago
rubidium 2a6d21dc80 (svn r25262) -Feature: linkgraph overlay for smallmap 11 years ago
rubidium 163dfdd34a (svn r25262) -Feature: linkgraph overlay for smallmap 11 years ago
rubidium 3f2f1c4df7 (svn r25261) -Add: abstract implementation of linkgraph overlay for GUI (fonsinchen) 11 years ago
rubidium 5bca50c466 (svn r25261) -Add: abstract implementation of linkgraph overlay for GUI (fonsinchen) 11 years ago
rubidium 251bf7ddcb (svn r25257) -Add: basic link graph (fonsinchen) 11 years ago
rubidium 06313e4981 (svn r25257) -Add: basic link graph (fonsinchen) 11 years ago