Package org.kigalisim.engine.state
Class ConverterStateGetter
java.lang.Object
org.kigalisim.engine.state.ConverterStateGetter
- All Implemented Interfaces:
StateGetter
Class providing state information needed for unit conversions.
Interfaces with the engine to retrieve information about current substance consumption, volumes, populations, time elapsed, and other metrics needed to convert between different unit types in the model. This may be required to perform certain unit conversions like from number of units of equipment to tCO2e (relies on charge levels).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the consumption ratio per unit of population.Get the amortized initial charge volume per unit for sales.Get the total energy consumption for the current state.Get the energy consumption intensity per unit volume.Get the total ghg consumption for the current state.Get the current equipment population.getPopulationChange(UnitConverter unitConverter) Calculate the change in population between prior and current equipment.Get the prior year GHG consumption.Get the prior year population.Get the prior year volume from sales stream.Get the prior years elapsed (max of getYearsElapsed - 1 and 0).Get the consumption ratio per unit volume of substance.Get the total volume from sales for the current state.Get number of years in the simulation since the last step.
-
Constructor Details
-
ConverterStateGetter
Create a new converter state getter.- Parameters:
engine- The engine instance to query for state information
-
-
Method Details
-
getSubstanceConsumption
Get the consumption ratio per unit volume of substance.- Specified by:
getSubstanceConsumptionin interfaceStateGetter- Returns:
- The consumption per volume ratio in tCO2e/kg or tCO2e/mt
- Throws:
RuntimeException- If consumption or volume units are not as expected
-
getEnergyIntensity
Get the energy consumption intensity per unit volume.- Specified by:
getEnergyIntensityin interfaceStateGetter- Returns:
- The energy intensity as a ratio (e.g., kwh/mt or kwh/kg)
- Throws:
RuntimeException- If consumption or volume units are not as expected
-
getAmortizedUnitVolume
Get the amortized initial charge volume per unit for sales.- Specified by:
getAmortizedUnitVolumein interfaceStateGetter- Returns:
- The amortized initial charge volume in kg or mt per unit
-
getPopulation
Get the current equipment population.- Specified by:
getPopulationin interfaceStateGetter- Returns:
- The equipment count in units
-
getYearsElapsed
Get number of years in the simulation since the last step.- Specified by:
getYearsElapsedin interfaceStateGetter- Returns:
- The elapsed time in years since the last step
-
getGhgConsumption
Get the total ghg consumption for the current state.- Specified by:
getGhgConsumptionin interfaceStateGetter- Returns:
- The consumption value in tCO2e
-
getEnergyConsumption
Get the total energy consumption for the current state.- Specified by:
getEnergyConsumptionin interfaceStateGetter- Returns:
- The consumption value in kwh
-
getVolume
Get the total volume from sales for the current state.- Specified by:
getVolumein interfaceStateGetter- Returns:
- The volume in kg or mt
-
getAmortizedUnitConsumption
Get the consumption ratio per unit of population.- Specified by:
getAmortizedUnitConsumptionin interfaceStateGetter- Returns:
- The consumption per unit ratio in tCO2e/unit
- Throws:
RuntimeException- If population or volume units are not as expected
-
getPopulationChange
Calculate the change in population between prior and current equipment.- Specified by:
getPopulationChangein interfaceStateGetter- Parameters:
unitConverter- Converter for ensuring consistent units- Returns:
- The population change in units
-
getPriorVolume
Get the prior year volume from sales stream.- Specified by:
getPriorVolumein interfaceStateGetter- Returns:
- The prior year volume with units like "kg" or "mt", or current year if no prior
-
getPriorGhgConsumption
Get the prior year GHG consumption.- Specified by:
getPriorGhgConsumptionin interfaceStateGetter- Returns:
- The prior year GHG consumption with units like "tCO2e", or current year if no prior
-
getPriorPopulation
Get the prior year population.- Specified by:
getPriorPopulationin interfaceStateGetter- Returns:
- The prior year population with units like "units", or current year if no prior
-
getPriorYearsElapsed
Get the prior years elapsed (max of getYearsElapsed - 1 and 0).- Specified by:
getPriorYearsElapsedin interfaceStateGetter- Returns:
- The prior years elapsed with units like "year"
-