AssetIDType
- type of the asset objectRequirementIDType
- type of the requirement objectpublic interface IOptimizer<AssetIDType,RequirementIDType>
Modifier and Type | Interface and Description |
---|---|
static class |
IOptimizer.State |
Modifier and Type | Method and Description |
---|---|
Map<RequirementIDType,List<IOptimLimit>> |
getAllocationLimitsReached()
Get a list of allocation limits that have been reached after the optimization was run.
|
List<String> |
getAuditTrails()
Retrieve the audit trail record of the optimizer run.
|
IOptimConfig<AssetIDType,RequirementIDType> |
getConfig()
Returns the configuration object used to initialize the optimizer.
|
List<Exception> |
getExceptions()
Get a list of exceptions that have come from the optimizer.
|
List<IOptimLimit> |
getGlobalLimitsReached()
Get a list of global limits that have been reached after the optimization was run.
|
Collection<OptimAllocation<AssetIDType,RequirementIDType>> |
getInventoryAllocations()
Returns all allocations in a collection of OptimAllocation objects, which have
information about assetId, requirementId, cost, and quantity.
|
Map<RequirementIDType,OptimAllocation<AssetIDType,RequirementIDType>> |
getInventoryAllocations(AssetIDType inventoryId)
For an inventoryId, get a map of the requirements which that inventory
has been allocated to and an OptimAllocation object, which has
information about cost and quantity.
|
void |
init(IOptimConfig<AssetIDType,RequirementIDType> config)
Configure this optimizer instance, with the constraints on the optimization problem specified by the parameters of
this method.
|
void |
init(Map<AssetIDType,Double> inventory,
Map<RequirementIDType,Double> requirements,
Map<RequirementIDType,Map<AssetIDType,ICost>> cost,
Map<RequirementIDType,Set<IOptimLimit>> allocationLimits,
Set<IOptimLimit> globalLimits,
List<Set<AssetIDType>> linkedAssets)
Deprecated.
|
void |
optimize()
Optimize the problem starting from scratch.
|
void |
optimize(Collection<OptimAllocation<AssetIDType,RequirementIDType>> existingAllocations)
Optimize the problem starting from a set of existing allocations.
|
void |
setAudit(boolean audit)
Enable an audit trail to allow for verification of the results of the optimizer.
|
void |
setDebug(boolean debug)
Enable debug mode to give more information to what's happening in the optimizer.
|
void init(IOptimConfig<AssetIDType,RequirementIDType> config)
config
- - should contain any parameters necessary as input to the optimizer@Deprecated void init(Map<AssetIDType,Double> inventory, Map<RequirementIDType,Double> requirements, Map<RequirementIDType,Map<AssetIDType,ICost>> cost, Map<RequirementIDType,Set<IOptimLimit>> allocationLimits, Set<IOptimLimit> globalLimits, List<Set<AssetIDType>> linkedAssets)
inventory
- Contain the available assets and their quantity in USDE (or any other common unit) in the inventoryrequirements
- Contains the positions and their collateral requirements in USDE (or any other common unit)cost
- Asset eligibility and cost. The map contains an entry for each position (or group of positions under the same allocation rules),
with a schedule of eligible assets and their respective allocation costs for each asset/asset type. If an asset
is not listed in the map associated with a position, it is not eligible for pledging towards that collateral requirement
allocationLimits
- Limits. The map contains an entry for each position (or group of positions under the same allocation rules),
with a schedule of allocation limits of single assets or a groups of assets collectively. If the Limit is <=1.0, then it
is interpreted as percent of the requirement for that position. Otherwise it is interpreted as the absolute limit in
USDE (or the same common unit inventory/requirements are expressed in)
void optimize()
void optimize(Collection<OptimAllocation<AssetIDType,RequirementIDType>> existingAllocations)
existingAllocations
- Collection<OptimAllocation<AssetIDType,RequirementIDType>> getInventoryAllocations()
Returns an empty Collection if nothing is found
Map<RequirementIDType,OptimAllocation<AssetIDType,RequirementIDType>> getInventoryAllocations(AssetIDType inventoryId)
Returns an empty map if nothing is found.
inventoryId
- List<IOptimLimit> getGlobalLimitsReached()
Map<RequirementIDType,List<IOptimLimit>> getAllocationLimitsReached()
IOptimConfig<AssetIDType,RequirementIDType> getConfig()
void setDebug(boolean debug)
debug
- void setAudit(boolean audit)
audit
- List<String> getAuditTrails()
Copyright © 2019. All Rights Reserved.