[Freeciv-Dev] (PR#9856) RFC: caravans advisor
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[Freeciv-Dev] (PR#9856) RFC: caravans advisor |
From: |
"Benoit Hudson" <bh@xxxxxxxxxxxxxxxxxxx> |
Date: |
Sat, 28 Aug 2004 15:47:01 -0700 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=9856 >
In the late game, I often have a number of caravans that
I don't really know what to do with. So I wrote a function
to tell me the best place to send my caravan. The code
isn't ready to be sent in yet, but I figure I should ask what
others think this code should be able to do. At the moment,
my code is able to take a caravan and a destination, and
evaluate a score for sending the caravan to the destination.
The score is based on how many gold + science will be produced,
discounted by the time it takes to get there, and taking into account
the additional trade that will be produced over some (possibly infinite)
period.
In brief, the input is:
unit
destination
parameters:
- discount factor
- time horizon over which to discount (possibly infinite)
- optimization criterion (just the trade, just the one-time benefit, or both)
- whether to ignore the travel time (necessary if dest is on another continent)
- whether to take account of the ill effect of breaking an old, minor trade
route
[wishlist item: whether to count trade as 1 point, or use the CM to determine
the change in gold+sci]
And the output is a double. It's then trivial to write a function that
loops over all cities and finds the best one to send the caravan to; and not
hard to write a function to find the best thing to do with the caravan,
including
possibly changing the home city (both those functions should be in the
caravan optimizer API anyway).
None of this takes into account any other caravans built, in transit, or being
built.
The current implementation problem I have is determining whether I can
trade with a city. We can only trade with allied cities in the default rule
set,
but can_cities_trade says yes even for enemy cities. Where is this information
determined?
Comments would be appreciated.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#9856) RFC: caravans advisor,
Benoit Hudson <=
|
|