[Freeciv-Dev] [patch #2733] amortize_abs_zero()

2014-05-11 Thread Marko Lindqvist
Update of patch #2733 (project freeciv):

  Status:  Ready For Test => In Progress
 Planned Release:   2.5.0 =>


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2733] amortize_abs_zero()

2012-07-02 Thread Marko Lindqvist
Follow-up Comment #2, patch #2733 (project freeciv):

This patch didn't prove beneficial for the ai.

> Obviously it would be better to do just slightly (want value
> between 0 and 1) beneficial thing than nothing.

I will look if it would be feasible to always do even value 0 things instead
of nothing. Often what is now of value 0, will be valuable in the future (tile
taking to use, some effect's other requirements getting fulfilled)

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2733] amortize_abs_zero()

2011-10-31 Thread Matthias Pfafferodt

Follow-up Comment #1, patch #2733 (project freeciv):

If this is something for 2.5 would it not be best to do the step to a float?
Most of the time amortize is used to calculate a want value which is compared
to another value - changes would be only required for some variable
definitions (int => float), or?

___

Reply to this item at:

  

___
  Nachricht geschickt von/durch Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2733] amortize_abs_zero()

2011-10-27 Thread Marko Lindqvist

Update of patch #2733 (project freeciv):

 Planned Release:   2.4.0 => 2.5.0  


___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #2733] amortize_abs_zero()

2011-06-18 Thread Marko Lindqvist

URL:
  

 Summary: amortize_abs_zero()
 Project: Freeciv
Submitted by: cazfi
Submitted on: Sun 19 Jun 2011 02:48:44 AM EEST
Category: ai
Priority: 5 - Normal
  Status: Ready For Test
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
 Planned Release: 2.4.0

___

Details:

Integer math is not really suitable for amortize() kind of operation.
Especially problematic is return value 0. Many callers handle (or rather don't
handle at all) that specially. For example: if best tile improvement thing
settler may do gets want value 0, settler keeps its current, i.e., doing
nothing, state. Obviously it would be better to do just slightly (want value
between 0 and 1) beneficial thing than nothing.

While changing amortize() return value from int to float or double may seem
like correct solution, it would require changing a lot of codebase to use
those types to be really correctly implemented.
Instaed attached patch trades one problem to another, but hopefully less
dramatic, problem. Instead of returning value "0" too often, new function
amortize_abs_zero() returns "1" or "-1" too often. It returns "0" only if
there really is no value in doing something.

This patch needs a lot of testing to see that it really improves, and not
decrease, overall performance of ai.



___

File Attachments:


---
Date: Sun 19 Jun 2011 02:48:44 AM EEST  Name: AmortizeAbsZero.diff  Size: 7kB
  By: cazfi



___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev