UNPKG

@ekamjotsingh.ek/energy-management-system

Version:
32 lines (31 loc) 978 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Class representing a renewable energy source. */ class RenewableEnergySource { /** * Create a RenewableEnergySource instance. * @param sourceID - Unique identifier for the energy source. * @param type - Type of the energy source (e.g., solar, wind). * @param output - Current output of the energy source. */ constructor(sourceID, type, output) { this.sourceID = sourceID; this.type = type; this.output = output; } /** * Simulate monitoring the output of the energy source. */ monitorOutput() { console.log(`Monitoring ${this.type} energy source ${this.sourceID} with output ${this.output}W.`); } /** * Simulate storing excess energy. */ storeExcessEnergy() { console.log(`Storing excess energy from source ${this.sourceID}.`); } } exports.default = RenewableEnergySource;