Car Rental


    {  Exmpl10.1-1_CarRental.mpl  }

    {  Applications of Optimization with Xpress-MP  }

    {  Chapter 10.1,  Car Rental,  Size: 10x24,  Page 189 }


TITLE
    CarRental;

INDEX
    agent := 1..10;

DATA
    Req[agent]   := (10, 6, 8,11, 9, 7,15, 7, 9,12);
    Stock[agent] := ( 8,13, 4, 8,12, 2,14,11,15, 7);
    X[agent]     := ( 0,20,18,30,35,33, 5, 5,11, 2);
    Y[agent]     := ( 0,20,10,12, 0,25,27,10, 0,15);
    Cost := 0.5;
    CNeedExc[agent] := Stock - Req;

INDEX
    need[agent] WHERE (CNeedExc < 0);
    excess[agent] WHERE (CNeedExc > 0);

DATA
    XDist[excess,need] := FORMULA(X[agent:=excess] - X[agent:=need]);
    YDist[excess,need] := FORMULA(Y[agent:=excess] - Y[agent:=need]);
    XYDist[excess,need] := XDist^2 + YDist^2;
    Dist[excess,need] := FORMULA(1.3 * sqrt(XYDist));

VARIABLE
    Move[excess,need];

MODEL

    MIN TransportCosts = SUM(excess,need: Cost * Dist * Move);

SUBJECT TO

    ExcessAvailablity[excess] -> EAV:
        SUM(need: Move) = Stock - Req;

    NeedCars[need] -> NDC:
        SUM(excess: Move) = Req - Stock;

INTEGER
    Move;

END


Back To Top | Maximal Home Page | List of Models | Previous Page | Next Page