StrategicResourceAllocator
StrategicResourceAllocator
Kind: global class
Author: Alex Goldring
Copyright: Company Named Limited (c) 2025
- StrategicResourceAllocator
- new exports.StrategicResourceAllocator()
- .modules :
Array.<TacticalModule> - .addTransformer(t)
- .addTacticalModule(module) ⇒
boolean - .allocate(resources) ⇒
Promise.<Array.<A>>
new exports.StrategicResourceAllocator()
Example
const allocator = new StrategicResourceAllocator();
allocator.addTacticalModule(module); // add some tactical modules
const resources = [new Resource(1, "a")];
const actions = await allocator.allocate(resources); // list of actions that use resources
strategicResourceAllocator.modules : Array.<TacticalModule>
Kind: instance property of StrategicResourceAllocator
strategicResourceAllocator.addTransformer(t)
Add a sequence transformer, these are applied as a final step during resource allocation
Kind: instance method of StrategicResourceAllocator
| Param | Type |
|---|---|
| t | function |
strategicResourceAllocator.addTacticalModule(module) ⇒ boolean
Kind: instance method of StrategicResourceAllocator
| Param | Type |
|---|---|
| module | TacticalModule |
strategicResourceAllocator.allocate(resources) ⇒ Promise.<Array.<A>>
Kind: instance method of StrategicResourceAllocator
Returns: Promise.<Array.<A>> - actions
| Param | Type |
|---|---|
| resources | Array.<Resource> |