Skip to main content

ResourceAllocationSolver

Classes

Functions

Sorting comparator

ResourceAllocationSolver

Kind: global class
Author: Alex Goldring
Copyright: Company Named Limited (c) 2025

resourceAllocationSolver.addResources(resources)

Kind: instance method of ResourceAllocationSolver

ParamType
resourcesArray.<Resource>

resourceAllocationSolver.addResource(resource)

Kind: instance method of ResourceAllocationSolver

ParamType
resourceResource

resourceAllocationSolver.addBids(bids)

Kind: instance method of ResourceAllocationSolver

ParamType
bidsArray.<ResourceAllocationBid>

resourceAllocationSolver.addBid(bid)

Kind: instance method of ResourceAllocationSolver

ParamType
bidResourceAllocationBid

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

ParamType
aResourceAllocationBid
bResourceAllocationBid