org.cocome.tradingsystem.inventory.application.productdispatcher.impl
Class AmplStarter

java.lang.Object
  extended by org.cocome.tradingsystem.inventory.application.productdispatcher.impl.AmplStarter
All Implemented Interfaces:
OptimisationSolverIf

public class AmplStarter
extends java.lang.Object
implements OptimisationSolverIf

Solves the optimisation problem described in method solveOptimization(). AMPL / CPLEX is used.

Required for UC 8 (Optimization part)

Author:
kelsaka

Constructor Summary
AmplStarter(PersistenceContext pctx)
          Constructor.
 
Method Summary
 java.util.Hashtable<StoreTO,java.util.Collection<ProductAmountTO>> solveOptimization(java.util.Collection<ProductAmountTO> requiredProductAmounts, java.util.Hashtable<Store,java.util.Collection<StockItem>> storeStockItems, java.util.Hashtable<Store,java.lang.Integer> storeDistances)
          Solves an optimisation problem: Optimal transportation costs with respect to The required products and the required amount The available products and their provided amount per providing store The distances between the requiring and the providing store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AmplStarter

public AmplStarter(PersistenceContext pctx)
Constructor.

Parameters:
pctx - PersistenceContext is used for searching existing entities only.
Method Detail

solveOptimization

public java.util.Hashtable<StoreTO,java.util.Collection<ProductAmountTO>> solveOptimization(java.util.Collection<ProductAmountTO> requiredProductAmounts,
                                                                                            java.util.Hashtable<Store,java.util.Collection<StockItem>> storeStockItems,
                                                                                            java.util.Hashtable<Store,java.lang.Integer> storeDistances)
Solves an optimisation problem: Optimal transportation costs with respect to
  1. The required products and the required amount
  2. The available products and their provided amount per providing store
  3. The distances between the requiring and the providing store

Specified by:
solveOptimization in interface OptimisationSolverIf
Parameters:
requiredProductAmounts - Products/Amounts required by the requiring store
storeStockItems - Stock item availability per store.
storeDistances - Distances between requiring store and each providing stores
Returns:
A Hashtable: For each Store the product/amount tuple is given. Those products/amounts have to be delivered by the store.