examples/RealCapacity_maxPV_withGesscon.py
def solve_dynamicprogram(self):  #Whole map calculation for dynamic programming
        """
        Calculates the optimal values of whole map
        """
        start=time.time()
        for timestep in reversed(range(0,self.T)):
            #Solves the optimizaton problem for every initial states at the time step
            for ini_ess_soc,ini_ev_soc,position in product(self.ess_soc_states,self.ev_soc_states,self.ev_pos_states):
                results=self.optimaldecisioncalculator(timestep,ini_ess_soc,ini_ev_soc,position)

                self.Decision[timestep,ini_ess_soc,ini_ev_soc,position]['Grid']=results[0]
                self.Decision[timestep,ini_ess_soc,ini_ev_soc,position]['PV']=results[1]
                self.Decision[timestep,ini_ess_soc,ini_ev_soc,position]['ESS']=-results[2]
                self.Decision[timestep,ini_ess_soc,ini_ev_soc,position]['EV']=-results[3]
                self.Value[timestep,ini_ess_soc,ini_ev_soc,position]=results[1]
        end=time.time()
        print("Dynamic programming execution:",end-start)

        Calculates the optimal values of whole map
        
Calculates the optimal values of whole map
Calculates the optimal values of whole map
def solve_dynamicprogram(self):  
        start=time.time()
        for timestep in reversed(range(0,self.T)):
            for ini_ess_soc,ini_ev_soc,position in product(self.ess_soc_states,self.ev_soc_states,self.ev_pos_states):
                results=self.optimaldecisioncalculator(timestep,ini_ess_soc,ini_ev_soc,position)
                self.Decision[timestep,ini_ess_soc,ini_ev_soc,position]['Grid']=results[0]
                self.Decision[timestep,ini_ess_soc,ini_ev_soc,position]['PV']=results[1]
                self.Decision[timestep,ini_ess_soc,ini_ev_soc,position]['ESS']=-results[2]
                self.Decision[timestep,ini_ess_soc,ini_ev_soc,position]['EV']=-results[3]
                self.Value[timestep,ini_ess_soc,ini_ev_soc,position]=results[1]
        end=time.time()
        print("Dynamic programming execution:",end-start)
def solve_dynamicprogram ( self ) : start = time . time ( ) for timestep in reversed ( range ( 0 , self . T ) ) : for ini_ess_soc , ini_ev_soc , position in product ( self . ess_soc_states , self . ev_soc_states , self . ev_pos_states ) : results = self . optimaldecisioncalculator ( timestep , ini_ess_soc , ini_ev_soc , position ) self . Decision [ timestep , ini_ess_soc , ini_ev_soc , position ] [ 'Grid' ] = results [ 0 ] self . Decision [ timestep , ini_ess_soc , ini_ev_soc , position ] [ 'PV' ] = results [ 1 ] self . Decision [ timestep , ini_ess_soc , ini_ev_soc , position ] [ 'ESS' ] = - results [ 2 ] self . Decision [ timestep , ini_ess_soc , ini_ev_soc , position ] [ 'EV' ] = - results [ 3 ] self . Value [ timestep , ini_ess_soc , ini_ev_soc , position ] = results [ 1 ] end = time . time ( ) print ( "Dynamic programming execution:" , end - start )
Calculates the optimal values of whole map
Calculates the optimal values of whole map
#Whole map calculation for dynamic programming """
        Calculates the optimal values of whole map
        """ #Solves the optimizaton problem for every initial states at the time step
self