ResourceAllocationSolver
Classes
Functions
- byWeightedValue(a, b) ⇒
number
Sorting comparator
ResourceAllocationSolver
Kind: global class
Author: Alex Goldring
Copyright: Company Named Limited (c) 2025
- ResourceAllocationSolver
- .addResources(resources)
- .addResource(resource)
- .addBids(bids)
- .addBid(bid)
- .solve() ⇒
Array.<ResourceAllocationBid>
resourceAllocationSolver.addResources(resources)
Kind: instance method of ResourceAllocationSolver
| Param | Type |
|---|---|
| resources | Array.<Resource> |
resourceAllocationSolver.addResource(resource)
Kind: instance method of ResourceAllocationSolver
| Param | Type |
|---|---|
| resource | Resource |
resourceAllocationSolver.addBids(bids)
Kind: instance method of ResourceAllocationSolver
| Param | Type |
|---|---|
| bids | Array.<ResourceAllocationBid> |
resourceAllocationSolver.addBid(bid)
Kind: instance method of ResourceAllocationSolver
| Param | Type |
|---|---|
| bid | ResourceAllocationBid |
resourceAllocationSolver.solve() ⇒ Array.<ResourceAllocationBid>
The problem is that of dynamic programming. Often called "knapsack problem" we want to assign resources in the best possible way TODO: the algorithm is very greedy, there is a lot of room for optimization
Kind: instance method of ResourceAllocationSolver
byWeightedValue(a, b) ⇒ number
Sorting comparator
Kind: global function
| Param | Type |
|---|---|
| a | ResourceAllocationBid |
| b | ResourceAllocationBid |