Commit Graph

67 Commits

Author SHA1 Message Date
fonsinchen 54db96be43 (svn r25891) -Feature: Use smallstack to allow for multiple next hops when loading and unloading. 2013-10-20 13:47:58 +00:00
fonsinchen 6ce4c1808b (svn r25715) -Fix: return correct value from StationCargoList::Reserve, fix some documentation and simplify StationCargoList::Load a bit 2013-08-10 14:19:58 +00:00
fonsinchen 3dd811e179 (svn r25434) -Fix: reroute cargo staged for unloading if a link breaks 2013-06-23 08:28:53 +00:00
fonsinchen c9452bbbff (svn r25419) -Fix: assign some random other source station to packets which have lost their source 2013-06-15 20:48:50 +00:00
fonsinchen 741c431caa (svn r25362) -Feature: consider cargo waiting at other stations for rating at the origin station 2013-06-09 13:04:32 +00:00
fonsinchen 04e3eb6fab (svn r25361) -Feature: distribute cargo according to plan given by linkgraph 2013-06-09 13:03:48 +00:00
rubidium cdb0a76958 (svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle 2013-02-17 14:54:50 +00:00
rubidium d6e2a8aa56 (svn r25010) -Codechange: Add general framework for cargo actions, i.e. loading, transfering, delivering and such, to contain this logic in a single place instead of spread around (fonsinchen) 2013-02-17 14:36:40 +00:00
rubidium 71bbc130fc (svn r25009) -Codechange: refactor bits of cargo packet (lists) to reduce duplicated code (fonsinchen) 2013-02-17 14:17:06 +00:00
rubidium 2795ed5b09 (svn r25008) -Codechange: Make CargoList::Truncate behave similarly to CargoList::MoveTo, i.e. pass the amount to truncate (fonsinchen) 2013-02-17 14:10:15 +00:00
truebrain 1c9bec1999 (svn r23640) -Fix: stop using FORCEINLINE (1/3rd of the instances were, the others were still regular inline), but make sure inline is always a 'forced' inline (I am looking at you MSVC) 2011-12-20 17:57:56 +00:00
michi_cc 56b7faed52 (svn r22582) -Fix: Don't increment STL iterators after they've been invalidated. 2011-06-13 10:46:00 +00:00
rubidium ff143c6708 (svn r22413) -Document: even more stuff 2011-05-02 20:59:54 +00:00
smatz 756cc6cf65 (svn r22116) -Codechange: use PoolBase::Clean() at more places 2011-02-19 23:05:47 +00:00
rubidium 68bc93f950 (svn r22111) -Codechange/fix-ish: upon cleaning a pool a destructor should not delete items from other pools 2011-02-19 18:02:17 +00:00
smatz b4273bcd35 (svn r22023) -Fix: verify we can allocate a CargoPacket and CargoPayment before we actually try to do so
-Codechange: increase the limit of number of CargoPayments to match the limit of Vehicles (Rubidium)
2011-02-08 18:27:21 +00:00
rubidium 8017c2a3d7 (svn r21909) -Fix: some missing spaces 2011-01-26 08:14:36 +00:00
rubidium 6435a89c28 (svn r21863) -Fix (r21849): load the amount that should be loaded instead of the amount that should not be loaded 2011-01-19 20:40:27 +00:00
rubidium 2707186f6a (svn r21849) -Codechange: move merging/splitting of cargopackets into a helper function (fonsinchen) 2011-01-19 16:25:00 +00:00
rubidium 07e14525b8 (svn r21848) -Codechange: unification of comment style for cargopacket.* 2011-01-19 16:20:26 +00:00
rubidium 6c9078fd30 (svn r21844) -Codechange: move documentation towards the code to make it more likely to be updates [a-c]. 2011-01-18 22:17:15 +00:00
rubidium b00a5f1069 (svn r18330) -Cleanup: remove some unneeded includes 2009-11-28 20:35:25 +00:00
rubidium 547677a782 (svn r17840) -Codechange: use the new pool's concepts (caching + not zeroing). Improves average CargoPacket con/destruction time by ~20%, MoveTo/Append by 5-10% and application performance by up to 2%. 2009-10-21 19:42:49 +00:00
rubidium 69b8e8e755 (svn r17836) -Codechange: split the CargoPacket constructor for creating 'real' new CargoPackets and saveload. For saveload we do not need to set anything except two variables (the rest is always overwritten by the load), for new 'real' cargo also pass the source_xy; dereferencing st before calling is easier than resolving st->index back to st and then dereferencing. Also don't set loaded_at_xy because that is of no importance when not loaded in a vehicle. 2009-10-20 22:24:34 +00:00
rubidium 86031d434d (svn r17818) -Codechange: iterate the cargo list from the back when trying to merge packets. Chances are higher that the last packet (in the FIFO-ish queue) is mergeable with the to be added package. If a train gets loaded packets get split up and put into the different carriages, at unload they are unloaded in the same order so the last in the FIFO-ish queue is likely the packet it can merge with.
This results in a 5-10% performance improvement of CargoList's Append/MoveTo without performance degradation of AgeCargo.
2009-10-20 16:36:35 +00:00
rubidium 08ac51fada (svn r17813) -Codechange: unify the CargoPacket related coding style 2009-10-19 09:15:47 +00:00
rubidium 2cca30d2e3 (svn r17812) -Codechange: move the feeder_share cache from CargoList to VehicleCargoList; saves 512 bytes per station and 1-2% on CargoList::MoveTo. 2009-10-19 01:12:51 +00:00
frosch fea06c5755 (svn r17809) -Fix: MSVC compilation. 2009-10-18 18:47:43 +00:00
rubidium f11cebfe9b (svn r17807) -Codechange: move all 'updates' just after the 'load' constructor of CargoPackets to the constructor call itself 2009-10-18 17:52:44 +00:00
rubidium 62a6e9509b (svn r17804) -Codechange: move the CargoPacket 'invalidation' when stations get removed to CargoPacket. 2009-10-18 17:26:10 +00:00
rubidium f76de82679 (svn r17801) -Codechange: for StationCargoLists the 'loaded_at_xy' does not matter when merging CargoPackets 2009-10-18 14:30:37 +00:00
rubidium 138e7233bc (svn r17800) -Codechange: first steps into making CargoList a template 2009-10-18 14:28:26 +00:00
rubidium 2e766884f6 (svn r17795) -Codechange: split cargolist into one for vehicles and one for stations. 2009-10-18 13:39:00 +00:00
rubidium 1017f4f6a1 (svn r17739) -Cleanup: compiler didn't warn about an unused variable, fonsinchen did 2009-10-07 17:46:58 +00:00
rubidium c53682810f (svn r17736) -Codechange [FS#3135]: rewrite CargoList::MoveTo; don't require the secondary list, use cache updates instead of rebuilds. This is usually faster because of primarily gradual loading that only moves a (small) part of the cargo each time. Based on patch by fonsinchen. 2009-10-07 08:31:42 +00:00
rubidium 705615fd91 (svn r17735) -Codechange: update the cache one inserting/removing CargoPackets from the CargoList via Append/Truncate instead of rebuilding the whole cache. For Append this changes the O(n) cache rebuild into a O(1) cache update. For Truncate no temporary list is needed anymore (based on patch by fonsinchen) 2009-10-07 08:25:12 +00:00
rubidium 9b045ac7b2 (svn r17733) -Codechange: store the 'days in transit' cache as the sum of the days in transit instead of the average; the variable isn't requested that often (primarily station NewGRFs) that the dividing/testing for dividing by 0 step needs to be cached. 2009-10-06 21:24:03 +00:00
rubidium 80f0df17ba (svn r17732) -Codechange: reorder some variables of cargo packets/cargo lists to get better alignment *and* smaller structs; both from 40 bytes to 32 bytes on 64 bits. 2009-10-06 21:19:20 +00:00
rubidium d52fa73bb1 (svn r17731) -Codechange: do not cache a boolean which states whether some other variable is not 0. 2009-10-06 21:12:35 +00:00
rubidium 31acc42b21 (svn r17730) -Codechange: do not cache the source of a packet in the cargo list. It's only used for (some) GUI/NewGRF purposes so precalculating it costs more than calculating when it's actually used. 2009-10-06 21:06:26 +00:00
rubidium 1e2dc25582 (svn r17727) -Codechange: some coding style and documentation fixes 2009-10-06 19:52:27 +00:00
rubidium 832b21191d (svn r17722) -Codechange: simplify the cargopacket constructor; unduplicate if and don't set a value to 0 if it already is 0. 2009-10-06 17:33:01 +00:00
rubidium e0e5eae1ee (svn r17721) -Codechange: replace a magic number with a constant 2009-10-06 17:28:06 +00:00
rubidium 5f59d0c5b4 (svn r17720) -Codechange: guard the CargoPacket variables that are cached in CargoLists so they cannot be written from outside the CargoList class (based on patch by fonsinchen) 2009-10-06 17:23:15 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
smatz 2a430d981f (svn r17113) -Change [FS#265][FS#2094][FS#2589]: apply the subsidy when subsidy's destination is in station's catchment area and cargo packets originate from subsidy's source
-Change [FS#1134]: subsidies aren't bound to stations after awarding anymore, they still apply to town or industry, no matter what station is used for loading and unloading. Awarded subsidies from older savegames are lost
-Change [NoAI]: due to these changes, AISubsidy::GetSource and AISubsidy::GetDestination now return STATION_INVALID for awarded subsidies
2009-08-08 16:42:55 +00:00
rubidium 6e3d999dce (svn r16914) -Codechange: split Station and BaseStation into different files 2009-07-22 11:35:35 +00:00
rubidium 985608c713 (svn r16694) -Fix [FS#2995] (rgradual loading, rnewindustries): only pay for whatever has been actually unloaded and perform the payment when unloading has finished. This fixes, amongst others:
* cheating by starting to unload and after getting paid rushing to the depot to get sold (or unloading, loading and getting paid again for the remainder)
 * cargo being dropped onto a station at the moment a stockpiling industry doesn't accept it anymore
 * industries getting cargo that has not been unloaded yet and subsequently dumping it back on the station in one go
Note: you will now get paid after the unloading has finished, so you'll have to wait a bit longer for 'your' money.
2009-06-29 19:55:36 +00:00
smatz b178a94c19 (svn r16459) -Codechange: move definition of several cargopacket accessors to header file 2009-05-29 15:46:55 +00:00
smatz 62a7948af0 (svn r16378) -Codechange: replace OldPool with simpler Pool. Compilation time, binary size and run time (with asserts disabled) should be improved 2009-05-22 15:13:50 +00:00