General Comments:
- In the article, figures were generated with tikz. With the following instructions, it is possible to obtain similar figures using matplotlib.
- EV_Example_With_Unplugging.py needs to compute a large matrix at the start, so it may take around 5 minutes with the given parameters.
- Data for Fig 1(b) and 1(c) are thus quite long to obtain (around one hour).
- EV_Example_Without_Unplugging.py needs less time to compute, so if you want to test the model by yourself,
  it will be easier to consider this problem, especially if you want to increase the number of discretization points.
- For the libraries, only numpy, panda, sklearn and matplotlib are required. time is recommended for WH_Example.py to keep an eye on the speed of the Algorithm.
- WH_Example.py, RealDataEV.py and RealDataEV_Misprediction.py needs more time to compute (>1h on a normal laptop most of the time depending on the parameters)

Figures in the main paper:

To obtain 1(a)
Run EV_Example_Without_Unplugging.py and then in the prompt 
plt.imshow(mu2[3],cmap="Blues",vmin=0,vmax=0.009,origin="lower",extent=[9,17,0,1], aspect='auto')
plt.colorbar()
plt.xlabel("Time (in h)")
plt.ylabel("State of charge at the arrival")

To obtain 1(b)
Run EV_Example_Without_Unplugging.py and then in the prompt 
lbda,beta=Algo(R2,rangeR,plot=False,GradientControl=False)
mul=MuLambda(lbda,beta)
plt.imshow(mul[3],cmap="Blues",vmin=0,vmax=0.009,origin="lower",extent=[9,17,0,1], aspect='auto')
plt.colorbar()
plt.xlabel("Time (in h)")
plt.ylabel("State of charge at the arrival")

To obtain 1(c)
Run EV_Example_Without_Unplugging.py and then in the prompt 
lbdaG,beta=Algo(R2,rangeR,plot=False)
mulG=MuLambda(lbdaG,beta)
plt.imshow(mulG[3],cmap="Blues",vmin=0,vmax=0.009,origin="lower",extent=[9,17,0,1], aspect='auto')
plt.colorbar()
plt.xlabel("Time (in h)")
plt.ylabel("State of charge at the arrival")

To obtain Fig 2(a)
Run EV_Example_Without_Unplugging.py and then in the prompt
Algo(R2,rangeR,GradientControl=False)

To obtain Fig 2(b)
Run EV_Example_With_Unplugging.py and then in the prompt 
Algo(R2,rangeR,Klimit=10000)

To obtain Fig 2(c)
Run EV_Example_With_Unplugging.py and then in the prompt 
Algo(R2*0,range(6,13),Klimit=10000)

To obtain Fig 3
Run EV_Example_Without_Unplugging.py and then in the prompt
lbda,beta=Algo(R2,rangeR,GradientControl=False,plot=False)
lbdaG,beta=Algo(R2,rangeR,plot=False)
DisplayConsumption(np.tensordot(fT,MuLambda(lbdaG,beta),axes=[(1,2,3),(0,1,2)]),R2,rangeR,AdditionnalLbda=lbda)

To obtain Fig 4(a)
Run RealDataEV2.py and then in the prompt
plt.plot(Td,NominalConsumption+rHist,label='Nominal consumption')
plt.plot(Td,PredictedConsumption+rHist,label="Predicted consumption")
plt.xlabel("Time")
plt.ylabel("Aggregated consumption")
plt.grid()
plt.legend()

To obtain Fig 4(b)
Run RealDataEV2.py and then in the prompt
AlgoOnTime(650+Td*0,range(0,Nt))

To obtain Fig 4(c)
Run RealDataEV2.py and then in the prompt
AlgoOnTime(650+Td*0,range(0,Nt),S0=S0)

To obtain Fig 5
Run RealDataEV_Misprediction.py and then in the prompt
AlgoOnTime(650+Td*0,range(0,Nt))

In the appendix,

To obtain Fig 7
Run SmallTestSinkhorn.py and then in the prompt
Algo(1000,Epsilon=0.01,plot=False)

To obtain Fig 8
Run SmallTestSinkhorn.py and then in the prompt
CompareEps(np.logspace(-3,3,50))

To obtain Fig 9
Run WH_Example.py and then in the prompt
plotTraj(TrajMarkov2(ProbNom,60,0))

To obtain Fig 10
Run WH_Example.py and then in the prompt
plotTraj(TrajMarkov2FromX(ProbNom,TrajMarkov2(ProbNom,60,0),[14,77]))

To obtain Fig 11
Run WH_Example.py and then in the prompt
lbda=Algo(0.01,R2,100,30)
G=gradJ(3000,100,lbda,R2,0.01)
plotResult(R2,G,range(Nt))

