Fix OX-5981 Serious underdelivery for contract campaigns - Part Two

> From https://developer.openx.org/jira/browse/OX-5981

I'm attaching the last version of my patch - forum thread: http://forum.openx.org/index.php?showtopic=503457631

The patch tries to address a few problems in the impression allocation algorithm.

Most importantly, it's well known that Inactive zones linked to banners or campaigns cause massive underdelivery, especially on systems that do not have millions of daily impressions. This is because a default forecast of 1000 hourly impressions is expected for the next hour for any new or inactive zone. That number was probabily picked so that it was not too low to cause massive overdelivery when a new zone is starting to receive traffic, but has the very bad side effect of reserving contract impressions every hour for zones that are not delivering instead of trying to get the most from other active zones.

The approach of the fix is quite different. Inactive zones still get some contract impression allocated. After all if a zone is in the system, it is expected to go live sooner or later. However the potential overdelivery problem discussed above is dealt by limiting contract traffic for a new zone at 5% for the first hour (or OI). After that, a forecast is available and regular contract impression allocation takes place.

Apart from this, other inconsistencies between forecast algorithms have been fixed.

Beta testers reported good results: underdelivery disappeared in some cases or at least reduced to a manageable and consistent level (5-10%).