function readDAT_example(path) f=open(path) #TempMat=readdlm(f) temp = round(Int64,(map(float,split(strip(readline(f)))))) #generating Data parameters numvehicles=temp[1] numcustomers=temp[2] numorigindepots=temp[3] numdestdepots=temp[4] numrecharging=temp[5] numrepetitions=temp[6] H=temp[7] numartificialdepots=2*numvehicles P=collect(1:numcustomers) D=collect(numcustomers+1:2*numcustomers) FO=numcustomers*2+numorigindepots FD=numcustomers*2+numorigindepots+numdestdepots AOD=collect(numcustomers*2+numorigindepots+numdestdepots+1:numcustomers*2+numorigindepots+numdestdepots+numvehicles) ADD=AOD+size(AOD,1) S=collect((numcustomers*2+numorigindepots+numdestdepots+size(AOD,1)+size(ADD,1)+1):(numcustomers*2+numorigindepots+numdestdepots+size(AOD,1)+size(ADD,1)+numrecharging)) if numrecharging>1 S_rep=collect((numcustomers*2+numorigindepots+numdestdepots+size(AOD,1)+size(ADD,1)+numrecharging+1):(numcustomers*2+numorigindepots+numdestdepots+size(AOD,1)+size(ADD,1)+numrecharging*numrepetitions)) end numlocations=(numcustomers*2+numorigindepots+numdestdepots+numrecharging*numrepetitions+numartificialdepots) n=numcustomers east=zeros(numlocations) north=zeros(numlocations) d=zeros(numlocations) l=zeros(numlocations) arr=zeros(numlocations) dep=zeros(numlocations) #Read Locations' info for i=1:numlocations if in(i,S_rep)==false temp = map(float,split(strip(readline(f)))) east[i]=temp[2] north[i]=temp[3] d[i]=temp[4] l[i]=temp[5] arr[i]=temp[6] dep[i]=temp[7] else east[i]=east[i-numrecharging] north[i]=north[i-numrecharging] d[i]=d[i-numrecharging] l[i]=l[i-numrecharging] arr[i]=arr[i-numrecharging] dep[i]=dep[i-numrecharging] end end l=round(Int64,l) FO=round(Int64,(map(float,split(strip(readline(f)))))) FD=round(Int64,(map(float,split(strip(readline(f)))))) AOD= round(Int64,(map(float,split(strip(readline(f)))))) ADD= round(Int64,(map(float,split(strip(readline(f)))))) S=round(Int64,(map(float,split(strip(readline(f)))))) S=union(S,S_rep) u=map(float,split(strip(readline(f)))) ############################################################################################## #Calculating t matrix Cordeau_Uber=basename(path) t=zeros(numlocations,numlocations) #Compute t matrix as eucledian distance for i=1:numlocations for j=1:numlocations t[i,j]=sqrt((east[i]-east[j])^2+(north[i]-north[j])^2) end end #Time Windows tightening #Arrivals for i=P arr[i]=round(max(arr[i],arr[i+n]-d[i]-u[i]),2) arr[i+n]=round(max(arr[i+n],arr[i]+d[i]+t[i,i+n]),2) end for j=S temp=1e9 for k=FO temp=min(temp,arr[k]+t[k,j]) #arr[j]=round(max(arr[j],arr[k]+t[k,j]),2) end arr[j]=round(max(arr[j],temp),2) end #Departures for i=P dep[i]=round(min(dep[i+n]-t[i,i+n]-d[i],dep[i]),2) dep[i+n]=round(min(dep[i]+u[i]+d[i],dep[i+n]),2) end for j=S temp=-1e9 for k=FD temp=max(temp,dep[k]-t[j,k]) #dep[j]=round(min(dep[j],dep[k]-t[j,k]),2) end dep[j]=round(min(dep[j],temp),2) end # Big-M parameters M_T=zeros(numlocations,numlocations) M_C=zeros(numlocations,numlocations) for j=1:numlocations for i=1:numlocations temp=dep[i]+d[i]+t[i,j]-arr[j] if (temp>=0) M_T[i,j]=round(temp,2) end end end return numvehicles,numcustomers,numorigindepots,numdestdepots,numrecharging,numrepetitions,H,P,D,d,l,arr,dep,FO,FD,S,AOD,ADD,u,t,M_T end