Complete.Org: Mailing Lists: Archives: freeciv-ai: July 2004:
[freeciv-ai] (PR#9247) cm shouldn't count waste as a good thing
Home

[freeciv-ai] (PR#9247) cm shouldn't count waste as a good thing

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [freeciv-ai] (PR#9247) cm shouldn't count waste as a good thing
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 13 Jul 2004 14:18:32 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9247 >

> [jdorje - Sat Jul 10 05:17:29 2004]:
> 
> > [jdorje - Wed Jul 07 18:33:57 2004]:
> > 
> > In copy_stats() in cm.c, corruption and waste is included in the 
> > calculation of the goodness of trade and production.  This seems to be 
> > clearly wrong.  If we put a weighting on shield production we don't
want 
> > waste to be included in this.
> 
> Can someone verify my logic is correct here?  Am I missing something?

Yes, I'm missing something.  The production values are AFAICT only used
for sanity checking.  And if the waste/corruption values are removed the
sanity check fails.  IMO this is a bug; these values should be dropped.
 But I don't know enough to make changes here yet.

In any case it is the surplus (or sometimes the surplus plus a constant
amount, which is the same thing (!?!?)) that is used in the calculation
of goodness of a combination.  So the patch was in error.

jason

Index: common/aicore/cm.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/aicore/cm.c,v
retrieving revision 1.31
diff -u -r1.31 cm.c
--- common/aicore/cm.c  13 Jul 2004 18:26:32 -0000      1.31
+++ common/aicore/cm.c  13 Jul 2004 21:18:07 -0000
@@ -463,8 +463,8 @@
 static void copy_stats(struct city *pcity, struct cm_result *result)
 {
   result->production[FOOD] = pcity->food_prod;
-  result->production[SHIELD] = pcity->shield_prod;
-  result->production[TRADE] = pcity->trade_prod;
+  result->production[SHIELD] = pcity->shield_prod + pcity->shield_waste;
+  result->production[TRADE] = pcity->trade_prod + pcity->corruption;
 
   result->surplus[FOOD] = pcity->food_surplus;
   result->surplus[SHIELD] = pcity->shield_surplus;

[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] (PR#9247) cm shouldn't count waste as a good thing, Jason Short <=