evnrg.common package

Submodules

evnrg.common.bank module

class evnrg.common.bank.QueueMode[source]

Bases: enum.IntEnum

An enumeration.

DEFAULT = 1
RANDOM = 3
RSOC = 6
RTIME = 7
SOC = 4
STACK = 2
TIME = 5
lookup = <bound method QueueMode.lookup of <enum 'QueueMode'>>[source]
class evnrg.common.bank.Bank(max_power: float = 0.0, capacity: float = 0.0, queue_probability: float = 1.0, dynamic_size: bool = False, queue_mode: evnrg.common.bank.QueueMode = <QueueMode.DEFAULT: 1>, evse: list = [], demand_profile: numpy.array = array([], dtype=float64), occupancy_profile: numpy.array = array([], dtype=float64))[source]

Bases: object

add_evse(evse: evnrg.common.evse.EVSE)[source]
add_evse_with_rules(fleet_size: int, chargers: List[evnrg.common.evse.EVSE], rules: dict)[source]
available_evse
capacity
charge_connected(minutes_per_interval: float, idx: int)[source]
demand_profile
dequeue_early_departures(idx: int)[source]
dequeue_vehicle(vic: evnrg.simulation.vehicle.Vehicle)[source]
dequeue_vehicle_index(fleet_index: int)[source]
disconnect_completed_vehicles(idx: int)[source]

Disconnects any vehicles that are effectively done charging.

disconnect_departing_vehicles(idx: int)[source]
dynamic_size
enqueue_vehicle(vic: evnrg.simulation.vehicle.Vehicle)[source]
enqueue_vehicle_prob(vic: evnrg.simulation.vehicle.Vehicle)[source]
max_power
next_available_evse()[source]
num_available
num_occupied
num_operating
occupancy
occupancy_profile
occupied_evse
pct_capacity
pop_next_vehicle()[source]
process_queue()[source]

Checks each EVSE in the bank. If the EVSE is not connected to a vehicle, dequeue one and connect it.

queue
queue_mode
queue_probability
record_demand(idx: int)[source]
record_occupancy(idx: int)[source]
remove_evse(evse: evnrg.common.evse.EVSE)[source]
set_profile_length(size: int)[source]
size
total_demand

evnrg.common.evse module

class evnrg.common.evse.EVSE(model: evnrg.common.evse.EVSEType = EVSEType(max_power=0.0, dc=False, max_soc=1.0, dc_plugs=(None, ), v2g_buffer=0.2, v2g_capable=False))[source]

Bases: object

charge_completed
charge_vehicle(minutes: float)[source]
connect_vehicle(v: evnrg.simulation.vehicle.Vehicle)[source]
connect_vehicle_soc_target(v: evnrg.simulation.vehicle.Vehicle, desired_soc: float)[source]
demand
disconnect_vehicle()[source]
intervals_to_target_soc(minutes_per_interval: float)[source]
is_available
is_connected
class evnrg.common.evse.EVSEType(max_power, dc, max_soc, dc_plugs, v2g_buffer, v2g_capable)[source]

Bases: tuple

dc

Alias for field number 1

dc_plugs

Alias for field number 3

max_power

Alias for field number 0

max_soc

Alias for field number 2

v2g_buffer

Alias for field number 4

v2g_capable

Alias for field number 5

evnrg.common.fuel module

class evnrg.common.fuel.Fuel[source]

Bases: tuple

A NamedTuple that holds numeric values relevant to a fuel.

Parameters:
  • gwp (float) – Gloabl warming potential (CO2e) in kg/L.
  • ( (id) – obj: str, optional): Short description (i.e. “E10”).
  • to an empty string (Defaults) –
gwp

Gloabl warming potential (CO2e) in kg/L.

Type:float
id

A short code describing the fuel.

Type:str
code

Alias for field number 1

gwp

Alias for field number 0

evnrg.common.plug module

class evnrg.common.plug.DCPlug[source]

Bases: enum.IntEnum

DCFC connector enumeration

CHADEMO = 1
COMBO = 2
NONE = 0
TESLA = 3

evnrg.common.powertrain module

class evnrg.common.powertrain.PType[source]

Bases: enum.IntEnum

Constants that refer to the type of drive.

Valid values are: * ICEV: Conventional combustion and hybrids

(i.e. Honda Civic, Toyota Prius)
  • PHEV: Plug-in hybrids (i.e. Chevrolet Volt)
  • BEV: Battery electric vehicles (i.e. Tesla Model 3)
BEV = 3
ICEV = 1
PHEV = 2
class evnrg.common.powertrain.Powertrain[source]

Bases: tuple

A NamedTuple that contains information about the powertrain of a vehicle.

Since the powertrain technical info is all that’s needed for the simulation; make and model information don’t really matter.

However, a code (optional) is useful to keep track of what powertrain has been used.

Attrributes:

id (str): A short code useful for looking up the object in a database. ice_eff (float): Fuel efficiency of the powertrain in km/L. ev_eff (float): Electric efficiency in km/kWh. batt_cap (float): Energy capacity of the battery in kWh. ac_power (float): Maximum input AC power in kW. dc_power (float): Maximum input DC power in kW. dc_plug (int): Connector type for DCFC. ptype (int): Type of powertrain as represented by a PType.

Values may be of PType.ICEV, PType.PHEV, or PType.BEV.
fuel (Fuel): The fuel that this powertrain uses. May be None
if ptype is PType.BEV.
ac_capable

Returns True if the powertrain can accept DC connections.

ac_power

Alias for field number 4

batt_cap

Alias for field number 3

bev

Returns True if the vehicle is a BEV

dc_capable

Returns True if the powertrain can accept AC conenctions.

dc_plug

Alias for field number 6

dc_power

Alias for field number 5

energy_at_soc(soc) → float[source]

Returns how how much energy is in the battery at a given SoC.

ev_eff

Alias for field number 2

fuel

Alias for field number 8

has_ice

Returns True there’s a fuel-powered engine (ICEV or PHEV)

ice_eff

Alias for field number 1

icev

Returns True if the powertrain is a conventional ICEV/HEV

id

Alias for field number 0

pev

Returns True if the powertrain is a plug-in(BEV or PHEV)

phev

Returns True if the the powertrain is a PHEV.

ptype

Alias for field number 7

evnrg.common.scenario module

class evnrg.common.scenario.Scenario(powertrains, distribution, dataset_id, obj_path, run_id, home_threshold_min, away_threshold_min, soc_deferrment_buffer, home_mask_rules)[source]

Bases: tuple

away_banks = [{'probability': 0.1, 'evse': [EVSEType(max_power=50, dc=True, max_soc=0.8, dc_plugs=(<DCPlug.CHADEMO: 1>, <DCPlug.COMBO: 2>), v2g_buffer=0.2, v2g_capable=False)]}, {'probability': 0.2, 'evse': [EVSEType(max_power=7.0, dc=False, max_soc=1.0, dc_plugs=(None,), v2g_buffer=0.2, v2g_capable=False)]}]
away_threshold_min

Alias for field number 6

dataset_id

Alias for field number 2

distribution

Alias for field number 1

home_banks = [{'probability': 1.0, 'queue': <QueueMode.DEFAULT: 1>, 'evse': [EVSEType(max_power=7, dc=False, max_soc=1.0, dc_plugs=(None,), v2g_buffer=0.2, v2g_capable=False), EVSEType(max_power=7, dc=False, max_soc=1.0, dc_plugs=(None,), v2g_buffer=0.2, v2g_capable=False), EVSEType(max_power=6, dc=False, max_soc=1.0, dc_plugs=(None,), v2g_buffer=0.2, v2g_capable=False), EVSEType(max_power=6, dc=False, max_soc=1.0, dc_plugs=(None,), v2g_buffer=0.2, v2g_capable=False)]}]
home_mask_rules

Alias for field number 8

home_threshold_min

Alias for field number 5

obj_path

Alias for field number 3

powertrains

Alias for field number 0

run_id

Alias for field number 4

soc_deferrment_buffer

Alias for field number 7

evnrg.common.status module

class evnrg.common.status.Status[source]

Bases: enum.IntEnum

An enumeration.

ARRIVED = 5
AWAY_ELIGIBLE = 3
COMPLETED = 9
CONNECTED = 7
CONNECTED_V2G = 8
DISCONNECTED = 10
DRIVING = 1
HOME_ELIGIBLE = 4
INELIGIBLE = 2
IN_QUEUE = 6
NONE = 0
STOPPED = 2

Module contents