Pool Cover & Liner Estimator

Authors
  • avatar
    Name
    Paul Bonnette
    Twitter

Project Specifications

Build a pool and liner quoting system to:

  • Remove the bottleneck whereby only a small group of experienced estimators build quotes.
  • Identify and pass easy quotes to the less experienced estimators, allowing the company to expand production.
  • Reduce costly mistakes in misquoting and building covers.
  • Automate pricing and custom logic rules.
  • Keep maintenance low by allowing pricing and business logic rules to be easily assigned, inherited, and overridden.

Solutions

  • Hierarchical Customer Structure - I used a hierarchical customer structure which allowed customers to be the parent of other customers. So Distributors could have dealers under them. Distributor-groups could have distributors under them. Dealers, distributors, and distributor-groups all inherit pricing and custom rules from each other and everything can be overridden.
  • Pricing - Multiple pricing levels could be created. Distributors could be assigned a pricing level and dealers would automatically inherit that pricing level. However, the dealer pricing level could be overridden. The architecture worked beautifully and was fast as lightening, using an SQL union and procedure to quickly calculate final pricing.
  • Customer Logic Rules - Rules were simply products which therefore shared the logic from the pricing. This also gave an easy interface for handling rules. Implementation was fast as lightning and intuitive.

This PHP(LAMP) application was integrated with NetSuite and involved building some rather complex solutions.

Pool covers

  1. Based on the Shape
  2. Measure the Pool
  3. Calculate the price

Sounds easy, right? Actual implementation was smooth and easy to use, with feedback helping the estimator with tips and warnings.

AB Covers

So, how do you measure a completely custom shape? You lay down two points near the pool and start measuring each point along the edge of the pool to that set of points.

A little math and now you have a polygon. Right? So how do you add 18" to the edge of that polygon/pool?

It's crazy but it can be done. I'll give you a hint, use vectors! For n\mathbf{n} points which lay on the parimeter of a pool:

Points=[p1...pn]\mathbf{Points} = \left[\begin{array} {c} p_1 \\ . \\ . \\ . \\ p_n \end{array}\right]

we calculate a set of vectors between the points

Vectors=[v1(p2p1)...vn(p1pn)]\mathbf{Vectors} = \left[\begin{array} {c} v_1 (p_2 - p_1)\\ . \\ . \\ . \\ v_n (p_1 - p_n) \end{array}\right]

We then walk around the polygon calculating the correct Offset:

Cover=[v1+Offset...vn+Offset]\mathbf{Cover} = \left[\begin{array} {c} v_1 + Offset \\ . \\ . \\ . \\ v_n + Offset \end{array}\right]

Which generates a polygon with an overlap of exactly 18", or whatever the customer ordered.

Or to save time use a matrix:

P=[p1...pn...............pv1...pvn]=[xpn...xvn]\mathbf{P} = \left[\begin{array} {ccccc} p_{1} & . & . & . & p_{n} \\ . & . & . & . & . \\ . & . & . & . & . \\ . & . & . & . & . \\ p_{v1} & . & . & . & p_{vn} \end{array}\right] = \left[\begin{array} {c} \mathbf{x}'_pn \\ . \\ . \\ . \\ \mathbf{x}'_vn \end{array}\right]

There we have P\mathbf{P} for drawing the new cover. Fun right?

Liners

Liners are essentially the same thing but with three dimensions, instead of two.

Bottom Line

Our client was able to:

  • Use experienced estimators more effectively
  • Expand their business
  • Could produce more quotes in less time
  • Reduce quote-to-order mistake cycles
  • Reduce mistakes in final production itself
  • Offer customers custom-logic
  • Offer customers completely flexible pricing

This quoting system is still in service today, nearly twelve years later!