Class FWSimOutputManager

java.lang.Object
net.simplace.sim.io.output.FWSimOutputManager

public class FWSimOutputManager extends Object
With the output part of the main configuration xml the outputters are instantiated in their given format and field (var-Map), frequence (Yearly, Monthly, Daily, Complex) and generalization method (Sum,Mean,Max, Min, Complex Rule (Value at day of Anthesis)) Singleton implementation Holds different out putters for the model threads Ensures the efficient use of the resources Takes data via VarMap and the containing SimVariables Values are piped into the different output adapters Division between Data format and content using IO Interfaces Able to abstract data access format as Database via SQL Excel (csv) Uses File Access Pool and Connection Pool Have own Threads for writing output
Author:
Andreas Enders
  • Constructor Details

    • FWSimOutputManager

      public FWSimOutputManager(FWSimSession aFwSimSession)
      Parameters:
      aFwSimSession -
  • Method Details

    • addOutput

      public void addOutput(org.jdom2.Element aOutput, FWSimVarMap aVarMap, FWSimProject.PROJECT_MODE aProjectMode)
      adds an output to the list of outputs. for format description of the xml-structure see
      Parameters:
      aOutput -
      aVarMap -
      aProjectMode -
      See Also:
    • addOutput

      public void addOutput(FWSimOutput aOutput)
      Parameters:
      aOutput - to add
    • getOutput

      public FWSimOutput getOutput(String aName)
      Parameters:
      aName -
      Returns:
      the FWSimOutput with given name
    • OUTPUT

      public void OUTPUT(LocalDateTime aCurrentDate, FWSimVarMap aVarMap, String aOutputType)
      outputs the content of VarMap to all configured output adapters
      Parameters:
      aCurrentDate -
      aVarMap -
      aOutputType -
    • outputCalibrationResult

      public void outputCalibrationResult(FWSimVarMap aVarMap)
      outputs the content of VarMap to all configured output adapters
      Parameters:
      aVarMap - Array of selected Simulations data
    • calculateStatistics

      public void calculateStatistics(FWSimVarMap aVarMap)
      outputs the content of VarMap to all configured output adapters
      Parameters:
      aVarMap -
    • runOutputWriters

      public void runOutputWriters()
      run all output writers in own threads - started once after initializing the system.
    • stopOutputWriters

      public void stopOutputWriters()
      stop all output writers in own threads - stopped imediately after stopping the session once after initializing the system.
    • updateInterface

      public boolean updateInterface(FWSimInterface<?> aInterface, FWSimVarMap aVarMap)
      Parameters:
      aInterface -
      aVarMap -
      Returns:
      true, if an interface was updated successfully, otherwise returns false
    • initializeOutputs

      public void initializeOutputs(FWSimVarMap aVarMap, FWSimProject.PROJECT_MODE aProject_MODE)
      Parameters:
      aVarMap -
      aProject_MODE -
    • isOutputStillWriting

      public boolean isOutputStillWriting()
      run all output writers in own threads - started once after initializing the system.
      Returns:
      if output queue is still writing
    • reset

      public void reset() throws Exception
      Throws:
      Exception
      See Also:
    • getOutputAdapters

      public ArrayList<FWSimOutputAdapter> getOutputAdapters()
      Returns:
      all the output adapters
    • getInterface

      public FWSimInterface<?> getInterface(String aName)
      Parameters:
      aName -
      Returns:
      the connected Interface to the output adapters
    • registerOutputListener

      public void registerOutputListener(FWSimOutputListener aOutputListener)
      Parameters:
      aOutputListener -
    • removeOutputListener

      public void removeOutputListener(FWSimOutputListener aOutputListener)
      Parameters:
      aOutputListener -
    • registerSimulations

      public void registerSimulations(List<FWSimSimulation> aSimulations)
      Parameters:
      aSimulations -
    • finishSimulationOutputs

      public void finishSimulationOutputs(FWSimVarMap aVarMap)
      removes the output caches from the outputs.
      Parameters:
      aVarMap -
    • clearSimulations

      public void clearSimulations()
    • isWriterThreadStarted

      public boolean isWriterThreadStarted()
      Returns:
      the isWriterThreadStarted
    • checkSkipAboveSize

      public boolean checkSkipAboveSize(FWSimVarMap aVarMap)
      Parameters:
      aVarMap -
      Returns:
      if project should be skiped
    • updateAdapter

      public void updateAdapter(FWSimVarMap aVarMap)
      updates the FWSimVarMap in all stored FWSimResourceCache
      Parameters:
      aVarMap -
    • removeAdapter

      public void removeAdapter(FWSimFieldContainer aFieldContainer)
      removes an FWSimOutput to remove it from solution - used in GUI
      Parameters:
      aFieldContainer -