lib/picky/query/weights.rb in picky-0.0.3 vs lib/picky/query/weights.rb in picky-0.0.4
- old
+ new
@@ -17,12 +17,10 @@
weights
end
# Get the weight of an allocation.
#
- # TODO Add a block to evaluate?
- #
def weight_for clustered
@weights[clustered] || 0
end
# Returns an energy term E for allocation. this turns into a probability
@@ -41,10 +39,11 @@
def score combinations
# TODO Rewrite to use the category
#
categories = combinations.map { |combination| combination.bundle.category }.clustered_uniq
- # TODO Caching even necessary?
+ # Note: Caching will not be necessary anymore if the
+ # mapping is not necessary anymore.
#
cached @weights_cache, categories do
categories.map! &:name
weight_for categories
end
\ No newline at end of file