Game Development Reference
In-Depth Information
W EIGHTED S UMS
Most of the time, we find that a single criterion is not enough to make a decision.
Many decisions are a combination of two or more criteria. Except for rare circum-
stances, the weights that factors have in the decision are usually not equal. One fac-
tor is typically more important than another. As we increase the number of factors
to consider in a decision, the likelihood that they all have the same importance
decreases.
The most common method of balancing the significance of each factor is
through the process known as weighted sums . Through weighted sums, we con-
struct a single value from multiple factors—each with their own value. We pair
each component value with a coefficient that represents its weight in the overall de-
cision. The resulting combined value reflects not only the component values, but
the proportional “meaningfulness� for each of those components.
If we think in terms of vector math, the weights are the same as the magnitude
of a vector. While the direction of the vector provides directional information, the
magnitude tells us how far to move in that direction.
A generic formula for a two-component weighted sum looks like the following:
In English, the weighted result of X and Y ( R XY ) is the weight for X ( w X ) times
the value of X ( v X ) plus the weight for Y ( w Y ) times the value of Y ( v Y ).
We can normalize the result by dividing by the sum of the weights.
This results in a weighted mean of the values. By doing this, we achieve the effect
of putting the result on the same scale as the component values. This is especially
advantageous if we have already normalized the values to the same scale. By using
the weighted mean, we ensure that the result is directly comparable to the original
values. For example, if the component values are normalized to a range of 0 to 1,
the weighted mean is between 0 and 1 as well.
Certainly, we are not limited to two components. For the sake of completeness,
the formula for n components is
Search WWH ::




Custom Search