Class ProcessComparisonRunner

java.lang.Object
neqsim.mcp.runners.ProcessComparisonRunner

public final class ProcessComparisonRunner extends Object
Compares two or more process configurations side by side.

Accepts an array of process cases (each with its own fluid and process definition), runs them all, and returns a comparison table highlighting differences in key outputs (temperatures, pressures, duties, compositions).

Version:
1.0
Author:
Even Solbraa
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final com.google.gson.Gson
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Private constructor — all methods are static.
  • Method Summary

    Modifier and Type
    Method
    Description
    private static com.google.gson.JsonObject
    buildComparisonSummary(List<String> caseNames, List<com.google.gson.JsonObject> caseResults)
    Builds a comparison summary from individual case results.
    private static String
    errorJson(String message)
    Creates an error JSON response.
    private static boolean
    hasError(com.google.gson.JsonObject result)
    Checks if a result JSON indicates an error.
    static String
    run(String json)
    Runs multiple process cases and compares results.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • GSON

      private static final com.google.gson.Gson GSON
  • Constructor Details

    • ProcessComparisonRunner

      private ProcessComparisonRunner()
      Private constructor — all methods are static.
  • Method Details

    • run

      public static String run(String json)
      Runs multiple process cases and compares results.
      Parameters:
      json - JSON with "cases" array, each containing a full process definition
      Returns:
      JSON with comparison table and individual results
    • buildComparisonSummary

      private static com.google.gson.JsonObject buildComparisonSummary(List<String> caseNames, List<com.google.gson.JsonObject> caseResults)
      Builds a comparison summary from individual case results.
      Parameters:
      caseNames - list of case names
      caseResults - list of result JSON objects
      Returns:
      comparison JSON object
    • hasError

      private static boolean hasError(com.google.gson.JsonObject result)
      Checks if a result JSON indicates an error.
      Parameters:
      result - the result JSON object
      Returns:
      true if the result has error status
    • errorJson

      private static String errorJson(String message)
      Creates an error JSON response.
      Parameters:
      message - the error message
      Returns:
      JSON string with status error