UNPKG

@ekamjotsingh.ek/energy-management-system

Version:
70 lines (55 loc) 2.47 kB
import EnergyMonitor from './EnergyMonitor'; import RenewableEnergySource from './RenewableEnergySource'; import HVACSystem from './HVACSystem'; import LightingSystem from './LightingSystem'; import CampusAdministrator from './CampusAdministrator'; import EnergyReport from './EnergyReport'; import EnergyPlan from './EnergyPlan'; import Student from './Student'; import Staff from './Staff'; import PersonalEnergyUsage from './PersonalEnergyUsage'; import MaintenanceStaff from './MaintenanceStaff'; import MaintenanceSchedule from './MaintenanceSchedule'; import DataPoint from './DataPoint'; // Create instances of classes const energyMonitor = new EnergyMonitor('monitor1', 'building1'); const renewableEnergySource = new RenewableEnergySource('source1', 'solar', 150); const hvacSystem = new HVACSystem('hvac1', 'building1'); const lightingSystem = new LightingSystem('lighting1', 'building1'); const campusAdmin = new CampusAdministrator('admin1', 'John Doe'); const energyReport = new EnergyReport('report1', new Date()); const energyPlan = new EnergyPlan('plan1', new Date()); const student = new Student('student1', 'Alice'); const staff = new Staff('staff1', 'Bob'); const personalEnergyUsage = new PersonalEnergyUsage('usage1', 'student1', 50); const maintenanceStaff = new MaintenanceStaff('staff1', 'Charlie'); const maintenanceSchedule = new MaintenanceSchedule('schedule1', new Date(), 'equipment1'); const dataPoint = new DataPoint('data1', new Date(), 100); // Displaying data and calling methods console.log('=== Displaying Data ==='); energyMonitor.collectData(); energyMonitor.sendData(); renewableEnergySource.monitorOutput(); renewableEnergySource.storeExcessEnergy(); hvacSystem.controlTemperature(); hvacSystem.scheduleMaintenance(); lightingSystem.controlLighting(); lightingSystem.adjustBrightness(); campusAdmin.generateReport(); campusAdmin.planEnergyUsage(); campusAdmin.monitorRealTimeData(); energyReport.generate(); energyReport.view(); energyReport.export(); energyPlan.adjustEnergyUsage(); energyPlan.integrateWithCalendar(); student.viewPersonalUsage(); student.participateInPrograms(); staff.viewPersonalUsage(); staff.participateInPrograms(); personalEnergyUsage.viewUsage(); personalEnergyUsage.receiveTips(); maintenanceStaff.scheduleMaintenance(); maintenanceStaff.respondToAlerts(); maintenanceSchedule.performMaintenance(); dataPoint.viewData();