[Posting] Re: core regeneration bug?
From:streu
Thread:core regeneration bug?
Forum:Bugs
In reply to:Re: core regeneration bug?
Date:Thu, 2013-03-28 20:27 GMT

that said, which THost change altered from the mid-90's formula (CEILING) to the lower formula that you have?

To answer this question once and for all, I ran a few simulations.

Setup: make a universe with 100 planets, each of which has no Tritanium, and a density of 1 .. 100. Run host, look how much they have now.

Result in a nutshell: all HOST versions I tried behave the same (3.11a from 1993, 3.21 from 1995, 3.22.024 from 1998, 3.22.046 from 2002). PHost behaves largely the same, but occasionally generates one kiloton more than HOST.

Here's the table for Trans-Uranium rate 5% (default), runs of equal values omitted, differences highlighted (which are precisely the points where ROUND and ERND differ):

  Rate HOST PHost
   1     0     0
   2     0     0
   ...
   9     0     0
  10     0     1   <---
  11     1     1
   ...
  29     1     1
  30     2     2
   ...
  49     2     2
  50     2     3   <---
  51     3     3
   ...
  69     3     3
  70     4     4
   ...
  89     4     4
  90     4     5   <---
  91     5     5
   ...
  99     5     5
 100     5     5

A formula using CEIL would be rather unusual in HOST. The BASIC dialect HOST is written in has no CEIL function. It has a function called INT (which is often referred to as TRUNC), and it has implicit rounding when assigning fractional values to integer variables (which I refer to as ERND). INT can be used to build a ROUND.

Interesting difference between HOST and PHost observed during the simulation: HOST does trans-uranium decay only on owned planets.

--Stefan