Browse files

Merge in soln-to-alloc-map

  • Loading branch information...
1 parent 1e4db9c commit 88afe27aac16510a0efa4f34c97c1b975a462ee0 @lvh committed Mar 6, 2014
Showing with 4 additions and 6 deletions.
  1. +4 −6 src/hood/constraint.clj
10 src/hood/constraint.clj
@@ -13,18 +13,16 @@
constraints (conj grant-constraints within-budget)]
(solution constraints :maximize target)))
-(defn ^:private soln-to-alloc-map
- [soln]
- (into {} (for [[[tag application] grant] soln] [application grant])))
-(def alloc
+(defn alloc
"Allocates using a constraint solver.
apps is a seq of all applications.
budget is the total budget.
target is the term to optimize.
- (comp soln-to-alloc-map solve))
+ [apps budget target]
+ (let [soln (solve apps budget target)]
+ (into {} (for [[[tag application] grant] soln] [application grant]))))
(defn ^:private $expt
[x n]

0 comments on commit 88afe27

Please sign in to comment.