Documentation of UrbanFireXDT
Documentation of UrbanFireXDT
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
EVFSM Class Reference

#include <components.h>

Inheritance diagram for EVFSM:
Inheritance graph

Public Member Functions

 EVFSM (unsigned long carID, ComponentCS *homeStation)
 
 ~EVFSM ()
 
EVState get_current_state () const
 
const std::vector< double > * get_future_max_power_kW () const
 Returns the maximum power of this EV per time step in the controller horizon. Attention: Returned object will be overwritten after calling EVFSM::setCarStateForTimeStep().
 
double get_currentDemand_kW () const
 Gets the current charging power in kW; Only valid after calling EVFSM::setDemandToProfileData() or EVFSM::setDemandToGivenValue()
 
std::string * get_metrics_string_annual ()
 Returns some metrics as string (useful for the output). Header see EVFSM::MetricsStringHeaderAnnual. Call this function only if simulation run is finished!
 
const ComponentBSget_battery () const
 Returns a reference to the battery component of the EV.
 
void set_horizon_in_ts (unsigned int new_horizon)
 
void add_weekly_tour (short weekday, unsigned long departure_ts_of_day, unsigned long ts_duration, double tour_length_km, bool with_work)
 This method adds a home-centered car tour to the current car. All parameters that represent a time must have the same alignment as the global time information.
 
void preprocessTourInformation ()
 Transforms the list of weekly tours into a list of tours for the complete simulation time span and computes upper and lower cumlulative energy required (i.e., fill variables BaseComponentSemiFlexible::future_maxE_storage and BaseComponentSemiFlexible::future_minE_storage from upper class). THis method MUST be called before the main simulation run starts, but it MUST be called after EVFSM::add_weekly_tour() is called for the last time, i.e., all tours have been added.
 
void resetInternalState ()
 Resets the internal state.
 
void setCarStateForTimeStep (unsigned long ts)
 Sets the car state for a new time step 'ts'. This method must be called with strictly consecutive values ​​of parameter 'ts'. It uses the precomputed vectors for internal processing.
 
void setDemandToProfileData (unsigned long ts)
 
bool setDemandToGivenValue (double new_demand_kW)
 
void resetWeeklyCounter ()
 Do nothing. The EV has no weekly metrics.
 
const std::vector< double > * get_future_max_consumption_kWh () const
 
const std::vector< double > * get_future_min_consumption_kWh () const
 
virtual double get_currentDemand_kW () const=0
 
void set_horizon_in_ts (unsigned int new_horizon)
 
virtual void setDemandToProfileData (unsigned long ts)=0
 
virtual bool setDemandToGivenValue (double new_demand_kW)=0
 
- Public Member Functions inherited from BaseComponentSemiFlexible
 BaseComponentSemiFlexible ()
 
 ~BaseComponentSemiFlexible ()
 
const std::vector< double > * get_future_max_consumption_kWh () const
 
const std::vector< double > * get_future_min_consumption_kWh () const
 
void set_horizon_in_ts (unsigned int new_horizon)
 
- Public Member Functions inherited from BaseComponent
virtual ~BaseComponent ()
 

Static Public Member Functions

static const std::map< unsigned long, EVFSM * > & GetArrayOfInstances ()
 Returns the map of all existing instances. The objects itself are mutable, but the map reference is const.
 
static unsigned long GetNumberOfEVs ()
 
static void AddWeeklyTour (unsigned long carID, short weekday, unsigned long departure_ts_of_day, unsigned long ts_duration, double tour_length_km, bool with_work)
 This class method adds a home-centered car tour to the car with ID carID. All parameters that represent a time must have the same alignment as the global time information.
 
static void VacuumStaticVariables ()
 
static void SetSeed (unsigned int seed)
 Sets the seed for the EVFSM-class random number generator.
 

Static Public Attributes

static const std::string MetricsStringHeaderAnnual = "CarID,HomeControlUnitID,Driving distance [km],E used for driving [kWh],Home-charged E [kWh],Home-discharged E [kWh],n ts home-connected"
 The header for the output string produced by EVFSM::get_metrics_string_annual()
 

Additional Inherited Members

- Protected Attributes inherited from BaseComponentSemiFlexible
std::vector< double > future_maxE_storage
 
std::vector< double > future_minE_storage
 

Detailed Description

This class represents a EV (electric vehicle) modeled as a finite-state machine.

It is a finite-state machine with the states:

Moreover, it has a battery component (the same as it is used for simulating the residential batteries).

Finally, it holds an attached driving profile.

Constructor & Destructor Documentation

◆ EVFSM()

EVFSM::EVFSM ( unsigned long  carID,
ComponentCS homeStation 
)

◆ ~EVFSM()

EVFSM::~EVFSM ( )

Member Function Documentation

◆ add_weekly_tour()

void EVFSM::add_weekly_tour ( short  weekday,
unsigned long  departure_ts_of_day,
unsigned long  ts_duration,
double  tour_length_km,
bool  with_work 
)

This method adds a home-centered car tour to the current car. All parameters that represent a time must have the same alignment as the global time information.

◆ AddWeeklyTour()

void EVFSM::AddWeeklyTour ( unsigned long  carID,
short  weekday,
unsigned long  departure_ts_of_day,
unsigned long  ts_duration,
double  tour_length_km,
bool  with_work 
)
static

This class method adds a home-centered car tour to the car with ID carID. All parameters that represent a time must have the same alignment as the global time information.

◆ get_battery()

const ComponentBS * EVFSM::get_battery ( ) const
inline

Returns a reference to the battery component of the EV.

◆ get_current_state()

EVState EVFSM::get_current_state ( ) const
inline

◆ get_currentDemand_kW() [1/2]

double EVFSM::get_currentDemand_kW ( ) const
inlinevirtual

Gets the current charging power in kW; Only valid after calling EVFSM::setDemandToProfileData() or EVFSM::setDemandToGivenValue()

Implements BaseComponentSemiFlexible.

◆ get_currentDemand_kW() [2/2]

virtual double BaseComponentSemiFlexible::get_currentDemand_kW ( ) const
virtual

◆ get_future_max_consumption_kWh()

const std::vector< double > * BaseComponentSemiFlexible::get_future_max_consumption_kWh ( ) const
inline

Returns the maximum electricity consumption of a component for the next n time steps (given some flexibility). This means that the value at position 0 returns the maximum cummulated consumption AT THE END of the current time step. This method assumes to start in the current time step, i.e. the consumption up to the current time step is considered to be 0. The length of the resulting vector is set using BaseComponentSemiFlexible::set_horizon_in_ts(). Attention: The object the returned pointer referes to is overwritten on subsequent calls!

Returns
: Returns a pointer to a vector storing min/max demand per future time step - READ THE ATTENTION NOTICE

◆ get_future_max_power_kW()

const std::vector< double > * EVFSM::get_future_max_power_kW ( ) const
inline

Returns the maximum power of this EV per time step in the controller horizon. Attention: Returned object will be overwritten after calling EVFSM::setCarStateForTimeStep().

◆ get_future_min_consumption_kWh()

const std::vector< double > * BaseComponentSemiFlexible::get_future_min_consumption_kWh ( ) const
inline

Returns the minimum electricity consumption of a component for the next n time steps (given some flexibility). This means that the value at position 0 returns the minimum cummulated consumption AT THE END of the current time step. This method assumes to start in the current time step, i.e. the consumption up to the current time step is considered to be 0. The length of the resulting vector is set using BaseComponentSemiFlexible::set_horizon_in_ts(). Attention: The object the returned pointer referes to is overwritten on subsequent calls!

Returns
: Returns a pointer to a vector storing min/max demand per future time step - READ THE ATTENTION NOTICE

◆ get_metrics_string_annual()

std::string * EVFSM::get_metrics_string_annual ( )

Returns some metrics as string (useful for the output). Header see EVFSM::MetricsStringHeaderAnnual. Call this function only if simulation run is finished!

◆ GetArrayOfInstances()

static const std::map< unsigned long, EVFSM * > & EVFSM::GetArrayOfInstances ( )
inlinestatic

Returns the map of all existing instances. The objects itself are mutable, but the map reference is const.

◆ GetNumberOfEVs()

static unsigned long EVFSM::GetNumberOfEVs ( )
inlinestatic

◆ preprocessTourInformation()

void EVFSM::preprocessTourInformation ( )

Transforms the list of weekly tours into a list of tours for the complete simulation time span and computes upper and lower cumlulative energy required (i.e., fill variables BaseComponentSemiFlexible::future_maxE_storage and BaseComponentSemiFlexible::future_minE_storage from upper class). THis method MUST be called before the main simulation run starts, but it MUST be called after EVFSM::add_weekly_tour() is called for the last time, i.e., all tours have been added.

< Reference to the current weekly tour

◆ resetInternalState()

void EVFSM::resetInternalState ( )
virtual

Resets the internal state.

Implements BaseComponent.

◆ resetWeeklyCounter()

void EVFSM::resetWeeklyCounter ( )
inlinevirtual

Do nothing. The EV has no weekly metrics.

Implements BaseComponent.

◆ set_horizon_in_ts() [1/2]

void BaseComponentSemiFlexible::set_horizon_in_ts ( unsigned int  new_horizon)

Sets another horizon for the number of time steps returned by BaseComponentSemiFlexible::get_future_min_max_demand()

◆ set_horizon_in_ts() [2/2]

void EVFSM::set_horizon_in_ts ( unsigned int  new_horizon)

◆ setCarStateForTimeStep()

void EVFSM::setCarStateForTimeStep ( unsigned long  ts)

Sets the car state for a new time step 'ts'. This method must be called with strictly consecutive values ​​of parameter 'ts'. It uses the precomputed vectors for internal processing.

◆ setDemandToGivenValue() [1/2]

bool EVFSM::setDemandToGivenValue ( double  new_demand_kW)
virtual

Changes the (shiftable) demand of the component for the current time step. It must be called before the current demand and total consumption values are set correctly. If this function is called, BaseComponentSemiFlexible::setDemandToProfileData() must not be called anymore.

Parameters
new_demand_kWThe new power for this time step in kW.
Returns
true if no error occured or false, if the upper or lower bound was violated

Implements BaseComponentSemiFlexible.

◆ setDemandToGivenValue() [2/2]

virtual bool BaseComponentSemiFlexible::setDemandToGivenValue ( double  new_demand_kW)
virtual

Changes the (shiftable) demand of the component for the current time step. It must be called before the current demand and total consumption values are set correctly. If this function is called, BaseComponentSemiFlexible::setDemandToProfileData() must not be called anymore.

Parameters
new_demand_kWThe new power for this time step in kW.
Returns
true if no error occured or false, if the upper or lower bound was violated

Implements BaseComponentSemiFlexible.

◆ setDemandToProfileData() [1/2]

void EVFSM::setDemandToProfileData ( unsigned long  ts)
virtual

Sets the demand value to the value as given in the data. If this function is called, BaseComponentSemiFlexible::setDemandToGivenValues() must not be called anymore.

Implements BaseComponentSemiFlexible.

◆ setDemandToProfileData() [2/2]

virtual void BaseComponentSemiFlexible::setDemandToProfileData ( unsigned long  ts)
virtual

Sets the demand value to the value as given in the data. If this function is called, BaseComponentSemiFlexible::setDemandToGivenValues() must not be called anymore.

Implements BaseComponentSemiFlexible.

◆ SetSeed()

void EVFSM::SetSeed ( unsigned int  seed)
static

Sets the seed for the EVFSM-class random number generator.

◆ VacuumStaticVariables()

void EVFSM::VacuumStaticVariables ( )
static

Member Data Documentation

◆ MetricsStringHeaderAnnual

const std::string EVFSM::MetricsStringHeaderAnnual = "CarID,HomeControlUnitID,Driving distance [km],E used for driving [kWh],Home-charged E [kWh],Home-discharged E [kWh],n ts home-connected"
static

The header for the output string produced by EVFSM::get_metrics_string_annual()


The documentation for this class was generated from the following files: