Class EngineResultSerializer

java.lang.Object
org.kigalisim.engine.serializer.EngineResultSerializer

public class EngineResultSerializer extends Object
Decorator around an engine to serialize out results.

This class wraps an Engine instance and provides methods to extract structured results for specific simulation parameters.

  • Constructor Details

    • EngineResultSerializer

      public EngineResultSerializer(Engine engine, ConverterStateGetter stateGetter)
      Create a new decorator to produce engine result snapshots.
      Parameters:
      engine - The engine from which results will be serialized
      stateGetter - State getter by which to access values at the current state that the engine is focusing on. This will not be modified, only read.
  • Method Details

    • getResult

      public EngineResult getResult(UseKey useKey, int year)
      Serialize the results for an application and substance in a given year.
      Parameters:
      useKey - The UseKey containing application and substance information
      year - The year for which a result should be serialized
      Returns:
      Snapshot of the result in the current engine state for the given application and substance