wsyCUHK/Reinforcement-Learning-for-Real-time-Pricing-and-Scheduling-Control-in-EV-Charging-Stations

the charging order is right?

Opened this issue · 2 comments

if residual_demand.shape[0]>0.5:
#return reward,residual_demand,torch.tensor([0,0,0,0,0])
least=residual_demand[:,1]-residual_demand[:,0]
order=[operator.itemgetter(0)(t)-1 for t in sorted(enumerate(least,1), key=operator.itemgetter(1), reverse=True)]
residual_demand[order[:action[1]],0]=residual_demand[order[:action[1]],0]-1
residual_demand[:,1]=residual_demand[:,1]-1

Dear Author
I am wondering If this order is right?
order=[operator.itemgetter(0)(t)-1 for t in sorted(enumerate(least,1), key=operator.itemgetter(1), reverse=True)]

residual_demand[:,1] is parking time
residual_demand[:,0] is charging demand

order put the biggest in least as the most need to be charged.
But the biggest in least means its parking time is much larger than charging demand, I thought in this case the biggest in least means it can wait more time, so cannot put it as the most urgent.

maybe the reserse should be False, such as:
order=[operator.itemgetter(0)(t)-1 for t in sorted(enumerate(least,1), key=operator.itemgetter(1), reverse=False)]

Yes, the reverse should be False. Thank you for pointing out the error. I will check the code recently.

OK!
And I also have other two questions:

  1. this line 38 no need for indentation

    for i in range(5):
    out1=np.concatenate((out1,m['out1']),axis=1)
    out2=np.concatenate((m['out2'],m['out2']),axis=1)
    for i in range(5):
    out2=np.concatenate((out2,m['out2']),axis=1)
    out3=np.concatenate((m['out3'],m['out3']),axis=1)
    for i in range(5):
    out3=np.concatenate((out3,m['out3']),axis=1)

  2. In the paper feature2(Eq.(15)) is electricity price multiply total charging rate
    f_{2}\left(S_{t}, A_{t}\right)=-c_{t} e_{t}
    However in line 115 the feature2 is action[1], i.e. the total charging rate.