@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
53 lines • 1.24 kB
TypeScript
/**
*
* @author Alex Goldring
* @copyright Company Named Limited (c) 2025
*/
export class ResourceAllocationSolver {
/**
*
* @type {Map<any,Resource>}
* @private
*/
private resources;
/**
*
* @type {ResourceAllocationBid[]}
* @private
*/
private bids;
/**
*
* @type {ResourceAllocationBid[]}
* @private
*/
private allocations;
clear(): void;
/**
*
* @param {Resource[]} resources
*/
addResources(resources: Resource[]): void;
/**
*
* @param {Resource} resource
*/
addResource(resource: Resource): void;
/**
*
* @param {ResourceAllocationBid[]} bids
*/
addBids(bids: ResourceAllocationBid[]): void;
/**
*
* @param {ResourceAllocationBid} bid
*/
addBid(bid: ResourceAllocationBid): void;
/**
* 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
* @returns {ResourceAllocationBid[]}
*/
solve(): ResourceAllocationBid[];
}
//# sourceMappingURL=ResourceAllocationSolver.d.ts.map