Roman Novak is an IT Architect at Raiffeisen Solution, Austria. 18 years of IT experience in various roles help him to take on all the challenges, which may appear. Roman has posted 1 posts at DZone. You can read more from them at their website. View Full User Profile

Drools Planner in Billboard Planning for Out-of-Home Advertising

  • submit to reddit
EPAMEDIA uses Drools Planner for the dynamic placement of subjects on its media sites. 
This procedure is called “optimization”. The placement has to satisfy various rules. 
The implementation has been in production for more than a year. Drools Planner version 5.2
was used. Around 35% - 50% of the whole media bookings on all billboard sites are created 
via optimization.


 media and segmentation
illustration 1: media and segmentation
The issues Drools Planner has to work on, are many. Some facts about the business domain, 
in order to illustrate that:
  • subjects are of variable sizes
  • the media, where subjects are placed on, is segmented (s. illustration 1)
  • media have different values (based on possible eye contact due to location). Sometimes a bigger
  • installation can be segmented into areas of different values
  • subjects are placed on media (booked) for 1 or more cycles (a cycle constitutes 14 days)
  • about 19500 localities and communities have to be considered
  • the amount of media (many thousands), campaigns and existing bookings are substantial
  components of the technical solution
illustration 2: components of the technical solution
The diagram above shows details about the technical solution. Drools Planner is the core
of the so called "OptimizationService". Campaigns and bookings are read and written. The 
model for optimization is specially designed for performance and decoupled via adapters. 
Production optimization runs read from/write to database. Techsupport and developers can 
use recorded files in CSV format for replay/debugging/testing purposes. The implementation 
uses Drools queries with complex joins massively during the initial placement. 
Because of the size of the task, the move factory queries rule violations, in order to create
the moves which Drools Planner executes. Designing a good MoveFactory is not easy. There is 
still room for improvement in this area.

The hardest part was the calibration of the system and the acceptance test because of the
nature of the problem solved here. Simple tests targeted single rules. In order to understand 
the results in daily business, a lot of work had to be done to make the found solution by 
Drools Planner transparent.

 Some technical details:
  • 16 - 24 GB of memory are used
  • dozens of rules
  • initial loading and placement takes an hour
  • optimization runs for a few hours (time constrained)

The performance of Drools and Drools Planner is very good; there was of course a lot of
effort necessary to make the implementation as fast as possible.
Due to the size of the problem, the performance advances in Drools and Drools Planner are
very welcome. These improvements are well on their way in Drools Planner 5.5 (like 
Just-In-Time Selectors, Selector trees, probability selection on any level, ...). 
The customer
EPAMEDIA is the leading specialist for Out-of-Home advertising in the public space - in Austria as well as in Central and Eastern Europe (

The author 
Roman Novak is an IT architect at Raiffeisen Solution
Published at DZone with permission of its author, Roman Novak.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Geoffrey De Smet replied on Wed, 2012/08/29 - 5:18am

Great article :)

 The generic move selectors, especially the new ones in 5.5.0.Beta1, should heavily decrease the effort and need to create custom move factories, while improving performance and potentially drastically reduce the memory footprint. Planner 5.2 needed quite some boilerplate code, most of which should be obsolete in later versions with features such as the construction heuristics since 5.3 and the new selector architecture in 5.5.0.Beta1.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.