IO/inputPreprocess.py
def preprocess(self, data_dict, mqtt_timer):
        self.logger.info("data_dict = " + str(data_dict))
        self.data_dict = data_dict
        self.last_timesamps = mqtt_timer
        self.logger.info("mqtt timer = " + str(mqtt_timer))

        """Read and process data from data dictionary"""
        """Process data dict data to build ev park"""
        self.generate_ev_classes()
        self.generate_charger_classes()
        self.ev_park.set_ev_soc()

        """process the recharge event. if we have soc and recharge = 1 (unplug) then it would be unplug-ed"""
        self.process_events()

        """get processed data"""
        number_of_evs, vac_capacity = self.ev_park.get_num_of_cars(), self.ev_park.get_vac_capacity()
        recharge = self.ev_park.single_ev_recharge()
        self.logger.info("Recharge value: " + str(recharge))

        if not self.initial_pass:
            self.process_initial_uncertainty_data()
        self.generate_behaviour_model()
        soc_value, vac_soc_value = self.process_uncertainty_data()

        """Set the data in data dictionary"""
        self.set_data_in_data_dict(number_of_evs, vac_capacity, soc_value, vac_soc_value, recharge)

        for charger_id, charger in self.ev_park.chargers.items():
            self.logger.info(charger.__str__())

        self.persist_charger_data()

        if not self.initial_pass:
            self.initial_pass = True
        # time.sleep(60)
        self.logger.info("data_dict = " + str(self.data_dict))
        return self.data_dict
Read and process data from data dictionary
Read and process data from data dictionary
Read and process data from data dictionary
def preprocess(self, data_dict, mqtt_timer):
        self.logger.info("data_dict = " + str(data_dict))
        self.data_dict = data_dict
        self.last_timesamps = mqtt_timer
        self.logger.info("mqtt timer = " + str(mqtt_timer))
        self.generate_ev_classes()
        self.generate_charger_classes()
        self.ev_park.set_ev_soc()
        self.process_events()
        number_of_evs, vac_capacity = self.ev_park.get_num_of_cars(), self.ev_park.get_vac_capacity()
        recharge = self.ev_park.single_ev_recharge()
        self.logger.info("Recharge value: " + str(recharge))
        if not self.initial_pass:
            self.process_initial_uncertainty_data()
        self.generate_behaviour_model()
        soc_value, vac_soc_value = self.process_uncertainty_data()
        self.set_data_in_data_dict(number_of_evs, vac_capacity, soc_value, vac_soc_value, recharge)
        for charger_id, charger in self.ev_park.chargers.items():
            self.logger.info(charger.__str__())
        self.persist_charger_data()
        if not self.initial_pass:
            self.initial_pass = True
        self.logger.info("data_dict = " + str(self.data_dict))
        return self.data_dict
def preprocess ( self , data_dict , mqtt_timer ) : self . logger . info ( "data_dict = " + str ( data_dict ) ) self . data_dict = data_dict self . last_timesamps = mqtt_timer self . logger . info ( "mqtt timer = " + str ( mqtt_timer ) ) """Process data dict data to build ev park""" self . generate_ev_classes ( ) self . generate_charger_classes ( ) self . ev_park . set_ev_soc ( ) """process the recharge event. if we have soc and recharge = 1 (unplug) then it would be unplug-ed""" self . process_events ( ) """get processed data""" number_of_evs , vac_capacity = self . ev_park . get_num_of_cars ( ) , self . ev_park . get_vac_capacity ( ) recharge = self . ev_park . single_ev_recharge ( ) self . logger . info ( "Recharge value: " + str ( recharge ) ) if not self . initial_pass : self . process_initial_uncertainty_data ( ) self . generate_behaviour_model ( ) soc_value , vac_soc_value = self . process_uncertainty_data ( ) """Set the data in data dictionary""" self . set_data_in_data_dict ( number_of_evs , vac_capacity , soc_value , vac_soc_value , recharge ) for charger_id , charger in self . ev_park . chargers . items ( ) : self . logger . info ( charger . __str__ ( ) ) self . persist_charger_data ( ) if not self . initial_pass : self . initial_pass = True self . logger . info ( "data_dict = " + str ( self . data_dict ) ) return self . data_dict
Read and process data from data dictionary
Read and process data from data dictionary
"""Read and process data from data dictionary""" """Process data dict data to build ev park""" """process the recharge event. if we have soc and recharge = 1 (unplug) then it would be unplug-ed""" """get processed data""" """Set the data in data dictionary""" # time.sleep(60)
self
data_dict
mqtt_timer