Question: Greedy Heuristic in Maple

Maple Professionals: I wish to prgramm a greedy heuristic in maple and would be more than grateful, if someone could help me, since I am no expert in programming. The problem is a simple stocking problem. There are two parts I wish to stock in my warehouse. I know their demand, delivery time and item cost. From the demand and the delivery time I can calculate the expected backorders given a specified number of units in stock based on a poisson distribution. In the greedy heuristic step by step I increase the stock of all items by 1 and then calculate the reduction in expected backorders divided by the item cost (some kind of "bang per buck"). I then compare the reduction over all items and increase the stock by one for the item with the highest reduction. For the output I wish maple to show me the stock level of the two items and the sum of the expected backorders over the two items at each stage of the algorithm. I only got so far, to programm how two calculate the bang per buck in the first stage, where delta represents the "bang per buck": Depot Optimization Problem > restart; > with(stats): > with(student): ___________________________________________________________________________________ Lead Times(years) > L[1] := 0.1; L[2] := 0.08; Average Base Demand per year > lambda[1] := 10; lambda[2] := 50; Item Cost ($ 1000) > c[1] := 5; c[2] := 1; Starting Point: Inventory Level > s[1] := 0; s[2] := 0; Increase in system effetiveness per dollar(Bang per Buck) > for i to 2 do Delta[i] := ((sum((k-s[i])*(L[i]*lambda[i])^k*evalf(exp(-L[i]*lambda[i]))/factorial(k), k = s[i]+1 .. infinity))-(sum((k-s[i]-1)*(L[i]*lambda[i])^k*evalf(exp(-L[i]*lambda[i]))/factorial(k), k = s[i]+2 .. infinity)))/c[i] end do > for max(delta[1], delta[2]) do s[i]= s[i]+1 end do I would be more than grateful for any help from your side, Thx so much in advance, Fred
Please Wait...