6.1.17.1 Methods Defined Here
Init(pcProjectFolder, pcAPSFile, pcAPSComparisonFiles, oStrInfoMessage, oStrError, eMode, oComputeCosts) -> Bool
Init the tariffs engine.
Parameters:
eMode
|
(int) TariffsEngine engine mode (EModes). Default is MODE_NORMAL.
|
oComputeCosts
|
(int) Compute utilities or not (EComputeCosts). Default is COMPUTE_COSTS_YES.
|
oStrError [OUT]
|
(object) Error message if any
|
oStrInfoMessage [OUT]
|
(object) Non error message to show after initialization. If not nullptr, it has a message and has to be deleted.
|
pcAPSComparisonFiles
|
(string) 3 options:
· Files separated by ? that will be stored for comparing. I.e : File1 ? File2 ? File3
-
Empty string. Comparison files will be cleared so no fileswill be used to compare to.
-
nullptr. Comparison files won't be modified and pcAPSFile will be compared to them.
|
pcAPSFile
|
(string) APS file with path. I.e: C:\\My project\\vista\\test.aps
|
pcProjectFolder
|
(string) MIT project folder ending by '\' or not. I.e: C:\\My project\\
|
Returns:
Bool - True if success.
False if fail. See oStrError.
Basic usage:
import iesve
strProjectFolder = 'C:\\MyProject'
strAPSFile = 'C:\\MyProject\\vista\\a_tariff analysis.aps'
strAPSComparisonFiles = 'C:\\MyProject\\vista\\prb.aps'
strInfoMessage = iesve.TariffsEngine.String()
strError = iesve.TariffsEngine.String()
te = iesve.TariffsEngine()
if (not te.Init(strProjectFolder, strAPSFile, strAPSComparisonFiles, strInfoMessage, strError)) :
print(strError.GetString())
else:
print("Init ok")
if (strInfoMessage.Empty() == False) :
print(strInfoMessage.GetString())
SetComparisonProfile(pcFiles)
Sets the file(s) to compare with.
Parameters:
pcFiles
|
(string) string with the files separated by ? or empty. I.e: "File1?File2?File3"
|
Returns:
-
Basic usage:
te = iesve.TariffsEngine(...)
te.SetComparisonProfile("prb.aps?prb2.aps")
GetUtilitiesNamesAndIds() -> List
Gets a tuple with the utilities names and its ids.
Parameters:
-
Returns:
List - list with the utilities.
I.e: [['Electricity', 0], ['Gas', 1], ['Oil', 2], ['Coal', 3],
['Miscellaneous', 4], ['Renewables', 5]]
Basic usage:
te = iesve.TariffsEngine(...)
utilities = te.GetUtilitiesNamesAndIds()
print(utilities)
GetSelectedCurrency() -> Tuple
Gets a tuple with the selected currency data.
Parameters:
-
Returns:
Tuple - tuple with the selected currency.
I.e: ['Polish zloty', 'PLN', 'Poland', 'PLN']
Basic usage:
te = iesve.TariffsEngine(...)
currency = te.GetSelectedCurrency()
print(currency)
GetSuppliersForUtility(iUtilityId) -> List
Gets a tuples list with the suppliers belonging to a utility.
Parameters:
Returns:
List - tuples list with the suppliers belonging to the
utility iUtilityId. Each tuple has utility name
and id, that can be used for other functions.
I.e: [['Electricity Commercial Supplier', 1],
['Electricity Domestic Supplier', 4]
]
Basic usage:
te = iesve.TariffsEngine(...)
suppliers = te.SuppliersForUtility(te.EUtilities.GAS)
print(suppliers)
GetTariffsForSupplier(iSupplierId, strCurrencyId) -> List
Gets a tuple with the tariffs belonging to a supplier and,
optionally, a currency.
Parameters:
iSupplierId
|
(int) Supplier id whose tariffs will be retrieved.
|
strCurrencyId
|
(string) Currency id the tariffs will have to have in order to be retrieved. If "", no currency checking will be carried out. Default "".
|
Returns:
List - tuples list with the tariffs belonging to the
supplier whose id is strSupplierId and using the currency if
specified.
I.e: [['Unrestricted Tariff (£ GBP)', 12],
['Two Rate Tariff (£ GBP)', 13],
['Economy-7 Tariff (£ GBP)', 21],
['Unrestricted Tariff ($ USD)', 23],
['Two Rate Tariff ($ USD)', 24],
['Economy-7 Tariff ($ USD)', 28]
]
Basic usage:
te = iesve.TariffsEngine(...)
tariffs = te.GetTariffsForSupplier(2)
print(tariffs)
GetTariffName(iUtilityId, iTariffId) -> String
Retrieves the name of the tariff whose id is iTariffId and belongs
to the utility iUtilityId.
Parameters:
iTariffId
|
(int) Tariff's id to check
|
iUtilityId
|
(int) EUtilities value. Neither miscellaneous nor renewables are possible.
|
Returns:
String - tariff name or "" if not found.
Basic Usage:
te = iesve.TariffsEngine(...)
name = te.GetTariffName(iesve.TariffsEngine.EUtilities.ELECTRICITY, 4)
print(name)
GetSelectedTariffName(iUtilityId) -> String
Retrieves the name of the selected tariff that belongs to the utility iUtilityId.
Parameters:
iUtilityId
|
(int) EUtilities value. Neither miscellaneous nor renewables are possible.
|
Returns:
String - tariff name or "" if not found.
Basic Usage:
te = iesve.TariffsEngine(...)
name = te.GeSelectedtTariffName(iesve.TariffsEngine.EUtilities.ELECTRICITY)
print(name)
GetTariffCurrencyUnits(iUtilityId, iTariffId) -> String
Returns a text with the symbol of the selected currency divided by
the unit of the tariff whose id is iTariffId. I.e: $/T
Parameters:
iTariffId
|
(int) Tariff's id
|
iUtilityId
|
(int) EUtilities value. Neither miscellaneous nor renewables are possible.
|
Returns:
String - A text with the symbol of the selected currency divided
by the unit of the tariff whose id is iTariffId. I.e: $/T
Basic usage:
te = iesve.TariffsEngine(...)
currencyUnits = te.GetTariffCurrencyUnits(iesve.TariffsEngine.EUtilities.ELECTRICITY, 4)
print(currencyUnits)
GetRatesTimeSeries(iUtility, iFirstDay, iLastDay) -> Numpy Object
Returns a numpy object with the rates applied per time gap from iFirstDay to iLastDay for utility iUtility, that has previously been computed.
Parameters:
iFirstDay
|
(int) First day whose rates per time gap will be stored: 1,...365, 366… If -1, it will be taken from the APS.
Default value = -1
iFirstDay<=iLastDay
|
iLastDay
|
(int) Last day whose rates per time gap will be stored: 1,...365, 366... If -1, it will be taken from the APS.
Default value = -1
iFirstDay<=iLastDay
|
iUtility
|
|
Returns:
Numpy Object - numpy object with the proposed demand cost per time gap.
Basic usage:
te = iesve.TariffsEngine(...)
costsPerGap = te.GetRatesTimeSeries(iesve.TariffsEngine.EUtilities.OIL, 1, 365)
print(str(costsPerGap.size) + " values retrieved")
if costsPerGap.size>0:
print(costsPerGap[0])
ComputeWithTariff(iUtilityId, iSupplierId, iTariffId)
Computes the utility iUtilityId using supplier iSupplierId and tariff iTariffId.
Parameters:
iSupplierId
|
(int) Supplier id to be set. If not found, an exception is thrown.
|
iTariffId
|
(int) Tariff id to be set. If not found or doesn't belong to iSupplierId, an exception is thrown.
|
iUtilityId
|
|
Returns:
-
Basic usage:
te = iesve.TariffsEngine(...)
te.ComputeWithTariff(iesve.TariffsEngine.EUtilities.OIL, 1, 3)
ComputeWithFlatRate(iUtilityId, dbFlatRate)
Computes the utility's costs using the flat rate.
Parameters:
dbFlatRate
|
(float) flat rate to use. If <0, the current utility's flat rate will be used.
|
iUtilityId
|
|
Returns:
-
Basic usage:
te = iesve.TariffsEngine(...)
te.ComputeWithFlatRate(iesve.TariffsEngine.EUtilities.COAL, .075)
GetProposedNetCost(iUtilityId) -> float
Returns the proposed cost for a utility or total.
Parameters:
iUtilityId
|
(int) EUtilities value. If -1, the total cost of all of the utilities summed up will be returned.
|
Returns:
float - proposed total cost.
Basic usage:
te = iesve.TariffsEngine(...)
print(te.GetProposedNetCost(iesve.TariffsEngine.EUtilities.GAS))
GetBaselineNetCost(iUtilityId) -> float
Returns the baseline cost for a utility or total.
Parameters:
iUtilityId
|
(int) EUtilities value. If -1, the total cost of all of the utilities summed up will be returned.
|
Returns:
float - baseline total cost.
Basic usage:
te = iesve.TariffsEngine(...)
print(te.BaselineNetCost(iesve.TariffsEngine.EUtilities.GAS))
Improvement() -> float
Read only property containing the % of improvement.
Parameters:
-
Return Value:
float - % improvement.
Basic usage:
te = iesve.TariffsEngine(...)
print(te.Improvement)
AcceptChanges() -> String
Accepts changes done. It will save the results, selected tariffs etc.
Parameters:
-
Returns:
String - Error message if any.
Basic usage:
te = iesve.TariffsEngine(...)
error = te.AcceptChanges()
if error:
print(error)