diff --git a/hub/city_model_structure/life_cycle_assessment/machine.py b/hub/city_model_structure/life_cycle_assessment/machine.py index 9a082600..efdaabb3 100644 --- a/hub/city_model_structure/life_cycle_assessment/machine.py +++ b/hub/city_model_structure/life_cycle_assessment/machine.py @@ -8,10 +8,6 @@ Mohammad Reza Seyedabadi mohammad.seyedabadi@mail.concordia.ca class Machine: - """ - Machine class - """ - def __init__(self, machine_id, name, work_efficiency_rate, work_efficiency_unit, energy_consumption_rate, energy_consumption_unit, emission_factor, @@ -65,3 +61,9 @@ class Machine: """:return: str""" return self._emission_unit + def total_machine_emssion(self): + """:return: float""" + return self._work_efficiency_rate * \ + self._energy_consumption_rate * \ + self._emission_factor + diff --git a/hub/city_model_structure/life_cycle_assessment/vehicle.py b/hub/city_model_structure/life_cycle_assessment/vehicle.py index 27daf245..63b9f667 100644 --- a/hub/city_model_structure/life_cycle_assessment/vehicle.py +++ b/hub/city_model_structure/life_cycle_assessment/vehicle.py @@ -8,4 +8,47 @@ Mohammad Reza Seyedabadi mohammad.seyedabadi@mail.concordia.ca class Vehicle: - pass + def __init__(self, vehicle_id, name, fuel_consumption_rate, + fuel_consumption_unit, carbon_emission_factor, + carbon_emission_unit): + self._vehicle_id = vehicle_id + self._name = name + self._fuel_consumption_rate = fuel_consumption_rate + self._fuel_consumption_unit = fuel_consumption_unit + self._carbon_emission_factor = carbon_emission_factor + self._carbon_emission_unit = carbon_emission_unit + + @property + def id(self): + """:return: int""" + return self._vehicle_id + + @property + def name(self): + """:return: str""" + return self._name + + @property + def fuel_consumption_rate(self): + """:return: float""" + return self._fuel_consumption_rate + + @property + def fuel_consumption_unit(self): + """:return: str""" + return self._fuel_consumption_unit + + @property + def carbon_emission_factor(self): + """:return: float""" + return self._carbon_emission_factor + + @property + def carbon_emission_unit(self): + """:return: str""" + return self._carbon_emission_unit + + def total_vehicle_emission(self): + """:return: float""" + return self._fuel_consumption_rate * self._carbon_emission_factor +