Topic: Solution proposals for maritime shipping problems
Nordfriese |
Posted at: 2020-02-02, 15:33
This is how the current algorithm works: When a ship arrives at a port, it unloads wares destinated for this port. Afterwards, the port decides which waiting wares to load on the ship. It will load wares for ports in the ship's destination list, and possibly for other destinations as well which are then added to the ship's list. If the ship is planning to take the detour A-C-B and another ship with route X-A-B is on its way to the port, the port may decid to hold back some items to put them on the next ship. Nearby idle ships are not taken into account yet, this should be fixed. Other than that, the issues you reported can be resolved by tweaking the detour estimations in Top Quote |
Yo... |
Posted at: 2020-02-02, 20:12
That seems more complex than I thought. Still it doesn't work always very well (it seems). We have to find out, what doesn't work as planned.
How is "small" defined? I think on a huge map "small" is something different than on a small map ...
Yes, this can solve some of the issues. With the already existing list for every ship it should be known if a ship will be idle after unlaoding the wares at the last port in the list. Such "will be idle" ships could be taken in account too for the planning. Then the "planning ahead" maybe is not so tricky as I thought.
ok, I just say "Bahnhof" No, you don't have to explain it ... Top Quote |
Nordfriese |
Posted at: 2020-02-02, 21:07
Currently: Not at all. Algorithm considers only number of items shipped for a certain destination. Whether it is just a log or a supersoldier urgently needed somewhere is not taken into account.
That´s because if you urgently need your soldier, you tend to be a bit impatient and if the soldier is not sent via the shortest possible route it is much more noticable than for ordinary wares.
It would be difficult to code. And if we implement it, next someone will demand to also prioritise input wares with high priority in the destination building, and next that wares for military constructionsites close to a hostile border to be prioritiued as well... and nobody would understand the code anymore.
Very very very short detours are preferred, a bit longer detours drastrically penalized. Exact definition
Already started a branch to implement this Top Quote |
hessenfarmer |
Posted at: 2020-02-02, 21:18
Well I have tried the Tasmanian map of Solstice_s_Return. And indeed this made some problems obvious. Especially some ships got cluttered at a far away colony. They were sent with all the build materials and afterwards they were not considered anymore as they were to far away. This lastet really long and might be leading to a solution. Top Quote |
Nordfriese |
Posted at: 2020-02-02, 21:48
Good idea, implemented this Top Quote |
JanO |
Posted at: 2020-02-02, 22:00
Good idea. Send it to which port? Another idea: If a ship with more than one port in queue docks to a port (1) with any idle ship within a small distance, the busy ship should unload all wares for the last port (z) in queue so the idle ship can pick them up. "Small" could be estimated as "idle ship is closer to the port (1) then the distance between port (z) and port (z-1). Or to a fixed value. Edited: 2020-02-02, 22:02
Top Quote |
Nordfriese |
Posted at: 2020-02-02, 22:27
I implemented it now so that closer ports are preferred but ports with many ships nearby are penalized. Previously the code checked only for sailing distance, now it checks
Regarding loading wares between ships. I don´t like this idea because this is messing up two strictly separated concepts. ShipFleets assign ships to ports, and PortDocks load wares onto ships. PortDocks may also assign the ship currently present there another destination, but only if it´s really necessary. But the PortDock never, ever directly interacts with a ship other than the one asking it for cargo. Such requests are handled through the Fleet, which does not care about individual wares. So this would just result in the wares being unloaded, the idle ship coming or perhaps not, and loading perhaps these wares or completely other wares for a different destination. Edited: 2020-02-02, 22:32
Top Quote |
kaputtnik |
Posted at: 2020-02-03, 07:23
Just a question: Is shipping wares preferred over shipping workers? I had a agame where i have to move all wares and workers to another island, and a brewery waits hours to get the brewer because all ships are only transferring wares. Fight simulator for Widelands: |
Nordfriese |
Posted at: 2020-02-03, 07:43
A brewer doesn´t need a tool so he should be created in the nearest warehouse and not require shipping... All shippingitems are equal, no matter whether they are a ware or worker. Whether one item is preferred over another is decided by exactly two factors: Their destinations, and how long they are waiting in the portdock already. Top Quote |
hessenfarmer |
Posted at: 2020-02-03, 07:52
Can't say from the code just from experience, if there is a lazy worker available (brewer in this case) he is sent to the new location even if a warehouse much closer could create one easily.
Edited: 2020-02-03, 07:53
Top Quote |