Multi-Compartment VRP With Electric heterogenous fleet

42 views
Skip to first unread message

reinoud fonken

unread,
May 21, 2018, 10:27:36 AM5/21/18
to AMPL Modeling Language
Hi, 

I am currently working on a Multi-Compartment VRP With Electric heterogenous fleet. To model the electric part, i have included some features such as recharging stations and a variable for battery level and a variable for service time. Unfortunataly my model does not take these variable right into account. It should be that for every vehicle that leaves the depot the battery level decays and is recharged fully when visiting a rechargingstation however it does not decay properly and instead of displaying the vehicles that only serve the customer, it display all the vehicles that are available. The Service time variable does work almost correctly( it only accounts for the vehicles leaving from the depot to serve the customers) but somehow it shows the maximum time limit (230) when serving a customer. 

Can someone help me with these problems? 

Here are the variables used:

var y{i in N, k in V},>=0 integer; # battery level of vehicle k at node i

var w{i in N, k in V},>=0 integer; #starting time serving customer i or enter recharge node by vehicle k, 0 if node i is not visited


Plus the corresponding constraints:


Set C is customers, R is Rechargingstations, N are all the nodes including the depot node {0} and {9}. Set V is vehicles


parameters: r is recharging rate, d(i,j) is distance,  Y{k} is full battery level, Big M = 230, t(i,j) is travel time and s{i} is service time. 


s.t. c4{i in C,j in N: i<>j}: 

sum {k in V} (y[j,k] + (r[k]*d[i,j] + Y[k])*x[i,j,k]) <=sum{k in V}(y[i,k] + Y[k]); # Roberti, when Customer is visited, 


s.t. c5{i in R,j in N: i<>j}:

sum{k in V} y[j,k] <=sum{k in V}(Y[k] -(r[k]*d[i,j])*x[i,j,k]); #Battery fully charged minus travelled distance when R is visited


s.t. c6{k in V, i in C, j in N: i<>j}:

w[i,k] + (t[i,j]+s[i])*x[i,j,k] - M*(1 - x[i,j,k]) <= w[j,k]; # starting time of next customer has to consider other nodes, with Big M param


s.t. c7{k in V, i in R, j in N: i<>j}:

w[i,k] + t[i,j]*x[i,j,k] + g[k]*(Y[k]- y[i,k]) - M*(1-x[i,j,k]) <= w[j,k]; # recharging time, with Big M param


s.t. c11{k in V}:

y[0,k]=Y[k]; # battery levels


The following output for w{i,k} and y{i,k} I get:


w [*,*] (tr)

:    0   1   2    3    4    5    6     7     8     9     := 0,9 is depot, 1,2,3 are recharing stations and 4 till 8 are customers( small data set)

1    0   0   0     0    0   0     0     0     0     0

2    0   0   0     0    0   0     0     0     0     0

3    0   0   0     0    0   0     0     0     0     0

4    0   0   0     0    0   0     0     0     0     0

5    0   0   0     0    0   0     0     0     0     0

6    0   0   0     0    0   0     0     0     0     0

7    0   0   0     0    0   0     0     0     0     0

8    0   0   0     0    0   0     0     0     0     0

9    0   0   0     0    0   0     0     0     0     0

10   0   0   0     0    0   0     0     0     0     0

11   0   0   0     0    0   0   230     0     0   261

12   0   0   0     0   35   0     0     0   230    85

13   0   0   0     0    0   0     0     0     0     0

14   0   0   0     0    0   0     0     0     0     0

15   0   0   0     0    0   0     0     0     0     0

16   0   0   0     0    0   0     0     0     0     0

17   0   0   0     0    0   0     0     0     0     0

18   0   0   0     0    0   0     0     0     0     0

19   0   0   0     0    0   0     0     0     0     0

20   0   0   0     0    0   0     0     0     0     0

21   0   0   0     0    0   0     0     0     0     0

22   0   0   0     0    0   0     0     0     0     0

23   0   0   0     0    0   0     0     0     0     0

24   0   0   0   230    0   0     0   230     0   258

25   0   0   0     0    0   0     0     0     0     0

;

( 1 t/m 25 are vehicles, 1 t/m5 is the same vehicle type, 6 t/m 10 another type etcetera) 


y [*,*] (tr)

:    0    1    2    3    4   5    6    7    8   9    :=

1    61    0    0   61   0   61   61   61   0   0

2    61    0    0   61   0   61   61   61   0   0

3    61    0    0   61   0   23   61   61   0   0

4    61    0    0   61   0    0   61   61   0   0

5    61    0    0   61   0    0   61   61   0   0

6    61    0    0   61   0    0   61   61   0   0

7    61    0    0   61   0    0   61   61   0   0

8    61    0    0   61   0    0   61   61   0   0

9    61    0    0   61   0    0   61   61   0   0

10   61    0    0   61   0    0   61    6   0   0

11   61   61   61   61   0    0   61    0   0   0

12   61   61   61   61   0    0   61    0   0   0

13   61    0    0   61   0    0   61    0   0   0

14   61    0    0   61   0    0   42    0   0   0

15   61    0    0   61   0    0    0    0   0   0

16   61    0    0   61   0    0    0    0   0   0

17   61    0    0   61   0    0    0    0   0   0

18   61    0    0   61   0    0    0    0   0   0

19   61    0    0   61   0    0    0    0   0   0

20   61    0    0   61   0    0    0    0   0   0

21   61    0    0    0   0    0    0    0   0   0

22   61    0    0   61   0    0    0    0   0   0

23   61    0    0   61   0    0    0    0   0   0

24   61   61   61   61   0    0    0    0   0   0

25   61    0    0   61   0    0    0    0   0   0;


I would really appreciate it if you anyone can help me with this problem!


Best regards,


Reinoud


AMPL Google Group

unread,
May 22, 2018, 7:02:36 PM5/22/18
to Ampl Modeling Language
It is unlikely that someone will want to figure out your whole model and tell you how it should be fixed. So you will need to do some more investigation yourself, after which you may have a more specific question to ask. Usually the investigation proceeds in one of these ways:
  • If you are getting a solution that should not be allowed, then you should study the constraint that is supposed to prevent that solution, to see why the solution is being allowed incorrectly.
  • If you are getting an allowable solution but it seems much worse than optimal, then you should construct a better solution and then consider which constraint is preventing that solution.
Often it is helpful to use AMPL's "expand" command (for example, "expand c4;") to see the specific constraints that were generated from your model and data.

--
Robert Fourer
am...@googlegroups.com
{#HS:584945926-8200#}
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



reinoud fonken

unread,
May 23, 2018, 3:37:47 AM5/23/18
to am...@googlegroups.com
Thank u! Yes maybe it is to much to ask indeed. I will try to look into the problem further and elaborate on it more specific if i can not fix it. 


Reply all
Reply to author
Forward
0 new messages