UNPKG

corrently-charge

Version:

Reference implementation of flexible charging tariffs for CPOs and EMTs based on Green Power Index and SolarEnergyPrediction APIs. Part of #mobilitython2022 - Enpulse challenge.

20 lines (18 loc) 598 B
/** * Decleration of a Tarif */ module.exports = function(name,maxpower,minduration,price,ghg,soctarget,priceunit,localenergy,reservedenergie) { this.name = name; this.maxpower = maxpower; this.minduration = minduration; // Minimum time required vehicle to be connected in Minutes this.price = Math.round(price*100)/100; this.ghg = Math.round(ghg); this.priceunit = priceunit; this.soctarget = soctarget; this.localenergy = localenergy; this.totalenergy = reservedenergie; if(!isNaN(reservedenergie)) { this.gridenergy = reservedenergie - localenergy; } return this; }